/* Product Variations Container */
.product-variations {
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px solid #eee;
}

/* Size Selector Styles */
.product-size-selector {
    margin-bottom: 12px;
}

.product-size-selector .form-label-sm {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.product-size-selector .form-select-sm {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.product-size-selector .form-select-sm:focus {
    border-color: var(--accent-color, #007bff);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Color Selector Styles */
.product-color-selector {
    margin-bottom: 12px;
}

.product-color-selector .form-label-sm {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.color-option {
    width: 28px;
    height: 28px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background-clip: content-box;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.color-option:hover {
    border-color: #999;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.color-option.selected {
    border-color: var(--accent-color, #007bff);
    border-width: 3px;
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.color-option.selected .color-check {
    opacity: 1;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Special handling for light colors when selected */
.color-option.selected[style*="white"] .color-check,
.color-option.selected[style*="#fff"] .color-check,
.color-option.selected[style*="#ffffff"] .color-check,
.color-option.selected[style*="yellow"] .color-check,
.color-option.selected[style*="#ffff"] .color-check,
.color-option.selected[style*="beige"] .color-check {
    color: #333;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    font-weight: bold;
}

.color-option.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    position: relative;
}

.color-option.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #ff0000;
    transform: rotate(45deg);
}

.color-option.out-of-stock:hover {
    transform: none;
    border-color: #ddd;
    box-shadow: none;
}

.color-check {
    color: #fff;
    font-size: 12px;
    opacity: 0;
    transition: all 0.2s ease;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
    pointer-events: none;
}

.color-option.selected .color-check {
    opacity: 1;
}

/* Special handling for light colors */
.color-option[style*="white"],
.color-option[style*="#fff"],
.color-option[style*="#ffffff"],
.color-option[style*="yellow"],
.color-option[style*="#ffff"],
.color-option[style*="beige"] {
    border-color: #ccc;
}

.color-option[style*="white"] .color-check,
.color-option[style*="#fff"] .color-check,
.color-option[style*="#ffffff"] .color-check,
.color-option[style*="yellow"] .color-check,
.color-option[style*="#ffff"] .color-check,
.color-option[style*="beige"] .color-check {
    color: #333;
    text-shadow: none;
}

/* Stock Status Styles */
.stock-status {
    font-size: 0.7rem;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.stock-status.in-stock {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.stock-status.low-stock {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.stock-status.out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.stock-status.pending {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
    font-style: italic;
}

.variation-error {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 5px;
    padding: 4px 8px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    animation: shake 0.5s ease-in-out;
}

/* Error Animation */
@keyframes shake {
    0%, 20%, 40%, 60%, 80% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .color-option {
        width: 24px;
        height: 24px;
    }
    
    .color-check {
        font-size: 10px;
    }
    
    .product-size-selector .form-select-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .stock-status {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    .variation-error {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}



/* Loading States */
.color-option.loading {
    opacity: 0.5;
    pointer-events: none;
}

.size-selector.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Skeleton Loading for Variations */
.skeleton-variations {
    height: 80px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-top: 10px;
}

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

/* Enhanced Product Price Display */
.product-card .product-price {
    margin-bottom: 8px;
    font-weight: 600;
}

.product-card .current-price {
    color: var(--accent-color, #007bff);
    font-size: 1.1rem;
}

.product-card .original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-left: 8px;
}

/* Price Update Animation */
.product-card .current-price.updating {
    animation: priceUpdate 0.3s ease-in-out;
}

@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); color: #28a745; }
    100% { transform: scale(1); }
}


/* Better Focus States */
.size-selector:focus,
.color-option:focus {
    outline: 2px solid var(--accent-color, #007bff);
    outline-offset: 2px;
}

/* Accessibility Improvements */
.color-option[aria-pressed="true"] {
    border-color: var(--accent-color, #007bff);
    border-width: 3px;
}

.color-option:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}


@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Mobile Experience */
@media (max-width: 768px) {
    .product-variations {
        padding: 8px 0;
        margin-top: 12px;
    }
    
    .color-palette {
        gap: 4px;
    }
    
    .product-size-selector,
    .product-color-selector {
        margin-bottom: 10px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        font-size: 0.9rem;
    }
    
    .stock-status {
        display: block;
        text-align: center;
        margin: 8px 0;
    }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    .product-variations {
        border-top-color: #444;
    }
    
    .product-size-selector .form-label-sm,
    .product-color-selector .form-label-sm {
        color: #f8f9fa;
    }
    
    .product-size-selector .form-select-sm {
        background-color: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .color-option {
        border-color: #495057;
    }
    
    .variation-error {
        background-color: #58151c;
        border-color: #842029;
        color: #f8d7da;
    }
    
    .stock-status.in-stock {
        background-color: #051b11;
        color: #75b798;
        border-color: #0f5132;
    }
    
    .stock-status.low-stock {
        background-color: #332701;
        color: #ffda6a;
        border-color: #664d03;
    }
    
    .stock-status.out-of-stock {
        background-color: #2c0b0e;
        color: #f1aeb5;
        border-color: #842029;
    }
}

/* Color Filter Widget Styles */
.color-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.color-filter-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.color-filter-item.selected {
    border-color: var(--primary-color, #007bff);
    transform: scale(1.05);
}

.color-filter-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
}

.color-filter-label:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ddd;
    margin-bottom: 4px;
    display: block;
}

.color-name {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60px;
}

.color-checkmark {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: var(--primary-color, #007bff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.color-checkmark i {
    color: white;
    font-size: 10px;
}

.color-filter-item.selected .color-checkmark {
    opacity: 1;
    transform: scale(1);
}

/* Special handling for light colors */
.color-swatch[style*="white"],
.color-swatch[style*="#fff"],
.color-swatch[style*="#ffffff"],
.color-swatch[style*="yellow"],
.color-swatch[style*="#ffff"],
.color-swatch[style*="beige"] {
    border-color: #999;
}

/* Filter Loading Styles */
.filter-loading-overlay {
    border-radius: 8px;
}

.filter-loading-content {
    text-align: center;
    color: #666;
}

.filter-loading-content .loading-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Filter Button Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Quick Feedback Styles */
.quick-feedback {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 500;
}









/* Mobile Filter Toggle & Responsive Styles */
.mobile-filter-toggle {
    display: none !important;
}

/* Mobile Sidebar Behavior */
.sidebar {
    transition: transform 0.3s ease-in-out;
}

/* Mobile Styles */
@media (max-width: 991.98px) {
    /* Show mobile filter button */
    .mobile-filter-toggle {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }
    
    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        height: 100vh;
        background: white;
        z-index: 1050;
        transform: translateX(-100%);
        overflow-y: auto;
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.mobile-visible {
        transform: translateX(0);
    }
    
    /* Overlay when sidebar is open */
    .sidebar.mobile-visible::before {
        content: '';
        position: fixed;
        top: 0;
        right: 0;
        width: 15%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: -1;
    }
    
    /* 2 products per row on mobile */
    .category-product-list .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 8px;
    }
    
    /* Reduce product box size for mobile */
    .product-box {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .product-thumb {
        height: 150px;
        margin-bottom: 10px;
    }
    
    .product-thumb img {
        height: 100%;
        object-fit: cover;
    }
    
    .product-title {
        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    
    .product-title a {
        font-size: inherit;
    }
    
    .product-price {
        margin-bottom: 6px;
    }
    
    .current-price {
        font-size: 1rem !important;
    }
    
    .original-price {
        font-size: 0.8rem !important;
    }
    
    .product-rating-container {
        margin-bottom: 8px;
    }
    
    .rating-stars {
        font-size: 0.8rem;
    }
    
    .rating-number {
        font-size: 0.8rem;
    }
    
    /* Reduce variation elements size */
    .product-variations {
        margin-top: 8px;
        padding-top: 8px;
    }
    
    .product-size-selector,
    .product-color-selector {
        margin-bottom: 8px;
    }
    
    .product-size-selector .form-label-sm,
    .product-color-selector .form-label-sm {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .product-size-selector .form-select-sm {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
    
    .color-palette {
        gap: 4px;
    }
    
    .color-option {
        width: 22px;
        height: 22px;
    }
    
    .color-check {
        font-size: 10px;
    }
    
    .stock-status {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
    
    /* Reduce product overlay actions */
    .product-overlay {
        padding: 8px;
    }
    
    .product-quick-actions {
        margin-bottom: 8px;
    }
    
    .quick-action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .add-to-cart-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* Adjust filter header for mobile */
    .filter-container {
        margin-bottom: 20px;
    }
    
    .filter-item {
        margin-bottom: 12px;
    }
    
    .view-options .btn {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    .items-per-page .form-select {
        font-size: 0.85rem;
        padding: 6px 8px;
    }
    
    /* Reduce badge size */
    .product-label {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

/* Extra small mobile devices */
@media (max-width: 575.98px) {
    .category-product-list .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 6px;
    }
    
    .product-box {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .product-thumb {
        height: 130px;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    
    .current-price {
        font-size: 0.95rem !important;
    }
    
    .mobile-filter-toggle {
        bottom: 15px;
        right: 15px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .category-product-list .quick-action-btn {
        width: 22px;
        height: 22px;
        font-size: 0.6rem !important;
    }

    .category-product-list .product-overlay {
      padding: 0.2rem;
    }
    .category-product-list .add-to-cart-container {
        padding-bottom: 10px;
    }
    .category-product-list .add-to-cart-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.65rem;
    }
    .category-product-list .product-content {
        padding: 0.35rem;
    }

    .category-product-list .product-title {
        font-size: 0.65rem;
        height: 1.9rem;
        line-height: unset;
        margin-bottom: 0.25rem;
    }
    .category-product-list .product-details {
        margin-bottom: 0.2rem;
    }


    .best-sellers .product-actions button i {
        font-size: 0.6rem;
    }
    .best-sellers .product-actions button {
        width: 22px;
        height: 22px;
        font-size: 0.6rem !important;
    }
    .best-sellers .product-title {
        font-size: 0.65rem;
        height: 1.9rem;
        line-height: unset;
        margin-bottom: 0.25rem;
    }
    .best-sellers .btn-add-to-cart {
        padding: 0.2rem;
        font-size: 0.65rem;
    }
    .stock-status {
        font-size: 0.5rem;
        padding: 3px 6px;
    }
    .variation-error {
        font-size: 0.5rem;
    }

}

/* Prevent body scroll when sidebar is open */
body.sidebar-open {
    overflow: hidden;
}

section, .section {
    padding: 30px 0 10px;
    /* scroll-margin-top: 90px;
    overflow: clip; */
}

.category-product-list .product-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.category-product-list .product-thumb {
    background-color: #f8f9fa;
}

/* Single Size Display Badge */
.single-size-display {
    display: inline-flex;
    align-items: center;
}

.single-size-display .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Fit Type Alert Styling */
.product-fit-info .alert {
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.product-fit-info .alert-heading {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.product-fit-info .alert p {
    font-size: 0.9rem;
}




/* Size Filter Styling */
.size-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.size-filter-item {
    position: relative;
    transition: all 0.3s ease;
}

.size-filter-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    height: 100%;
}

.size-filter-label:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.size-filter-item.selected .size-filter-label {
    border-color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.1);
}

.size-badge {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
}

.size-checkmark {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.size-filter-item.selected .size-checkmark {
    display: flex;
}

.size-filter-content .filter-actions {
    display: flex;
    gap: 8px;
}

.size-filter-content .filter-actions .btn {
    flex: 1;
}