/* Color Selector Styles (Text Version) */
.color-selector {
    margin: 1.5rem 0;
}

/* Hide the old label */
.color-selector label {
    display: none;
}

.color-options {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.color-option {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    background: #fafafa;
    font-size: 0.95rem;
    text-transform: capitalize;
    min-width: 90px;
    font-weight: 500;
    color: #333;
    position: relative;
    overflow: hidden;
}

.color-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 90, 43, 0.1), transparent);
    transition: left 0.6s ease;
}

.color-option:hover::before {
    left: 100%;
}

.color-option:hover {
    border-color: #8b5a2b;
    background: #f8f4f0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 90, 43, 0.15);
}

.color-option.active {
    border-color: #8b5a2b;
    background: #f8f4f0;
    box-shadow: 0 4px 16px rgba(139, 90, 43, 0.25);
    color: #8b5a2b;
    font-weight: 600;
    transform: translateY(-1px);
}

.color-option.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: #8b5a2b;
    border-radius: 2px;
    animation: slideIn 0.3s ease-out;
}

/* Remove color swatch circle */
.color-preview {
    display: none;
}

/* Text inside color box */
.color-text {
    display: inline-block;
    transition: transform 0.3s ease;
}

.color-option:hover .color-text {
    transform: scale(1.05);
}

/* Smooth stock updates */
.stock-info {
    transition: all 0.5s ease-in-out;
}

.stock-updating {
    animation: gentlePulse 1.5s ease-in-out;
}

.size-stock-grid {
    transition: all 0.4s ease-in-out;
}

.size-stock-item {
    transition: all 0.3s ease;
    padding: 4px 0;
}

.size-stock-item.updating {
    background: linear-gradient(90deg, #f8f4f0, #fff, #f8f4f0);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out;
}

.quantity-selector {
    transition: all 0.4s ease-in-out;
}

.quantity-selector.updating {
    animation: gentleGlow 1s ease-in-out;
}

.action-buttons {
    transition: all 0.4s ease-in-out;
}

.action-buttons.updating button {
    animation: buttonPulse 0.8s ease-in-out;
}

/* Loading animation */
.stock-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-style: italic;
    animation: fadeIn 0.5s ease-out;
}

.stock-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #8b5a2b;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success state */
.stock-update-success {
    animation: slideDown 0.5s ease-out;
    background: #f0f9f0;
    border: 1px solid #d1f0d1;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    color: #2d5a2d;
    font-size: 0.9rem;
}

/* Animations */
@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 30px;
        opacity: 1;
    }
}

@keyframes gentlePulse {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(139, 90, 43, 0.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes gentleGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(139, 90, 43, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(139, 90, 43, 0.1);
    }
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

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

/* Smooth transitions for stock states */
.stock-low, .stock-available, .stock-out {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Size option transitions */
.size-option {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.size-option.disabled {
    opacity: 0.5;
    transform: scale(0.95);
}

.size-option:not(.disabled):hover {
    transform: translateY(-2px) scale(1.02);
}

/* Quantity input smooth transitions */
.quantity-input {
    transition: all 0.3s ease;
}

.quantity-input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1);
}

/* Button transitions */
.add-to-cart, .wishlist-btn, .checkout-btn {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.add-to-cart:hover:not(:disabled),
.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 90, 43, 0.2);
}

.add-to-cart:disabled,
.checkout-btn:disabled {
    opacity: 0.6;
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
    .color-options {
        gap: 0.6rem;
    }

    .color-option {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
        min-width: 75px;
    }
    
    .stock-loading {
        font-size: 0.9rem;
    }
    
    .stock-update-success {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
}

/* Minimal transitions for instant feel */
.color-option {
    transition: all 0.2s ease;
}

.color-option:hover {
    border-color: #8b5a2b;
    background: #f8f4f0;
}

.color-option.active {
    border-color: #8b5a2b;
    background: #f8f4f0;
    color: #8b5a2b;
    font-weight: 600;
}

/* Smooth image transition only */
.main-product-image {
    transition: opacity 0.3s ease;
}

.main-product-image.updating {
    opacity: 0.8;
}

/* Stock info updates instantly */
.stock-info {
    transition: opacity 0.2s ease;
}