/* Tinted Visual Swatches - Custom Implementation */
.tinted-visual-swatches {
    margin: 20px 0;
}

.tinted-swatch-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

/* Loading State */
.tinted-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #666;
    gap: 10px;
}

.tinted-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #dc2626;
    border-radius: 50%;
    animation: tinted-spin 1s linear infinite;
}

@keyframes tinted-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Grid Layout */
.tinted-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 130px);
    gap: 15px;
    padding: 10px 0;
    justify-content: start;
}

/* Individual Swatch Item */
.tinted-swatch-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tinted-swatch-item:hover {
    transform: translateY(-2px);
}

.tinted-swatch-item.selected {
    transform: translateY(-2px) scale(1.02);
}

/* Hidden Radio Input */
.tinted-swatch-input {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Swatch Image Display */
.tinted-swatch-image {
    width: 130px;
    height: 130px;
    border-radius: 3px;
    border: 2px solid transparent;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    opacity: 1;
}

.tinted-swatch-item:hover .tinted-swatch-image {
    box-shadow: 0 5px 15px rgba(0,0,0,0.25);
}

.tinted-swatch-item.selected .tinted-swatch-image {
    border-color: rgb(155, 35, 33);
}

.tinted-swatch-item.selected .tinted-swatch-image::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.tinted-swatch-item.selected .tinted-swatch-image::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml,<svg viewBox="0 0 24 24" fill="none" stroke="%239b2321" stroke-width="3" xmlns="http://www.w3.org/2000/svg"><polyline points="20 6 9 17 4 12"></polyline></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
}

/* Attribute Code Label at Bottom */
.tinted-attribute-label {
    padding: 4px;
    position: absolute;
    bottom: 0px;
    text-align: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    z-index: 1;
}

.tinted-attribute-brand {
    font-weight: bold;
    margin-bottom: 2px;
}

.tinted-attribute-code {
    font-size: 12px;
    font-weight: bold;
}


/* No Attributes State */
.tinted-no-attributes {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tinted-swatch-grid {
        grid-template-columns: repeat(auto-fill, 100px);
        gap: 10px;
    }
    
    .tinted-swatch-image {
        width: 100px;
        height: 100px;
    }
    
    .tinted-swatch-item.selected .tinted-swatch-image::after {
        width: 24px;
        height: 24px;
    }
    
    .tinted-swatch-item.selected .tinted-swatch-image::before {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .tinted-swatch-grid {
        grid-template-columns: repeat(auto-fill, 80px);
        gap: 8px;
    }
    
    .tinted-swatch-image {
        width: 80px;
        height: 80px;
    }
    
    .tinted-swatch-item.selected .tinted-swatch-image::after {
        width: 20px;
        height: 20px;
    }
    
    .tinted-swatch-item.selected .tinted-swatch-image::before {
        width: 14px;
        height: 14px;
    }
}