/* Sleek Navbar Styling */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #8B4513 0%, #654321 100%) !important;
    color: white !important;
    overflow: visible !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: white !important;
}

.navbar-dark .navbar-brand {
    color: white !important;
}

.navbar-brand {
    transition: all 0.3s ease;
    font-size: 1.5rem !important;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 20px;
    padding: 6px 12px !important;
    margin: 0 2px;
    font-size: 0.9rem !important;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Cart button styling */
#cart-icon {
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
}

#cart-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* User dropdown styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 15px;
    padding: 8px 0;
    background-color: white !important;
    min-width: 140px !important;
    max-width: 160px !important;
    z-index: 1050 !important;
}

/* Currency dropdown specific styling */
#currencyDropdown + .dropdown-menu {
    min-width: 200px !important;
    max-width: 250px !important;
    z-index: 1050 !important;
}

/* Ensure dropdowns appear above all other content */
.dropdown {
    position: relative;
}

.dropdown-menu.show {
    display: block !important;
    z-index: 1050 !important;
}

/* User dropdown button styling */
.dropdown .btn {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    color: #212529 !important;
    background-color: white !important;
    border-color: white !important;
}

.dropdown .btn:hover {
    color: #212529 !important;
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
}

.dropdown .btn:focus {
    color: #212529 !important;
    background-color: white !important;
    border-color: white !important;
}

.dropdown .btn .bi {
    color: #212529 !important;
}

.dropdown-item {
    padding: 8px 16px;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 2px 6px;
    color: #212529 !important;
    background-color: transparent !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
}

.dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.dropdown-item.text-danger {
    color: #dc3545 !important;
}

.dropdown-item.text-danger:hover {
    color: #dc3545 !important;
    background-color: #f8d7da !important;
}

/* Ensure dropdown menu text is visible */
.dropdown-menu * {
    color: #212529 !important;
}

.dropdown-menu .bi {
    color: #6c757d !important;
}

/* Force dropdown menu to be visible when open */
.dropdown-menu.show {
    background-color: white !important;
    color: #212529 !important;
}

.dropdown-menu.show * {
    color: #212529 !important;
}

/* Ensure dropdown items are always visible */
.dropdown-item {
    color: #212529 !important;
    background-color: transparent !important;
}

.dropdown-item:not(:hover) {
    color: #212529 !important;
    background-color: transparent !important;
}

/* Override any Bootstrap default styling */
.dropdown-menu {
    color: #212529 !important;
}

.dropdown-menu .dropdown-item {
    color: #212529 !important;
}

/* Login/Register buttons */
.btn-group .btn {
    transition: all 0.3s ease;
    color: white !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
}

.btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Ensure Login button text is visible */
.btn-group .btn.btn-outline-light {
    color: white !important;
    border-color: white !important;
    background-color: transparent !important;
}

.btn-group .btn.btn-outline-light:hover {
    color: #212529 !important;
    background-color: white !important;
    border-color: white !important;
}

/* Ensure Login button icon is visible */
.btn-group .btn.btn-outline-light .bi {
    color: white !important;
}

.btn-group .btn.btn-outline-light:hover .bi {
    color: #212529 !important;
}

/* Force button text visibility */
.btn-outline-light {
    color: white !important;
    border-color: white !important;
    background-color: transparent !important;
}

.btn-outline-light:hover {
    color: #212529 !important;
    background-color: white !important;
    border-color: white !important;
}

/* Ensure button text and icons are always visible */
.btn-outline-light,
.btn-outline-light * {
    color: white !important;
}

.btn-outline-light:hover,
.btn-outline-light:hover * {
    color: #212529 !important;
}

/* Additional specificity for navbar buttons */
.navbar .btn-outline-light {
    color: white !important;
    border-color: white !important;
    background-color: transparent !important;
}

.navbar .btn-outline-light:hover {
    color: #212529 !important;
    background-color: white !important;
    border-color: white !important;
}

.navbar .btn-outline-light .bi {
    color: white !important;
}

.navbar .btn-outline-light:hover .bi {
    color: #212529 !important;
}

/* Ensure Register button text is visible */
.btn-group .btn.btn-light {
    color: #212529 !important;
    background-color: white !important;
    border-color: white !important;
}

.btn-group .btn.btn-light:hover {
    color: #212529 !important;
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
}

/* Ensure Register button icon is visible */
.btn-group .btn.btn-light .bi {
    color: #212529 !important;
}

.btn-group .btn.btn-light:hover .bi {
    color: #212529 !important;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem !important;
    }
    
    .nav-link {
        padding: 12px 16px !important;
        margin: 2px 0;
    }
    
    .dropdown-menu {
        margin-top: 10px;
    }
    
    /* Ensure dropdowns work properly on mobile */
    .dropdown-menu.show {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
    }
}

/* Category filter buttons styling */
.btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: transparent !important;
    font-weight: 500 !important;
}

.btn-outline-primary:hover {
    color: white !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.btn-outline-primary.active {
    color: white !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

/* Ensure all buttons have visible text */
.btn {
    color: inherit !important;
}

/* Admin Panel Button Fixes - Override general button rules for admin pages */
body .btn-outline-primary,
body .btn-outline-danger,
body .btn-outline-info,
body .btn-outline-success,
body .btn-primary,
body .btn-danger,
body .btn-info,
body .btn-success {
    color: initial !important;
    border-color: initial !important;
    background-color: initial !important;
}

/* Specific fixes for admin button variants */
body .btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: transparent !important;
}

body .btn-outline-primary:hover {
    color: white !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

body .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

body .btn-outline-danger:hover {
    color: white !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

body .btn-outline-info {
    color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    background-color: transparent !important;
}

body .btn-outline-info:hover {
    color: #000 !important;
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
}

body .btn-outline-success {
    color: #198754 !important;
    border-color: #198754 !important;
    background-color: transparent !important;
}

body .btn-outline-success:hover {
    color: white !important;
    background-color: #198754 !important;
    border-color: #198754 !important;
}

/* Solid button variants */
body .btn-primary {
    color: white !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

body .btn-danger {
    color: white !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

body .btn-info {
    color: #000 !important;
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
}

body .btn-success {
    color: white !important;
    background-color: #198754 !important;
    border-color: #198754 !important;
}

/* Disabled button states */
body .btn:disabled,
body .btn.disabled {
    opacity: 0.65 !important;
    pointer-events: none !important;
}

/* Ensure button text and icons are always visible */
body .btn * {
    color: inherit !important;
}

/* Force category filter buttons to be visible */
.category-filter.btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: transparent !important;
}

.category-filter.btn-outline-primary:hover {
    color: white !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.category-filter.btn-outline-primary.active {
    color: white !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

/* Fallback navbar styling to ensure visibility */
.navbar {
    background-color: #8B4513 !important;
    color: white !important;
}

.navbar * {
    color: white !important;
}

.navbar-nav .nav-link {
    color: white !important;
}

.navbar-brand {
    color: white !important;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Product Card Styling - Clean & Relaxing Design */
.product-card {
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.product-card .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: none;
    background: transparent;
}

.product-card .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 0.75rem;
    background: white;
    text-align: center;
    align-items: center;
    justify-content: space-between;
    min-height: 140px;
}

.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    color: #654321;
    text-align: center;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.2px;
    word-wrap: break-word;
    hyphens: auto;
}

.product-card .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #228B22;
    margin-bottom: 1rem;
    text-align: center;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.product-card .view-product-btn {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #DAA520, #B8860B);
    border: none;
    color: white;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100%;
    margin-bottom: 0.5rem;
}

.product-card .view-product-btn:hover {
    background: linear-gradient(135deg, #B8860B, #8B6914);
    transform: translateY(-1px);
    color: white;
}

.product-card .add-to-cart-btn {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: white !important;
    border: 2px solid #228B22 !important;
    color: #228B22 !important;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100%;
}

.product-card .add-to-cart-btn:hover {
    background: #228B22 !important;
    color: white !important;
    transform: translateY(-1px);
}

.product-card .add-to-cart-btn.btn-secondary {
    background: #A0522D;
    border-color: #A0522D;
    color: white;
}

.product-card .add-to-cart-btn.btn-secondary:hover {
    background: #8B4513;
    border-color: #8B4513;
    color: white;
}

/* Card image styling */
.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    border-bottom: none;
    transition: transform 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Responsive adjustments for the new grid layout */
@media (max-width: 1200px) {
    .product-card .card-title {
        font-size: 0.9rem;
        min-height: 2.2rem;
    }
    
    .product-card .price {
        font-size: 1.1rem;
    }
    
    .product-card .view-product-btn,
    .product-card .add-to-cart-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
    
    .product-card .card-body {
        min-height: 180px;
    }
}

@media (max-width: 768px) {
    .product-card .card-body {
        padding: 1rem;
        min-height: 160px;
    }
    
    .product-card .card-title {
        font-size: 0.85rem;
        min-height: 2rem;
    }
    
    .product-card .price {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .product-card .view-product-btn,
    .product-card .add-to-cart-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 576px) {
    .product-card .card-body {
        padding: 0.75rem;
        min-height: 140px;
    }
    
    .product-card .card-title {
        font-size: 0.85rem;
        min-height: 1.8rem;
    }
    
    .product-card .price {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .product-card .view-product-btn,
    .product-card .add-to-cart-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }
}

/* Category Filter Styling - Clean & Relaxing */
#category-filter-container,
#category-filter-container-mobile {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
}

#category-filter-container h6 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.category-filter {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    margin: 0.1rem 0;
    font-weight: 500;
    border: 1px solid #ecf0f1;
    background: white;
    color: #7f8c8d;
    width: 100%;
    text-align: left;
    display: block;
}

.category-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: #bdc3c7;
    color: #2c3e50;
}

.category-filter.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-color: #3498db;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.category-filter.active:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Overall Page Styling - Clean & Relaxing */
body {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    color: #2c3e50;
    margin-top: 0;
    padding-top: 0;
}

/* Reduce navbar spacing */
.navbar {
    padding: 0.5rem 0;
    margin-bottom: 0;
}

.navbar-brand {
    padding: 0.25rem 0;
}

.container {
    max-width: 1400px;
}

/* Sidebar Filters Styling */
.sidebar-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #ecf0f1;
    position: sticky;
    top: 20px;
}

.filter-section {
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 1rem;
}

.filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.filter-title {
    color: #654321;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-title i {
    color: #8B4513;
    font-size: 1rem;
}

/* Search and Sort Section Styling (Legacy - for mobile) */
.row.mb-3 {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #ecf0f1;
    margin-bottom: 1.5rem !important;
}

#search-bar {
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

#search-bar:focus {
    border-color: #8B4513;
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
    background: white;
}

#sort-by {
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

#sort-by:focus {
    border-color: #8B4513;
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
    background: white;
}

/* Products Container Styling */
#products-container {
    background: transparent;
    padding: 0;
    margin-top: 0;
}

/* Reduce spacing between product cards */
#products-container .row {
    margin-top: 0;
}

/* Loading Spinner Styling */
#loading-spinner {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #ecf0f1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-card .card-title {
        font-size: 0.9rem;
        min-height: 2.2rem;
    }
    
    .product-card .view-product-btn,
    .product-card .add-to-cart-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .category-filter {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .row.mb-4 {
        padding: 1rem;
    }
    
    #category-filter-container {
        padding: 1rem;
    }
    
    /* Sidebar adjustments for mobile */
    .sidebar-filters {
        position: static;
        margin-bottom: 1rem;
    }
    
    .filter-section {
        padding-bottom: 0.75rem;
    }
    
    .filter-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .product-card .card-body {
        padding: 0.75rem;
        min-height: 140px;
    }
    
    .product-card .card-title {
        font-size: 0.85rem;
        min-height: 1.8rem;
    }
    
    .product-card .price {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .product-card .view-product-btn,
    .product-card .add-to-cart-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }
    
    .category-filter {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .row.mb-4 {
        padding: 0.75rem;
    }
    
    #category-filter-container {
        padding: 0.75rem;
    }
}

#back-to-top {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed/sticky position */
    bottom: 30px; /* Place the button at the bottom of the page */
    right: 30px; /* Place the button 30px from the right */
    z-index: 1000; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background: linear-gradient(135deg, #8B4513 0%, #654321 100%); /* Match navbar gradient */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px 18px; /* Some padding */
    border-radius: 50px; /* Perfect circle */
    font-size: 18px; /* Increase font size */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); /* Add shadow */
    transition: all 0.3s ease; /* Smooth transitions */
    width: 55px; /* Fixed width */
    height: 55px; /* Fixed height */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    opacity: 0.9; /* Slightly transparent */
}

#back-to-top:hover {
    background: linear-gradient(135deg, #654321 0%, #8B4513 100%); /* Reverse gradient on hover */
    transform: translateY(-3px); /* Lift up on hover */
    box-shadow: 0 8px 25px rgba(0,0,0,0.3); /* Enhanced shadow on hover */
    opacity: 1; /* Full opacity on hover */
}

#back-to-top:active {
    transform: translateY(-1px); /* Slight press effect */
    box-shadow: 0 4px 15px rgba(0,0,0,0.4); /* Pressed shadow */
}

#back-to-top .bi {
    color: white; /* Ensure icon is white */
    font-size: 20px; /* Icon size */
    transition: all 0.3s ease; /* Smooth icon transitions */
}

#back-to-top:hover .bi {
    transform: translateY(-2px); /* Icon lifts up on hover */
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        padding: 12px 15px;
        font-size: 16px;
    }
    
    #back-to-top .bi {
        font-size: 18px;
    }
}

#product-modal-carousel-inner img {
    max-width: 100%;
    max-height: 400px; /* Adjust as needed */
    object-fit: contain; /* Ensures the image is scaled nicely within the bounds */
    margin: auto; /* Center the image if it's smaller than the max dimensions */
    display: block; /* Remove extra space below image */
}

/* Compact Modal Styling */
#quickViewModal .modal-body {
    padding: 1rem;
}

#quickViewModal .modal-body .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

#quickViewModal .modal-body .row > [class*='col-'] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

#quickViewModal .modal-body .img-fluid {
    max-height: 300px;
    object-fit: contain;
}

#quickViewModal .modal-body .mb-3 {
    margin-bottom: 0.75rem !important;
}

#quickViewModal .modal-body p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

#quickViewModal .modal-body h6 {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

#quickViewModal .modal-body h5 {
    font-size: 1.1rem;
}

#quickViewModal .modal-header {
    padding: 0.75rem 1rem;
}

#quickViewModal .modal-footer {
    padding: 0.75rem 1rem;
}

/* Recently Viewed Products Styling */
#recently-viewed-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #ecf0f1;
    margin-top: 2rem;
}

#recently-viewed-section h2 {
    color: #654321;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

#recently-viewed-products .product-card {
    margin-bottom: 1rem;
}

/* Ensure sticky sidebar works */
.sidebar-filters {
    position: sticky !important;
    top: 20px !important;
    z-index: 100 !important;
}

@media (max-width: 768px) {
    .sidebar-filters {
        position: static !important;
        margin-bottom: 1rem !important;
    }
}

/* Currency Dropdown Styling */
.dropdown-menu {
    max-width: 280px;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.dropdown-menu .dropdown-header {
    font-weight: 600;
    color: #495057;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-menu .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #495057;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.dropdown-menu .dropdown-item.active {
    background-color: #e9ecef;
    color: #212529;
}

.dropdown-menu .dropdown-item i {
    width: 16px;
    text-align: center;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.dropdown-menu .dropdown-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ensure dropdown doesn't overflow viewport */
.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* Navbar dropdown positioning */
.navbar .dropdown-menu {
    position: absolute;
    z-index: 1000;
}

@media (max-width: 576px) {
    .dropdown-menu {
        max-width: 240px;
        min-width: 200px;
        font-size: 0.8rem;
    }
    
    .dropdown-menu .dropdown-item {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        min-height: 2.2rem;
    }
    
    .dropdown-menu .dropdown-header {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Modal Backdrop Fix */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* Force cleanup for modal backdrops */
body:not(.modal-open) .modal-backdrop {
    display: none !important;
}

body:not(.modal-open) {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* Additional modal cleanup helpers */
.modal-cleanup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1039;
    pointer-events: none;
}

/* Ensure modals are properly hidden */
.modal:not(.show) {
    display: none !important;
}

/* Fix for multiple backdrops */
.modal-backdrop + .modal-backdrop {
    display: none !important;
}

/* Peeping Logo Styling */
.peeping-logo-container {
    position: absolute;
    left: 20px;
    top: -15px;
    z-index: 1040;
    transition: all 0.3s ease;
}

.peeping-logo-container:hover {
    transform: scale(1.05);
}

.peeping-logo-link {
    display: block;
    text-decoration: none;
}

.peeping-logo-img {
    width: 80px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    background: white;
    padding: 6px;
    border: 2px solid #8B4513;
}

.peeping-logo-img:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    border-color: #DAA520;
}

.logo-spacer {
    width: 70px;
    height: 1px;
}

/* Responsive Peeping Logo */
@media (max-width: 768px) {
    .peeping-logo-container {
        left: 15px;
        top: -10px;
    }
    
    .peeping-logo-img {
        width: 60px;
        padding: 4px;
        border-width: 2px;
    }
    
    .logo-spacer {
        width: 50px;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .peeping-logo-container {
        left: 18px;
        top: -12px;
    }
    
    .peeping-logo-img {
        width: 70px;
        padding: 5px;
    }
    
    .logo-spacer {
        width: 60px;
    }
}

@media (min-width: 993px) {
    .peeping-logo-container {
        left: 25px;
        top: -15px;
    }
    
    .peeping-logo-img {
        width: 90px;
        padding: 8px;
        border-width: 3px;
    }
    
    .logo-spacer {
        width: 80px;
    }
}

/* Navbar Brand Text Styling */
.navbar-brand-text {
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.navbar-brand-text:hover {
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: scale(1.02);
}

/* Sidebar Logo Styling */
.sidebar-logo {
    padding: 30px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8B4513 0%, #DAA520 100%);
}

.sidebar-logo:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border-color: #8B4513;
}

.sidebar-logo-img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.sidebar-logo-img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.sidebar-logo-text {
    font-family: 'Georgia', serif;
    font-weight: bold;
    color: #8B4513;
    margin: 15px 0 0 0;
    font-size: 1.2rem;
    line-height: 1.3;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Responsive Sidebar Logo */
@media (max-width: 768px) {
    .sidebar-logo {
        padding: 25px 15px;
    }
    
    .sidebar-logo-img {
        max-width: 180px;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .sidebar-logo-img {
        max-width: 200px;
    }
}

@media (min-width: 993px) {
    .sidebar-logo-img {
        max-width: 250px;
    }
}

/* Logo Styling */
.navbar-brand {
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.logo-img {
    transition: all 0.3s ease;
    filter: brightness(1);
}

.logo-img:hover {
    filter: brightness(1.1);
}

/* Responsive Logo Sizing */
@media (max-width: 576px) {
    .logo-img {
        height: 40px !important;
        max-width: 150px !important;
    }
    
    .logo-text {
        font-size: 1rem !important;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .logo-img {
        height: 45px !important;
        max-width: 180px !important;
    }
    
    .logo-text {
        font-size: 1.1rem !important;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .logo-img {
        height: 50px !important;
        max-width: 200px !important;
    }
}

@media (min-width: 993px) {
    .logo-img {
        height: 55px !important;
        max-width: 220px !important;
    }
}

/* Navbar adjustments for peeping logo */
.navbar .container {
    padding-left: 160px;
}

@media (max-width: 768px) {
    .navbar .container {
        padding-left: 120px;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .navbar .container {
        padding-left: 140px;
    }
}

@media (min-width: 993px) {
    .navbar .container {
        padding-left: 180px;
    }
}

/* General page adjustments for peeping logo */
body:not(.checkout-page) .container:first-of-type {
    padding-top: 20px;
}

/* Ensure main content doesn't overlap with peeping logo */
main.container {
    margin-top: 20px;
}

/* Checkout page specific adjustments for peeping logo */
.checkout-page .col-md-6:first-child {
    margin-top: 80px;
    padding-top: 20px;
}

.checkout-page #order-summary {
    margin-top: 20px;
}

/* Responsive checkout adjustments */
@media (max-width: 768px) {
    .checkout-page .col-md-6:first-child {
        margin-top: 60px;
        padding-top: 15px;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .checkout-page .col-md-6:first-child {
        margin-top: 70px;
        padding-top: 18px;
    }
}

@media (min-width: 993px) {
    .checkout-page .col-md-6:first-child {
        margin-top: 90px;
        padding-top: 25px;
    }
}

/* Earthy Color Palette */
:root {
    --primary-brown: #8B4513;
    --secondary-gold: #DAA520;
    --accent-green: #228B22;
    --light-brown: #DEB887;
    --dark-brown: #654321;
    --cream: #F5F5DC;
    --warm-white: #FAF0E6;
}

/* Navbar with earthy gradient */
.navbar {
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--dark-brown) 100%) !important;
    box-shadow: 0 2px 10px rgba(139, 69, 19, 0.2) !important;
}

/* Recently Viewed Products Styling - Higher Specificity */
#recently-viewed-section .product-card .card-title,
#recently-viewed-section .col .product-card .card-title,
#recently-viewed-section .row .product-card .card-title {
    margin-bottom: 0.5rem !important; /* Reduce spacing between name and price */
    color: #654321 !important;
}

#recently-viewed-section .product-card .price,
#recently-viewed-section .col .product-card .price,
#recently-viewed-section .row .product-card .price,
#recently-viewed-section .product-card .card-body .price {
    color: #228B22 !important; /* Change price color to green */
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

#recently-viewed-section .product-card .card-body,
#recently-viewed-section .col .product-card .card-body,
#recently-viewed-section .row .product-card .card-body {
    padding: 0.5rem !important;
    min-height: 90px !important;
}

/* Ensure recently viewed products use the same button styling */
#recently-viewed-section .product-card .add-to-cart-btn,
#recently-viewed-section .col .product-card .add-to-cart-btn,
#recently-viewed-section .row .product-card .add-to-cart-btn {
    background: white !important;
    border: 2px solid #228B22 !important;
    color: #228B22 !important;
}

#recently-viewed-section .product-card .add-to-cart-btn:hover,
#recently-viewed-section .col .product-card .add-to-cart-btn:hover,
#recently-viewed-section .row .product-card .add-to-cart-btn:hover {
    background: #228B22 !important;
    color: white !important;
}

#recently-viewed-section .product-card .view-product-btn,
#recently-viewed-section .col .product-card .view-product-btn,
#recently-viewed-section .row .product-card .view-product-btn {
    background: linear-gradient(135deg, #DAA520, #B8860B) !important;
    border: none !important;
    color: white !important;
}

#recently-viewed-section .product-card .view-product-btn:hover,
#recently-viewed-section .col .product-card .view-product-btn:hover,
#recently-viewed-section .row .product-card .view-product-btn:hover {
    background: linear-gradient(135deg, #B8860B, #8B6914) !important;
    color: white !important;
}

/* Additional Recently Viewed Products Styling - Bootstrap Override */
#recently-viewed-section .card-title,
#recently-viewed-section .card .card-title,
#recently-viewed-section .col .card .card-title {
    margin-bottom: 0.5rem !important;
    color: #654321 !important;
}

#recently-viewed-section .price,
#recently-viewed-section .card .price,
#recently-viewed-section .col .card .price,
#recently-viewed-section .card-body .price {
    color: #228B22 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
}

/* Force green color for any price element in recently viewed */
#recently-viewed-section [data-price-kes] {
    color: #228B22 !important;
}

/* Comprehensive Recently Viewed Products Styling - Maximum Specificity */
#recently-viewed-section .col .card .card-title,
#recently-viewed-section .col-lg-3 .card .card-title,
#recently-viewed-section .col-md-4 .card .card-title,
#recently-viewed-section .col-sm-6 .card .card-title {
    margin-bottom: 0.5rem !important;
    color: #654321 !important;
}

#recently-viewed-section .col .card .price,
#recently-viewed-section .col-lg-3 .card .price,
#recently-viewed-section .col-md-4 .card .price,
#recently-viewed-section .col-sm-6 .card .price {
    color: #228B22 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
}

/* Force green color for any price element in recently viewed */
#recently-viewed-section [data-price-kes] {
    color: #228B22 !important;
}

/* Ultra-specific Recently Viewed Products Spacing Fix */
#recently-viewed-section .col .card .card-body .card-title,
#recently-viewed-section .col-lg-3 .card .card-body .card-title,
#recently-viewed-section .col-md-4 .card .card-body .card-title,
#recently-viewed-section .col-sm-6 .card .card-body .card-title,
#recently-viewed-section .product-card .card-body .card-title,
#recently-viewed-section .card .card-body .card-title,
#recently-viewed-section .card-body .card-title {
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    color: #654321 !important;
}

/* Target the price element specifically */
#recently-viewed-section .col .card .card-body .price,
#recently-viewed-section .col-lg-3 .card .card-body .price,
#recently-viewed-section .col-md-4 .card .card-body .price,
#recently-viewed-section .col-sm-6 .card .card-body .price,
#recently-viewed-section .product-card .card-body .price,
#recently-viewed-section .card .card-body .price,
#recently-viewed-section .card-body .price {
    margin-top: 0 !important;
    padding-top: 0 !important;
    color: #228B22 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
}

/* Target the text-center div that might be adding spacing */
#recently-viewed-section .col .card .card-body .text-center,
#recently-viewed-section .col-lg-3 .card .card-body .text-center,
#recently-viewed-section .col-md-4 .card .card-body .text-center,
#recently-viewed-section .col-sm-6 .card .card-body .text-center,
#recently-viewed-section .product-card .card-body .text-center,
#recently-viewed-section .card .card-body .text-center {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0.5rem !important;
}

/* Target Bootstrap margin classes in recently viewed */
#recently-viewed-section .mb-2,
#recently-viewed-section .mb-3,
#recently-viewed-section .card .mb-2,
#recently-viewed-section .card .mb-3,
#recently-viewed-section .card-body .mb-2,
#recently-viewed-section .card-body .mb-3 {
    margin-bottom: 0.25rem !important;
}

#recently-viewed-section .mt-auto {
    margin-top: 0 !important;
}

/* Target the specific div structure from JavaScript */
#recently-viewed-section .card-body .d-flex,
#recently-viewed-section .card-body .flex-column {
    gap: 0.25rem !important;
}

#recently-viewed-section .card-body .d-flex .card-title {
    margin-bottom: 0.25rem !important;
}

#recently-viewed-section .card-body .d-flex .text-center {
    margin-bottom: 0.25rem !important;
}

/* Aggressive Recently Viewed Products Spacing Fix */
#recently-viewed-section * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

#recently-viewed-section .card-title,
#recently-viewed-section h6,
#recently-viewed-section .card h6,
#recently-viewed-section .card-body h6 {
    margin-bottom: 0.25rem !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
    line-height: 1.2 !important;
}

#recently-viewed-section .price,
#recently-viewed-section .card .price,
#recently-viewed-section .card-body .price,
#recently-viewed-section strong.price,
#recently-viewed-section .text-center .price {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    color: #228B22 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

#recently-viewed-section .text-center {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

#recently-viewed-section .card-body {
    padding: 0.75rem !important;
    min-height: auto !important;
}

/* Brand Filter Styling */
.brand-filter-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.brand-filter-item:hover {
    background-color: #f8f9fa;
}

.brand-checkbox {
    margin-right: 0.5rem;
}

.brand-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #654321;
    margin-bottom: 0;
}

.brand-logo {
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Brand Badge on Product Cards */
.brand-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.brand-logo-small {
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Brand Filter Active State */
.brand-checkbox:checked + .brand-label {
    color: #8B4513;
    font-weight: 600;
}

.brand-checkbox:checked + .brand-label .brand-logo {
    box-shadow: 0 2px 6px rgba(139, 69, 19, 0.3);
}

/* Comprehensive Recently Viewed Products Styling - Maximum Specificity */

/* Admin Navbar Fix */
.navbar .container {
    max-width: 100%;
    overflow-x: hidden;
}

.navbar-nav {
    flex-wrap: wrap;
}

.navbar-nav .nav-item {
    white-space: nowrap;
}

/* Responsive admin navbar */
@media (max-width: 1200px) {
    .navbar-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.3rem;
    }
}

@media (max-width: 992px) {
    .navbar-nav {
        max-width: 100%;
    }
    
         .navbar-nav .nav-item {
         width: 100%;
     }
 }