﻿/* ==========================================================================
   Product Variation Selector Styles
   ========================================================================== */

/* Legacy btn-group compatibility */
.variation-selector .btn-group .btn {
    min-width: 80px;
}

.variation-selector .btn-outline-primary:hover {
    background-color: var(--bs-primary);
    color: white;
}

.selected-variation-info {
    border-left: 4px solid var(--bs-primary);
}

/* Legacy price display */
.product-price .old-price {
    font-size: 1.2rem;
}

.product-price .sale-price {
    font-size: 1.5rem;
}

.stock-status .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* ==========================================================================
   Color Swatches (.btn-color-swatch)
   ========================================================================== */
.btn-color-swatch {
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-color-swatch:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-color-swatch.selected {
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.3);
}

.btn-color-swatch:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Legacy .color-swatch (circle style) */
.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-swatch:hover,
.color-swatch.selected {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.25);
}

/* ==========================================================================
   Variation Image Thumbnails (.btn-variation-image)
   ========================================================================== */
.btn-variation-image {
    position: relative;
    width: 125px;
    height: 125px;
    padding: 0;
    margin: 5px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: var(--bg-light);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.btn-variation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.btn-variation-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.65rem;
    color: #6c757d;
    text-align: center;
}

.btn-variation-image:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-variation-image.selected {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.3);
}

.btn-variation-image .selected-check {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 0.85rem;
    color: var(--bs-primary);
    background: #fff;
    border-radius: 50%;
}

.btn-variation-image.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-variation-image .oos-line {
    position: absolute;
    top: 50%;
    left: -5%;
    width: 110%;
    height: 2px;
    background-color: #dc3545;
    transform: rotate(-45deg);
}

/* ==========================================================================
   Size / Text Option Buttons (.btn-size-option)
   ========================================================================== */
.btn-size-option {
    min-width: 48px;
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #212529;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9375rem;
}

.btn-size-option.btn-sm {
    min-width: 40px;
    min-height: 36px;
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
}

.btn-size-option.btn-lg {
    min-width: 56px;
    min-height: 48px;
    padding: 0.625rem 1rem;
    font-size: 1rem;
}

.btn-size-option:not(.disabled):not(.selected):hover {
    border-color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Selected: dark fill, white text (light theme) */
.btn-size-option.selected {
    border-color: #212529;
    background-color: #212529;
    color: #fff;
    font-weight: 600;
}

/* Disabled / out-of-stock */
.btn-size-option.disabled {
    background-color: #f8f9fa;
    color: #adb5bd;
    border-color: #e9ecef;
    cursor: not-allowed;
    opacity: 1;
}

.btn-size-option.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   Mobile — shrink variation image thumbnails from 125px to 80px
   ========================================================================== */
@media (max-width: 575.98px) {
    .btn-variation-image {
        width: 80px;
        height: 80px;
    }
}
