/**
 * Custom Swatch Styles for Rs360 Hyva Theme
 * Swatch hover → gallery preview behavior + Figma design match
 */

/* Swatch Attribute Label */
.swatch-attribute-label {
    display: inline-block;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

/* Selected Option Display */
.swatch-attribute-selected-option {
    display: inline-block;
    font-weight: 700;
    color: #111827;
    margin-left: 0.5rem;
}

/* Swatch Options Wrapper */

.swatch-attribute-options.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Hidden Input for Validation */
.swatch-input.super-attribute-select {
    visibility: hidden;
    position: absolute;
    left: -1000px;
    width: 1px;
    height: 1px;
}

/* Error Message Container */
.errorMessage {
    display: block;
    min-height: 1px;
}

/* ============================================
   Base Swatch Option (all types)
   Figma: 4px border-radius, smooth transitions
   ============================================ */

/* ============================================
   Text Swatch Styles
   ============================================ */
.swatch-option.text {
    padding: 0.5rem 0.75rem;
    border-color: #d1d5db;
    background-color: #ffffff;
    cursor: pointer;
    min-width: 40px;
    text-align: center;
}

.swatch-option.text:hover {
    border-color: #6b7280;
    background-color: #f3f4f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.swatch-option.text.swatch-selected {
    border-color: #111827;
    background-color: #f9fafb;
    font-weight: 600;
    box-shadow: 0 0 0 1px #111827;
}

/* ============================================
   Visual Swatch (Color/Image) Styles
   Figma: 40x40 with 4px radius, 2px border
   ============================================ */
.swatch-option.color,
.swatch-option.image {
    width: 2.5rem;
    height: 2.5rem;
    border-color: #e5e7eb;
    cursor: pointer;
}

/* Hover: elevate with shadow + darker border */
.swatch-option.color:hover,
.swatch-option.image:hover {
    border-color: #6b7280;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

/* Hover-active state (tracked by Alpine) */
.swatch-option.swatch-hover-active {
    border-color: #6b7280;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

/* Selected: solid dark ring */
.swatch-option.color.swatch-selected,
.swatch-option.image.swatch-selected {
    border-color: #111827;
    box-shadow: 0 0 0 2px #111827;
    transform: scale(1);
}

/* ============================================
   Disabled / Out-of-stock Swatch
   ============================================ */
.swatch-option.swatch-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.swatch-option.color.swatch-disabled::after,
.swatch-option.image.swatch-disabled::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -2px;
    right: -2px;
    height: 1px;
    background-color: #ef4444;
    transform: rotate(-45deg);
}

.swatch-option.text.swatch-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ============================================
   Responsive: Mobile
   No hover on touch, slightly smaller swatches
   ============================================ */
@media (max-width: 640px) {
    .swatch-attribute {
        margin-bottom: 0.75rem;
    }

    .swatch-option.text {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }

    .swatch-option.color:hover,
    .swatch-option.image:hover,
    .swatch-option.swatch-hover-active {
        transform: none;
        box-shadow: none;
    }
}