/* Frutify Custom Styles - Better than FreshDirect */

/* Mini Cart Styles */
.mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1060;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .mini-cart-overlay.show {
        opacity: 1;
    }

.mini-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: white;
    z-index: 1070;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mini-cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Slide animations */
.slide-in-right {
    transform: translateX(0) !important;
}

.slide-out-right {
    transform: translateX(100%) !important;
}

/* Bootstrap handles modals and offcanvas perfectly */

/* jQuery components work with Bootstrap out of the box */

/* Image placeholder fallback */
.img-placeholder {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    min-height: 200px;
    position: relative;
}

    .img-placeholder::before {
        content: '🥭';
        font-size: 48px;
        display: block;
        margin-bottom: 8px;
    }

    .img-placeholder::after {
        content: attr(data-text);
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 12px;
        opacity: 0.9;
    }

/* Product card image fallback */
.product-card img {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Ensure proper spacing */
.product-card-body {
    padding: 1.25rem;
}

/* Fix button alignment */
.quantity-selector {
    min-width: 100px;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
}

/* Modal Enhancements */
.modal {
    z-index: 1055;
}

.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: var(--shadow-medium);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 24px;
}

.modal-body {
    padding: 24px;
}

/* Variant Selection Modal Enhancements */
.variant-option {
    transition: all 0.2s ease;
    background: #fff;
}

    .variant-option:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        transform: translateY(-1px);
    }

.variant-cart-controls {
    min-width: 80px;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Extra small button size for compact layout */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 0.375rem;
    min-width: 32px;
    height: 28px;
}

.variant-add-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.variant-quantity-controls {
    min-width: 80px;
}

    .variant-quantity-controls .btn {
        width: 28px;
        height: 28px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
    }

.variant-quantity-display {
    min-width: 30px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Compact badge styling */
.badge-sm {
    font-size: 0.65rem;
    padding: 0.2em 0.4em;
}

/* Responsive adjustments for variant modal */
@media (max-width: 576px) {
    .variant-cart-controls {
        min-width: 70px;
    }

    .btn-xs {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
        min-width: 28px;
        height: 26px;
    }

    .variant-quantity-controls .btn {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    .variant-quantity-display {
        min-width: 25px;
        font-size: 0.8rem;
    }

    .badge-sm {
        font-size: 0.6rem;
        padding: 0.15em 0.3em;
    }
}

.modal.fade {
    transition: opacity 0.15s linear;
}

    .modal.fade .modal-dialog {
        transition: transform 0.3s ease-out;
        transform: translate(0, -50px);
    }

.modal.show .modal-dialog {
    transform: none;
}

/* Form Enhancements */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    transition: var(--transition-smooth);
}

    .form-control:focus {
        border-color: var(--primary-green);
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
    }

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

/* Button Enhancements */
.btn {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-success:not(.add-to-cart-btn) {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    border: none;
    box-shadow: var(--shadow-light);
}

    .btn-success:not(.add-to-cart-btn):hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-medium);
    }

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #e8f5e8, #f0fff0);
    padding: 60px 0;
    margin-bottom: 40px;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

/* Product Cards */
.product-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
    height: 100%;
}

    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-medium);
    }

    .product-card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }

.product-card-body {
    padding: 20px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 12px;
}

.product-unit {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

/* Category Tiles */
.category-tile {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
    height: 100%;
}

    .category-tile:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-medium);
        text-decoration: none;
    }

    .category-tile i {
        font-size: 3rem;
        color: var(--primary-green);
        margin-bottom: 15px;
    }

    .category-tile h5 {
        color: #333;
        font-weight: 600;
        margin-bottom: 10px;
    }

    .category-tile p {
        color: #666;
        font-size: 0.9rem;
        margin: 0;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .main-header {
        height: 60px;
    }

    .search-container {
        max-width: none !important;
    }

    .mini-cart {
        width: 100%;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .btn-outline-primary {
        min-width: auto;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Variant Selection Modal */
.variant-option {
    transition: all 0.2s ease;
    cursor: pointer;
}

    .variant-option:hover:not([disabled]) {
        border-color: var(--primary-green) !important;
        background-color: rgba(25, 135, 84, 0.1);
    }

    .variant-option.border-success {
        border-color: var(--primary-green) !important;
        background-color: rgba(25, 135, 84, 0.1) !important;
    }

    .variant-option[disabled] {
        cursor: not-allowed;
        opacity: 0.6;
    }

    /* Radio button styling for variant selection */
    .variant-option input[type="radio"] {
        width: 18px;
        height: 18px;
        margin: 0;
        cursor: pointer;
    }

        .variant-option input[type="radio"]:checked {
            background-color: var(--primary-green);
            border-color: var(--primary-green);
        }

    .variant-option label {
        cursor: pointer;
        margin: 0;
        width: 100%;
    }

    .variant-option[disabled] input[type="radio"],
    .variant-option[disabled] label {
        cursor: not-allowed;
    }

/* Empty Cart Button Styling */
#emptyCartBtn, #emptyCartBtnMain {
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

    #emptyCartBtn:hover, #emptyCartBtnMain:hover {
        color: #dc3545 !important;
        text-decoration: none;
    }

#emptyCartBtnMain {
    border-color: #dc3545;
    color: #dc3545;
}

    #emptyCartBtnMain:hover {
        background-color: #dc3545;
        color: white !important;
    }

.cursor-pointer {
    cursor: pointer;
}

/* Utility Classes */
.text-success-custom {
    color: var(--primary-green) !important;
}

.bg-success-custom {
    background-color: var(--primary-green) !important;
}

.border-success-custom {
    border-color: var(--primary-green) !important;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #1e7e34;
    }

/* Category Filter Styles */
.hover-bg-light:hover {
    background-color: #f8f9fa !important;
    transition: background-color 0.2s ease;
}

.category-filter-item a {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

    .category-filter-item a:hover {
        transform: translateX(2px);
        border-color: var(--border-color);
    }

    .category-filter-item a.bg-success-subtle {
        border-color: var(--primary-green);
    }

/* Subcategory Filter Styles */
.subcategory-filter-item a {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

    .subcategory-filter-item a:hover {
        transform: translateX(2px);
        border-color: var(--border-color);
    }

    .subcategory-filter-item a.bg-info-subtle {
        border-color: #0dcaf0;
    }

/* FreshDirect-style Product Card Styles */
.product-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }

.product-image {
    transition: transform 0.3s ease;
    border-radius: 0.375rem 0.375rem 0 0;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    font-size: 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
}



.product-title {
    font-size: 1rem;
    line-height: 1.2;
    color: #2d3748;
    font-weight: 600;
}

.product-subtext {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.3;
}

.stars i {
    font-size: 0.9rem;
}

.current-price {
    color: var(--primary-green) !important;
    font-weight: 700;
}

.add-to-cart-btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--primary-green);
    background-color: white !important;
    color: var(--primary-green) !important;
}

    .add-to-cart-btn:hover {
        background-color: var(--primary-green) !important;
        border-color: var(--primary-green);
        color: white !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    }

    .add-to-cart-btn:focus {
        background-color: var(--primary-green) !important;
        border-color: var(--primary-green);
        color: white !important;
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    }

.quantity-selector .input-group {
    max-width: 120px;
    margin: 0 auto;
}

.quantity-decrease, .quantity-increase {
    border-color: #d1d5db;
    color: #6b7280;
    width: 35px;
    padding: 0;
}

    .quantity-decrease:hover, .quantity-increase:hover {
        background-color: #f3f4f6;
        border-color: #9ca3af;
    }

.quantity-input {
    border-left: none;
    border-right: none;
    text-align: center;
    font-weight: 500;
}

/* Responsive adjustments for mobile (Kerala's 80% smartphone users) */
@media (max-width: 576px) {
    .product-card {
        margin-bottom: 1rem;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .current-price {
        font-size: 1.1rem !important;
    }

    .stars i {
        font-size: 0.8rem;
    }

    .product-badge {
        font-size: 0.7rem;
    }
}

/* Product grid responsive layout */
@media (min-width: 576px) {
    .product-grid .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 768px) {
    .product-grid .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (min-width: 992px) {
    .product-grid .col-lg-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
}

/* Lazy Loading Styles */
.lazy-image {
    transition: opacity 0.3s ease;
    background-color: #f8f9fa;
}

    .lazy-image.loading {
        opacity: 0.7;
    }

    .lazy-image.loaded {
        opacity: 1;
    }

    .lazy-image.error {
        opacity: 0.8;
        background-color: #f8f9fa;
    }

.image-loading-overlay {
    background-color: rgba(248, 249, 250, 0.9);
    border-radius: 0.375rem 0.375rem 0 0;
    transition: opacity 0.3s ease;
}

    .image-loading-overlay .spinner-border {
        width: 2rem;
        height: 2rem;
    }

/* Infinite Scroll Styles */
.load-more-trigger {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}



/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Loading states for product cards */
.product-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

    .product-card.loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }

/* Skeleton loading animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Enhanced Product Card Styles - Improved Layout */
.rating-weight-section {
    font-size: 0.875rem;
}

    .rating-weight-section .stars {
        font-size: 0.8rem;
    }

    .rating-weight-section .rating-section {
        order: 2; /* Ensure rating appears second (right side) */
    }

.product-weight {
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    order: 1; /* Ensure weight appears first */
}

/* Enhanced Pricing Section */
.pricing-section {
    align-items: baseline;
}

.current-price {
    font-size: 1.25rem !important;
    color: #28a745 !important;
    font-weight: 700 !important;
}

.original-price {
    font-size: 0.9rem;
    color: #6c757d;
}

.discount-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: #dc3545 !important;
    border-radius: 12px;
}

/* Enhanced Add to Cart Button */
.btn-add-to-cart {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .btn-add-to-cart:hover {
        background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    }

    .btn-add-to-cart:active {
        transform: translateY(0);
    }

    .btn-add-to-cart::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .btn-add-to-cart:hover::before {
        left: 100%;
    }

/* Quantity Selector Enhancement */
.quantity-selector {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.5rem;
}

.quantity-display {
    min-width: 2rem;
    text-align: center;
    font-size: 1rem;
    color: #28a745;
}

.quantity-decrease,
.quantity-increase {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #28a745;
    color: #28a745;
    background: white;
    transition: all 0.2s ease;
}

    .quantity-decrease:hover,
    .quantity-increase:hover {
        background: #28a745;
        color: white;
        transform: scale(1.1);
    }

/* Product Tags Styling */
.product-tags-section {
    min-height: 1.5rem; /* Reserve space even when no tags */
}

.product-tag-label {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.35rem;
    border-radius: 12px;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.3;
    letter-spacing: 0.02em;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

    /* Tag Category Colors - Subtle and Professional */
    .product-tag-label[data-tag*="organic"] {
        background: linear-gradient(135deg, #28a745, #20c997) !important;
        color: white;
    }

    .product-tag-label[data-tag*="premium"] {
        background: linear-gradient(135deg, #6f42c1, #8e44ad) !important;
        color: white;
    }

    .product-tag-label[data-tag*="bestseller"] {
        background: linear-gradient(135deg, #fd7e14, #f39c12) !important;
        color: white;
    }

    .product-tag-label[data-tag*="fresh"] {
        background: linear-gradient(135deg, #20c997, #17a2b8) !important;
        color: white;
    }

    .product-tag-label[data-tag*="local"] {
        background: linear-gradient(135deg, #17a2b8, #3498db) !important;
        color: white;
    }

    .product-tag-label[data-tag*="seasonal"] {
        background: linear-gradient(135deg, #e83e8c, #e74c3c) !important;
        color: white;
    }

    .product-tag-label[data-tag*="imported"] {
        background: linear-gradient(135deg, #6c757d, #95a5a6) !important;
        color: white;
    }

    .product-tag-label[data-tag*="new"] {
        background: linear-gradient(135deg, #007bff, #0056b3) !important;
        color: white;
    }

    .product-tag-label[data-tag*="sale"] {
        background: linear-gradient(135deg, #dc3545, #c82333) !important;
        color: white;
    }

    /* Default tag color for unmatched tags */
    .product-tag-label:not([data-tag*="organic"]):not([data-tag*="premium"]):not([data-tag*="bestseller"]):not([data-tag*="fresh"]):not([data-tag*="local"]):not([data-tag*="seasonal"]):not([data-tag*="imported"]):not([data-tag*="new"]):not([data-tag*="sale"]) {
        background: linear-gradient(135deg, #6c757d, #868e96) !important;
        color: white !important;
        border: none;
    }

/* Mobile Optimizations for Enhanced Card */
@media (max-width: 576px) {
    .current-price {
        font-size: 1.1rem !important;
    }

    .btn-add-to-cart {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }

    .rating-weight-section .stars {
        font-size: 0.75rem;
    }

    .product-weight {
        font-size: 0.75rem;
    }

    .discount-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    .product-tag-label {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
}

/* Performance optimizations */
.product-card {
    contain: layout style paint;
}

.lazy-image {
    contain: layout style paint;
}

/* Mobile optimizations for infinite scroll */
@media (max-width: 576px) {
    .load-more-trigger {
        min-height: 80px;
        padding: 1rem;
    }

    .loading-indicator {
        font-size: 0.8rem;
    }

    .image-loading-overlay .spinner-border {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .lazy-image,
    .image-loading-overlay,
    .product-card {
        transition: none;
    }

    .skeleton {
        animation: none;
        background: #f0f0f0;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .image-loading-overlay {
        background-color: rgba(0, 0, 0, 0.8);
        color: white;
    }

    .loading-indicator {
        color: #000;
    }
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

    .scroll-to-top.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .scroll-to-top:hover {
        background: var(--primary-green-dark, #2d7a2d);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    }

    .scroll-to-top:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .scroll-to-top.scrolling {
        pointer-events: none;
        opacity: 0.7;
    }

        .scroll-to-top.scrolling i {
            animation: scrollingPulse 1s ease-in-out infinite;
        }

@keyframes scrollingPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Screen reader only class for accessibility announcements */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Mobile optimizations for scroll to top */
@media (max-width: 576px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 1.1rem;
    }
}

/* Accessibility improvements for scroll to top */
@media (prefers-reduced-motion: reduce) {
    .scroll-to-top {
        transition: opacity 0.3s ease;
    }

        .scroll-to-top:hover {
            transform: none;
        }
}

/* High contrast mode for scroll to top */
@media (prefers-contrast: high) {
    .scroll-to-top {
        background: #000;
        border: 2px solid #fff;
    }

        .scroll-to-top:hover {
            background: #333;
        }
}

/* ===== ACCOUNT AREA STYLES ===== */

/* Order Tabs */
.orders-tabs-container {
    border-bottom: 1px solid #dee2e6;
}

    .orders-tabs-container .nav-tabs {
        border-bottom: none;
    }

    .orders-tabs-container .nav-link {
        border: none;
        border-bottom: 3px solid transparent;
        border-radius: 0;
        padding: 12px 20px;
        color: #6c757d;
        font-weight: 500;
        transition: all 0.2s ease;
    }

        .orders-tabs-container .nav-link:hover {
            border-color: #dee2e6;
            color: #495057;
        }

        .orders-tabs-container .nav-link.active {
            border-bottom-color: var(--primary-green);
            color: var(--primary-green);
            background: none;
        }

    .orders-tabs-container .badge {
        font-size: 0.7rem;
        padding: 0.25em 0.5em;
    }

/* Date Filter */
.date-filter-container {
    display: flex;
    justify-content: flex-end;
}

    .date-filter-container .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }

/* Order Cards */
.order-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

    .order-card:hover {
        border-color: #ced4da;
        box-shadow: var(--shadow-light);
    }

.order-header {
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

    .order-header h5 a {
        color: var(--primary-green);
        font-weight: 600;
    }

        .order-header h5 a:hover {
            color: #1e7e34;
        }

.order-meta {
    font-size: 0.875rem;
}

.order-total {
    text-align: right;
}

    .order-total .h5 {
        color: #28a745;
        font-weight: 700;
    }

/* Order Items Preview - Horizontal Circular List */
.order-items-preview {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.items-carousel-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

    .items-carousel-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

.items-carousel {
    min-width: max-content;
    gap: 0.75rem;
}

.item-thumbnail-container {
    flex-shrink: 0;
    text-align: center;
    max-width: 80px;
}

.item-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    margin: 0 auto 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .item-thumbnail:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        cursor: pointer;
    }

.item-thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.item-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 1.2rem;
}

.item-quantity-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--primary-green);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.item-thumbnail-info {
    font-size: 0.75rem;
    line-height: 1.2;
}

.item-name-truncated {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.item-variant-truncated {
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    margin-top: 2px;
}

.more-items-indicator {
    flex-shrink: 0;
    text-align: center;
    max-width: 80px;
}

.more-items-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 auto 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .more-items-circle:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

.more-items-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
}

.more-items-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

/* Order Actions */
.order-actions {
    border-top: 1px solid #f8f9fa;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

    .order-actions .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }

.cancellation-reason {
    border-left: 4px solid #dc3545;
}

/* Empty State */
.empty-state {
    padding: 3rem 1rem;
}

.empty-icon {
    opacity: 0.5;
}

/* Order Details Styles */
.order-header-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

    .order-header-section h1 {
        color: #333;
        margin-bottom: 0.5rem;
    }

/* Timeline Styles */
.timeline {
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0.25rem;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-green);
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 1.5rem;
    width: 2px;
    height: calc(100% - 0.5rem);
    background-color: #dee2e6;
}

.timeline-content {
    padding-bottom: 1rem;
}

/* Order Summary Styles */
.order-totals {
    font-size: 0.9rem;
}

    .order-totals .fw-bold {
        font-size: 1.1rem;
        color: var(--primary-green);
    }

.payment-info, .delivery-info {
    font-size: 0.9rem;
}

/* ========================================
   OPTIMIZED PRODUCT CARD STYLES
   ======================================== */

/* Main Card Container */
.product-card-optimized {
    border: 1px solid #d0d7de;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .product-card-optimized:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    }

/* Card Header with Peak Quality Badge */
.card-header-optimized {
    padding: 8px 16px;
    background: transparent;
    border: none;
    text-align: center;
    position: relative;
}

.peak-quality-badge {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-green);
    letter-spacing: 0.5px;
    text-align: center;
    display: block;
}

/* Product Image Container - 4:3 Aspect Ratio */
.product-image-container-optimized {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    margin: 0;
    border-radius: 0;
}

.product-image-optimized {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 0;
}

.product-card-optimized:hover .product-image-optimized {
    transform: scale(1.02);
}

/* Skeleton Loading Animation */
.image-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    margin: 8px 16px;
}

.skeleton-line-1 {
    width: 80%;
    margin-top: 20px;
}

.skeleton-line-2 {
    width: 60%;
}

.skeleton-line-3 {
    width: 90%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Card Body */
.card-body-optimized {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

/* Compact Rating Pill */
.rating-pill-optimized {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    width: fit-content;
    gap: 3px;
    height: 20px;
}

.rating-star {
    font-size: 12px;
}

.rating-value {
    font-weight: 600;
}

.rating-count {
    opacity: 0.9;
}

/* Delivery Type Icon */
.delivery-icon-indicator {
    display: flex;
    align-items: center;
}

.delivery-type-icon {
    width: 90px;
    height: auto;
    object-fit: contain;
    opacity: 0.8;
}

/* Product Title */
.product-title-optimized {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: #2d3748;
    margin: 0 0 2px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.4em;
}

/* Pack Size Section */
.pack-size-section-optimized {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border: 1px dotted #d0d7de;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
}

.pack-size-text {
    font-size: 13px;
    color: #718096;
    font-weight: 400;
}

.variant-options-chip {
    font-size: 11px;
    color: var(--primary-green);
    border: none;
    padding: 2px 6px;
    border-radius: 8px;
    background: transparent;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

/* Pricing and Cart Section - Same Line Layout */
.pricing-cart-section-optimized {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.price-details {
    flex: 1;
}

.price-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.current-price-optimized {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.original-price-optimized {
    font-size: 14px;
    color: #a0aec0;
    text-decoration: line-through;
    font-weight: 400;
}

.savings-pill {
    font-size: 11px;
    background: transparent;
    color: #b93d3f;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: bold;
    width: fit-content;
}

.cart-actions {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
}

/* Add to Cart Button - Traditional Style */
.add-to-cart-btn-optimized {
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 36px;
}

    .add-to-cart-btn-optimized:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    }

    .add-to-cart-btn-optimized:active {
        transform: translateY(0);
    }

/* Quantity Controls - Traditional Style */
.quantity-controls-optimized {
    margin-top: 8px;
}

    .quantity-controls-optimized .btn {
        min-width: 32px;
        height: 32px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .quantity-controls-optimized .quantity-display {
        min-width: 30px;
        text-align: center;
        font-size: 14px;
    }

/* ADD Button Capsule */
.add-btn-capsule {
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    min-height: 44px;
    min-width: 60px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .add-btn-capsule:hover {
        background: #1e7e34;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    }

    .add-btn-capsule:active {
        transform: translateY(0);
        transition: all 0.1s ease;
    }

/* Quantity Controls Capsule */
.quantity-controls-capsule {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--primary-green);
    border-radius: 20px;
    padding: 4px;
    min-height: 44px;
    gap: 2px;
}

.quantity-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--primary-green);
    font-size: 14px;
    font-weight: 600;
}

    .quantity-btn:hover {
        background: var(--primary-green);
        color: white;
        transform: scale(1.1);
    }

.quantity-display {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-green);
    min-width: 24px;
    text-align: center;
    padding: 0 4px;
}

/* Multi-variant Quantity Capsule */
.variant-quantity-capsule {
    background: white;
    border: 2px solid var(--primary-green);
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-green);
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

    .variant-quantity-capsule:hover {
        background: var(--primary-green);
        color: white;
        transform: translateY(-1px);
    }

/* Out of Stock Capsule */
.out-of-stock-capsule {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
}

/* Accessibility Improvements */
.add-btn-capsule:focus,
.quantity-btn:focus,
.variant-quantity-capsule:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Loading States */
.btn-loading {
    display: flex;
    align-items: center;
    gap: 4px;
}

.spinner-border-sm {
    width: 12px;
    height: 12px;
    border-width: 1px;
}

/* Responsive Design */
@media (max-width: 576px) {
    .product-card-optimized {
        border-radius: 12px;
    }

    .card-header-optimized {
        padding: 8px 12px 0;
    }

    .product-image-container-optimized {
        margin: 0 12px;
        border-radius: 8px;
    }

    .product-image-optimized {
        border-radius: 8px;
    }

    .card-body-optimized {
        padding: 12px;
    }

    .product-title-optimized {
        font-size: 14px;
    }

    .current-price-optimized {
        font-size: 16px;
    }

    .add-btn-capsule,
    .quantity-controls-capsule,
    .variant-quantity-capsule {
        min-height: 40px;
    }

    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .delivery-type-icon {
        width: 70px;
        height: auto;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .product-card-optimized {
        background: #1a1a1a;
        border-color: #333;
        color: #e0e0e0;
    }

    .product-title-optimized {
        color: #e0e0e0;
    }

    .pack-size-text {
        color: #a0a0a0;
    }

    .current-price-optimized {
        color: #e0e0e0;
    }

    .original-price-optimized {
        color: #666;
    }

    .image-skeleton,
    .skeleton-line {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .product-card-optimized {
        border-width: 2px;
        border-color: #000;
    }

    .peak-quality-badge {
        color: #000;
        font-weight: 700;
    }

    .rating-pill-optimized {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }

    .add-btn-capsule {
        background: #000;
        border: 2px solid #000;
    }

    .quantity-controls-capsule,
    .variant-quantity-capsule {
        border-color: #000;
        border-width: 2px;
    }
}

/* Print Styles */
@media print {
    .product-card-optimized {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }

    .add-to-cart-section-optimized {
        display: none;
    }
}

.payment-info .badge, .delivery-info .badge {
    font-size: 0.75rem;
}

/* Account Area Mobile Styles */
@media (max-width: 768px) {
    .orders-tabs-container .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .orders-tabs-container .nav-link {
        white-space: nowrap;
        padding: 10px 15px;
        font-size: 0.875rem;
    }

    .date-filter-container {
        justify-content: center;
        margin-bottom: 1rem;
    }

        .date-filter-container .btn-group {
            flex-wrap: wrap;
        }

        .date-filter-container .btn {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
        }

    .order-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .order-total {
        text-align: left;
        margin-top: 0.5rem;
    }

    .order-actions {
        flex-direction: column;
        gap: 0.5rem !important;
    }

        .order-actions .btn {
            width: 100%;
            justify-content: center;
        }

    /* Mobile styles for item thumbnails */
    .item-thumbnail-container {
        max-width: 70px;
    }

    .item-thumbnail {
        width: 50px;
        height: 50px;
    }

    .item-thumbnail-info {
        font-size: 0.7rem;
    }

    .item-name-truncated,
    .item-variant-truncated {
        max-width: 70px;
    }

    .more-items-circle {
        width: 50px;
        height: 50px;
    }

    .more-items-text {
        font-size: 0.7rem;
    }

    .more-items-label {
        font-size: 0.7rem;
    }

    .item-quantity-badge {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
        top: -3px;
        right: -3px;
    }

    .order-header-section {
        padding: 1rem;
    }

        .order-header-section .d-flex {
            flex-direction: column;
            align-items: flex-start !important;
        }

    .order-actions {
        margin-top: 1rem;
        width: 100%;
    }
}
