/* TongLuc Linked Variations - Swatch Style Frontend CSS */

.tlv-linked-variations-wrapper {
    margin: 20px 0;
    padding: 0;
}

/* Swatch Group */
.tlv-swatch-group {
    margin-bottom: 30px;
}

.tlv-swatch-legend {
    display: flex;
    align-items: center;
    margin: 0 0 15px 0;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    list-style: none;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tlv-swatch-label-name {
    font-weight: 700;
    color: #000;
    margin-right: 5px;
    text-transform: uppercase;
}

.tlv-swatch-label-value {
    color: #666;
    font-weight: 400;
    text-transform: uppercase;
}

/* Swatch Options Container */
.tlv-swatch-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

/* Individual Swatch Option */
.tlv-swatch-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 0;
    border: 2px solid #bbb;
    border-radius: 3px;
    background: #f5f5f5;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    overflow: hidden;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tlv-swatch-option:hover {
    border-color: #666;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.tlv-swatch-option.selected {
    border-color: #333;
    border-width: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tlv-swatch-option.tlv-no-link {
    cursor: default;
    pointer-events: none;
}

.tlv-swatch-option.tlv-no-link:hover {
    border-color: #bbb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transform: none;
}

/* Swatch Image (with background) */
.tlv-swatch-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tooltip inside swatch */
.tlv-swatch-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, bottom 0.25s ease;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tlv-swatch-option:hover .tlv-swatch-tooltip {
    opacity: 1;
    bottom: -35px;
}

/* Swatch Label (text-only variant) */
.tlv-swatch-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-align: center;
    padding: 4px;
    word-break: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tlv-swatch-option {
        width: 44px;
        height: 44px;
        border-width: 2px;
    }

    .tlv-swatch-option.selected {
        border-width: 3px;
    }

    .tlv-swatch-legend {
        flex-wrap: wrap;
        margin-bottom: 15px;
        font-size: 12px;
    }

    .tlv-swatch-label-name {
        flex: 0 0 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }

    .tlv-swatch-tooltip {
        font-size: 10px;
        padding: 5px 8px;
        bottom: -28px;
    }

    .tlv-swatch-option:hover .tlv-swatch-tooltip {
        bottom: -32px;
    }

    .tlv-swatch-options {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .tlv-swatch-option {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }

    .tlv-swatch-option.selected {
        border-width: 2px;
    }

    .tlv-swatch-options {
        gap: 6px;
    }

    .tlv-swatch-legend {
        font-size: 11px;
    }

    .tlv-swatch-tooltip {
        font-size: 9px;
        padding: 4px 6px;
        bottom: -26px;
    }

    .tlv-swatch-option:hover .tlv-swatch-tooltip {
        bottom: -30px;
    }
}

/* Legacy styles for backward compatibility */
.tlv-attribute-info {
    font-size: 12px;
    margin-top: 8px;
    text-align: center;
}

.tlv-attribute-item {
    margin: 4px 0;
    color: #666;
    line-height: 1.4;
}

.tlv-attribute-label {
    color: #333;
    font-weight: 600;
}

.tlv-attribute-value {
    color: #666;
}

.tlv-product-thumbnail {
    cursor: help;
}

/* Print styles */
@media print {
    .tlv-linked-variations-wrapper {
        display: none;
    }
}
