/*
 * Elysian - A Modern & Elegant Theme
 */

/* --- CSS Variables --- */
:root {
    /* These are the default fallbacks. They are overridden by dynamic_style.php */
    --primary-color: #8D7B68;
    --secondary-color: #3C2A21;
    --text-color: #3C2A21;
    --background-color: #F5F5F5;
    --accent-color: #A4907C;

    /* Static variables */
    --surface-color: #FFFFFF;
    --border-color: #E0E0E0;
    --text-color-light: #6c757d;
    --success-color: #4B5320;
    --success-bg-color: #EBF0E4;
    --error-color: #7D4F50;
    --error-bg-color: #FBEAE5;
    --font-family-sans: 'Inter', sans-serif;
    --font-family-serif: 'Lora', serif;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
}

/* --- Global Resets & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.main-content {
    flex: 1;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-serif);
    color: var(--secondary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* --- Header & Navigation --- */
.header {
    background-color: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

/* Top Bar */
.top-bar {
    background-color: #f8f9fa;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.top-bar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.top-bar .auth-links a {
    color: var(--text-color-light);
    text-decoration: none;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.top-bar .auth-links a:hover {
    color: var(--primary-color);
}

.top-bar .auth-links .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

/* Main Header */
.main-header-content {
    padding: 1rem 0;
    transition: all 0.3s ease;
    background-color: var(--surface-color);
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

/* Header Search */
.header-search {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.header-search form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
}

.header-search input[type="search"] {
    border: none;
    padding: 0.6rem 1rem;
    width: 100%;
    font-size: 0.9rem;
    background-color: #f8f9fa;
}

.header-search input[type="search"]:focus {
    outline: none;
    background-color: #fff;
}

.header-search button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.header-search button:hover {
    background-color: var(--accent-color);
}

/* Live Search Results Dropdown */
.search-results-live {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-md);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: var(--text-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.search-result-details {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-color-light);
    font-style: italic;
}

.search-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-color-light);
    font-style: italic;
}

.search-result-item.active {
    background-color: #e9ecef;
}

.search-result-no-image {
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-light);
    font-size: 1.2rem;
}

.search-view-all {
    background-color: #f8f9fa;
    font-weight: 500;
    border-top: 1px solid var(--border-color);
    justify-content: space-between;
}

.search-view-all:hover {
    background-color: #e9ecef;
}

.search-view-all .search-result-name {
    color: var(--primary-color);
}

/* Nav Icons */
.main-nav .nav-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-icon-wrapper {
    position: relative;
}

.cart-icon {
    font-size: 1.3rem;
    color: var(--text-color);
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    order: 3; /* Ensure it appears after other nav elements */
}

.mobile-nav-toggle .hamburger {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    position: relative;
    transition: transform 0.3s ease;
    margin: 0 auto; /* Center the hamburger */
}

.mobile-nav-toggle .hamburger::before,
.mobile-nav-toggle .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.mobile-nav-toggle .hamburger::before {
    top: -8px;
}

.mobile-nav-toggle .hamburger::after {
    bottom: -8px;
}

.mobile-nav-toggle.active .hamburger {
    background-color: transparent;
}

.mobile-nav-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-nav-toggle.active .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Responsive Header */
@media (max-width: 992px) {
    .top-bar {
        display: none;
    }

    .mobile-nav-toggle {
        display: block !important;
        position: relative;
        z-index: 1002;
    }

    .header-search {
        display: none;
    }

    /* Ensure main nav is flex and hamburger is visible */
    .main-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

    .main-nav .nav-links,
    .main-nav .nav-icons {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: var(--surface-color);
        flex-direction: column;
        align-items: flex-start;
        padding: 6rem 2rem 2rem;
        gap: 1.5rem;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.4s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .main-nav .nav-links {
        padding-top: 2rem;
        align-items: center;
        width: 100%;
    }

    .main-nav .nav-links li {
        width: 100%;
        text-align: center;
    }

    .main-nav .nav-links a {
        display: block;
        padding: 1rem;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .main-nav .nav-icons {
        height: auto;
        box-shadow: none;
        position: static;
        background: none;
        padding: 0;
        flex-direction: column;
        width: 100%;
        justify-content: center;
        border-top: 1px solid var(--border-color);
        padding-top: 1.5rem;
        margin-top: 1.5rem;
        gap: 1rem;
    }

    .nav-links.active,
    .nav-icons.active {
        right: 0;
    }

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

    /* Mobile menu overlay */
    .nav-links.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    /* Mobile auth links styling */
    .main-nav .nav-icons .auth-links {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        align-items: center;
    }

    .main-nav .nav-icons .auth-links .btn {
        width: 200px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 8px;
        text-align: center;
        transition: all 0.3s ease;
        text-decoration: none;
        display: inline-block;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        min-height: 44px; /* iOS recommended touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav .nav-icons .auth-links .btn-secondary {
        background: var(--secondary-color);
        color: var(--surface-color);
        border: 2px solid var(--secondary-color);
    }

    .main-nav .nav-icons .auth-links .btn-secondary:hover {
        background: transparent;
        color: var(--secondary-color);
        border: 2px solid var(--secondary-color);
    }

    .main-nav .nav-icons .auth-links .btn:not(.btn-secondary) {
        background: var(--primary-color);
        color: var(--surface-color);
        border: 2px solid var(--primary-color);
    }

    .main-nav .nav-icons .auth-links .btn:not(.btn-secondary):hover {
        background: transparent;
        color: var(--primary-color);
        border: 2px solid var(--primary-color);
    }

    /* Touch feedback for mobile */
    .main-nav .nav-icons .auth-links .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .main-nav .nav-icons .dropdown-toggle:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    /* Cart icon in mobile */
    .main-nav .nav-icons .cart-icon-wrapper {
        margin-bottom: 1rem;
    }

    .main-nav .nav-icons .cart-icon {
        font-size: 1.5rem;
        padding: 0.75rem;
        background: var(--background-color);
        border-radius: 50%;
        color: var(--text-color);
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        text-decoration: none;
    }

    .main-nav .nav-icons .cart-icon:hover {
        background: var(--primary-color);
        color: var(--surface-color);
    }

    /* User dropdown in mobile */
    .main-nav .nav-icons .dropdown {
        width: 100%;
    }

    .main-nav .nav-icons .dropdown-toggle {
        width: 200px;
        padding: 0.75rem 1.5rem;
        background: var(--accent-color);
        color: var(--surface-color);
        border: 2px solid var(--accent-color);
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        text-align: center;
        display: inline-block;
        transition: all 0.3s ease;
    }

    .main-nav .nav-icons .dropdown-toggle:hover {
        background: transparent;
        color: var(--accent-color);
        border: 2px solid var(--accent-color);
    }

    .main-nav .nav-icons .dropdown-menu {
        position: static;
        width: 100%;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: none;
        margin-top: 1rem;
        padding: 0.5rem 0;
        max-height: none;
        overflow: visible;
    }

    .main-nav .nav-icons .dropdown-menu.show {
        display: block;
    }

    .main-nav .nav-icons .dropdown-item {
        padding: 0.75rem 1.5rem;
        color: var(--text-color);
        text-decoration: none;
        display: block;
        transition: background-color 0.3s ease;
        border-bottom: 1px solid var(--border-color);
    }

    .main-nav .nav-icons .dropdown-item:last-child {
        border-bottom: none;
    }

    .main-nav .nav-icons .dropdown-item:hover {
        background-color: var(--background-color);
    }

    .main-nav .nav-icons .dropdown-item.logout-item {
        color: #dc3545;
        border-top: 1px solid var(--border-color);
        margin-top: 0.5rem;
        padding-top: 1rem;
    }

    .main-nav .nav-icons .dropdown-item.logout-item:hover {
        background-color: #f8d7da;
    }
}

/* Additional mobile styles for smaller screens */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block !important;
        position: relative;
        z-index: 1003;
        background: transparent;
        border: none;
        padding: 15px 10px;
        cursor: pointer;
    }

    .main-nav .nav-links,
    .main-nav .nav-icons {
        width: 280px;
    }

    .header-search {
        display: none !important;
    }

    /* Ensure hamburger is visible */
    .mobile-nav-toggle .hamburger,
    .mobile-nav-toggle .hamburger::before,
    .mobile-nav-toggle .hamburger::after {
        background-color: var(--text-color) !important;
    }
}

    /* Smaller buttons on smaller screens */
    .main-nav .nav-icons .auth-links .btn,
    .main-nav .nav-icons .dropdown-toggle {
        width: 180px;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-nav .nav-links,
    .main-nav .nav-icons {
        width: 260px;
    }

    .main-nav .nav-icons .auth-links .btn,
    .main-nav .nav-icons .dropdown-toggle {
        width: 160px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .main-nav .nav-icons .cart-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    /* Extra mobile nav visibility */
    .mobile-nav-toggle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 9999 !important;
    }
}



@media (max-width: 768px) {
    .main-nav .logo {
        flex-grow: 1;
    }

    .header-search {
        margin: 1rem 0 0;
        max-width: none;
    }

    /* Mobile Search Results */
    .search-results-live {
        left: -1rem;
        right: -1rem;
        max-height: 300px;
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }

    .search-result-item {
        padding: 0.5rem;
    }

    .search-result-image {
        width: 40px;
        height: 40px;
        margin-right: 0.5rem;
    }

    .search-result-name {
        font-size: 0.85rem;
    }

    .search-result-price {
        font-size: 0.8rem;
    }
}

/* Checkout Page Styles */
.checkout-page .checkout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .checkout-page .checkout-grid {
        grid-template-columns: 1fr 400px;
        gap: 3rem;
    }
}

.checkout-main-content .checkout-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.checkout-section {
    margin-bottom: 2.5rem;
}

.checkout-section .section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-group.col-md-6 {
    width: 50%;
    padding: 0 10px;
}

.logged-in-as {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #555;
}

/* Payment Options */
.payment-options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-option {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.payment-option:has(input:checked) {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

.payment-option-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.payment-option-label .payment-option-title {
    font-weight: 600;
}

.payment-option-label .payment-option-desc {
    font-size: 0.9rem;
    color: #666;
}

.mpesa-instructions {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* Order Summary Sidebar */
.checkout-sidebar .order-summary-card {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    position: sticky;
    top: 2rem;
}

.order-summary-items .summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-item-image {
    position: relative;
}

.summary-item-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.summary-item-quantity {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.summary-item-info {
    flex-grow: 1;
}

.summary-item-name {
    font-weight: 500;
}

.summary-item-price {
    font-weight: 600;
}

.order-summary-total {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.total-row.grand-total {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
}

.cart-icon {
    position: relative;
    display: inline-block;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--primary-color);
    color: var(--surface-color);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Cart Icon Wrapper */
.cart-icon-wrapper {
    position: relative;
}

.cart-popover {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    padding: 1.5rem;
    margin-top: 10px;
}



.popover-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.popover-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}



.popover-item-info {
    flex-grow: 1;
}

.popover-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.popover-item-price {
    font-size: 0.9rem;
    color: var(--text-color-light);
}

.popover-total {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: right;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--secondary-color);
}

.popover-empty {
    text-align: center;
    padding: 1rem 0;
}

/* --- Header & Navigation --- */
.product-page-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "gallery details"
        "gallery purchase";
    gap: 2rem 3rem;
    align-items: start;
}

.product-gallery-container {
    grid-area: gallery;
    display: grid;
    grid-template-columns: 80px 1fr; /* Thumbnails and main image */
    gap: 1rem;
}

.thumbnail-container-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.thumbnail-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.thumbnail-item.active {
    border-color: var(--primary-color);
}

.thumbnail-item img {
    display: block;
    width: 100%;
    height: auto;
}

.main-image-container {
    grid-column: 2 / 3;
    position: relative; /* For zoom */
    overflow: hidden;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.main-image-container img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease; /* For zoom effect */
}

.product-details-main {
    grid-area: details;
}

.product-purchase-box {
    grid-area: purchase;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.product-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.product-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: #ffc107; /* Gold color for stars */
}

.product-rating .rating-value {
    margin-left: 0.5rem;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-color-light);
}

.product-rating .no-rating {
    font-size: 0.9em;
    color: var(--text-color-light);
}

.reviews-link {
    font-size: 0.9em;
    color: var(--text-color-light);
}

.divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem 0;
}

.product-description-short {
    font-size: 1.05rem;
    line-height: 1.7;
}

.product-price-main {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stock-status {
    margin-bottom: 1.5rem;
}

.stock-status .in-stock {
    color: var(--success-color);
    font-weight: 600;
}

.stock-status .out-of-stock {
    color: var(--error-color);
    font-weight: 600;
}

.stock-status .stock-quantity {
    font-size: 0.9em;
    color: var(--text-color-light);
}

.product-purchase-box .add-to-cart-form.modern {
    display: flex;
    gap: 1rem;
}

.product-purchase-box .quantity-selector {
    flex-grow: 0;
}

.product-purchase-box .btn-add-to-cart {
    flex-grow: 1;
}

/* --- Main Content --- */
.main-content {
    padding: 4rem 0;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: var(--surface-color);
    border: none;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    filter: brightness(1.05);
    color: var(--surface-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--surface-color);
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    filter: brightness(1.1);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    font-weight: 500;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2);
}

/* --- Enhanced Product Grid --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    padding: 2rem 0;
}

/* Enhanced Product Card UX */
.enhanced-product-card {
    position: relative;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.enhanced-product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Product Badges */
.product-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-featured {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.badge-low-stock {
    background: linear-gradient(135deg, #ffa726, #ff7043);
    color: white;
    animation: pulse 2s infinite;
}

.badge-new {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Enhanced Product Actions */
.product-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.enhanced-product-card:hover .product-card-overlay {
    opacity: 1;
}

.product-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-action {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-color);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-action:hover {
    background: var(--primary-color);
    color: var(--surface-color);
    transform: scale(1.1);
}

.btn-action i {
    font-size: 1rem;
}

/* Mobile Product Card Optimizations */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 1rem 0;
    }

    .enhanced-product-card:hover {
        transform: none; /* Disable hover transform on mobile */
    }

    .product-card-overlay {
        opacity: 1; /* Always show actions on mobile */
        background: rgba(0, 0, 0, 0.1);
    }

    .product-actions {
        position: absolute;
        top: 1rem;
        right: 1rem;
        flex-direction: column;
    }

    .btn-action {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .product-badges {
        top: 0.5rem;
        left: 0.5rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
}

.product-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-card .product-image {
    overflow: hidden;
}

.product-card .product-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.product-card .product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-family-serif);
}

.product-card .price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0.5rem 0 1.5rem;
}

/* --- Advanced Hero Section --- */
.hero-section-advanced {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    transition: background-image 0.3s ease;
}

/* Fallback styling for hero sections without background images */
.hero-section-advanced.no-background {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

/* Enhanced styling for hero sections with background images */
.hero-section-advanced.has-background {
    background-attachment: fixed;
}

/* Responsive background attachment for mobile */
@media (max-width: 768px) {
    .hero-section-advanced.has-background {
        background-attachment: scroll;
    }
}

/* Hero Heights */
.hero-small { min-height: 50vh; }
.hero-medium { min-height: 70vh; }
.hero-large { min-height: 85vh; }
.hero-fullscreen { min-height: 100vh; }

/* Hero Layouts */
.hero-layout-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-layout-split .hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: inherit;
}

.hero-layout-left {
    display: flex;
    align-items: center;
    text-align: left;
}

.hero-layout-right {
    display: flex;
    align-items: center;
    text-align: right;
}

/* Hero Container */
.hero-container {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.hero-content-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero-layout-centered .hero-content-wrapper {
    justify-content: center;
    text-align: center;
}

/* Hero Overlay */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.4), rgba(0,0,0,0.2));
    z-index: 1;
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 2;
    color: var(--surface-color);
    max-width: 600px;
}

.hero-layout-centered .hero-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Hero Badge */
.hero-badge {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.badge-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--surface-color);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Hero Title */
.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-family: var(--font-family-serif);
    color: var(--surface-color);
}

.title-highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

/* Hero Subtitle */
.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.95;
    font-weight: 400;
}

/* Hero Features */
.hero-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.feature-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    width: 20px;
}

/* Hero Actions */
.hero-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 3rem;
}

.btn-hero-primary {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    color: var(--surface-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
    color: var(--surface-color);
}

.btn-hero-secondary {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    background: transparent;
    border: 2px solid var(--surface-color);
    color: var(--surface-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-hero-secondary:hover {
    background: var(--surface-color);
    color: var(--secondary-color);
}

/* Hero Trust Indicators */
.hero-trust {
    text-align: center;
}

.trust-text {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.trust-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.trust-item img {
    height: 40px;
    opacity: 0.7;
    filter: brightness(0) invert(1);
    transition: opacity 0.3s ease;
}

.trust-item:hover img {
    opacity: 1;
}

/* Hero Visual Side */
.hero-visual {
    position: relative;
    z-index: 2;
}

.hero-image-container {
    position: relative;
    max-width: 100%;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Floating Elements */
.floating-element {
    position: absolute;
    background: var(--surface-color);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.floating-element-1 { top: 10%; right: -10%; }
.floating-element-2 { bottom: 20%; left: -15%; }
.floating-element-3 { top: 50%; right: -5%; }

.floating-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--secondary-color);
}

.floating-content i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.floating-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.floating-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    cursor: pointer;
}

.scroll-arrow {
    width: 50px;
    height: 50px;
    border: 2px solid var(--surface-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--surface-color);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-layout-split .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-visual {
        order: -1;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-features {
        align-items: center;
    }

    .floating-element {
        position: static;
        margin: 1rem 0;
        display: inline-block;
    }

    .trust-logos {
        gap: 1rem;
    }

    .hero-small { min-height: 60vh; }
    .hero-medium { min-height: 70vh; }
    .hero-large { min-height: 80vh; }
    .hero-fullscreen { min-height: 100vh; }
}

/* --- Enhanced Homepage UX --- */
.homepage-wrapper {
    position: relative;
}

/* Trust Bar - Critical for E-commerce Conversion */
.trust-bar {
    background: var(--primary-color);
    color: var(--surface-color);
    padding: 0.75rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trust-items {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.trust-item i {
    font-size: 1.1rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .trust-items {
        gap: 1.5rem;
        justify-content: space-around;
    }

    .trust-item {
        font-size: 0.8rem;
    }

    .trust-item span {
        display: none;
    }

    .trust-item i {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .trust-items {
        gap: 1rem;
    }
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    min-width: 300px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-success {
    border-left-color: #28a745;
}

.toast-error {
    border-left-color: #dc3545;
}

.toast-info {
    border-left-color: #17a2b8;
}

.toast-success .toast-content i {
    color: #28a745;
}

.toast-error .toast-content i {
    color: #dc3545;
}

.toast-info .toast-content i {
    color: #17a2b8;
}

@media (max-width: 768px) {
    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* --- Social Proof Section --- */
.social-proof-section {
    background: var(--background-color);
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.social-proof-content {
    text-align: center;
}

.social-proof-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-family-serif);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-color-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.social-proof-text p {
    font-size: 1.1rem;
    color: var(--text-color-light);
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--surface-color);
    padding: 4rem 0;
}

.newsletter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.newsletter-text h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-family: var(--font-family-serif);
}

.newsletter-text p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.newsletter-form {
    max-width: 400px;
}

.newsletter-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.newsletter-input-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.newsletter-input-group button {
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color);
    color: var(--surface-color);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.newsletter-input-group button:hover {
    background: var(--text-color);
    transform: translateY(-2px);
}

.newsletter-disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsive Social Proof and Newsletter */
@media (max-width: 768px) {
    .social-proof-stats {
        gap: 2rem;
        flex-wrap: wrap;
    }

    .stat-number {
        font-size: 2rem;
    }

    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .newsletter-text h3 {
        font-size: 1.5rem;
    }

    .newsletter-form {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .social-proof-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .newsletter-input-group {
        flex-direction: column;
    }

    .newsletter-input-group button {
        width: 100%;
    }
}

/* --- Quick View Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color-light);
    z-index: 10001;
}

.modal-close:hover {
    color: var(--text-color);
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--text-color-light);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* --- Flash Messages --- */
.flash-message {
    padding: 1rem 1.5rem;
    margin: 1rem auto;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 500;
    max-width: 1280px;
}

.flash-success {
    background: #EBF0E4; /* Muted, earthy green */
    color: #4B5320;
    border: 1px solid rgba(75, 83, 32, 0.2);
}

.flash-error {
    background: #FBEAE5; /* Soft, warm terracotta */
    color: #7D4F50;
    border: 1px solid rgba(125, 79, 80, 0.2);
}

.section {
    padding: 4rem 0;
}

/* Responsive section spacing */
@media (max-width: 768px) {
    .section {
        padding: 2.5rem 0;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 2rem 0;
    }
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-family: var(--font-family-serif);
    font-weight: 500;
    position: relative;
}

.category-description {
    text-align: center;
    max-width: 700px;
    margin: -1.5rem auto 3rem auto;
    font-size: 1.1rem;
    color: var(--text-color-light);
    line-height: 1.6;
}

/* Mobile responsive section titles and descriptions */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }

    .category-description {
        font-size: 1rem;
        margin: -1rem auto 2rem auto;
        padding: 0 1rem;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .category-description {
        font-size: 0.95rem;
        margin: -0.5rem auto 1.5rem auto;
        line-height: 1.5;
    }
}

.why-choose-us-section {
    background-color: var(--surface-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    text-align: center;
}

.feature-item i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.feature-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-hero {
    background-color: var(--secondary-color);
    color: var(--surface-color);
    padding: 6rem 2rem;
    text-align: center;
}

.about-hero h1 {
    font-size: 3.5rem;
    color: var(--surface-color);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.section-title-left {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-family: var(--font-family-serif);
}

.our-philosophy-section {
    background-color: var(--background-color);
}




}

@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
    }
}

/* --- Category Grid --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.category-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    min-height: 280px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.category-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-placeholder {
    width: 100%;
    height: 200px;
    background-color: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
}

.image-placeholder i {
    font-size: 3rem;
    color: var(--border-color);
}

/* Column-specific grid layouts for desktop */
.category-grid-2-cols {
    grid-template-columns: repeat(2, 1fr);
}

.category-grid-3-cols {
    grid-template-columns: repeat(3, 1fr);
}

.category-grid-4-cols {
    grid-template-columns: repeat(4, 1fr);
}

.category-grid-5-cols {
    grid-template-columns: repeat(5, 1fr);
}

.category-grid-6-cols {
    grid-template-columns: repeat(6, 1fr);
}

.category-desc {
    font-size: 0.9rem;
    color: var(--text-color-light);
    margin-top: 0.5rem;
    line-height: 1.4;
}

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

.category-card .category-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1rem;
    background: linear-gradient(to top, rgba(var(--secondary-color-rgb), 0.8) 0%, rgba(var(--secondary-color-rgb), 0) 100%);
    color: var(--surface-color);
    font-weight: 500;
    font-size: 1.2rem;
    text-align: center;
}

.category-card .category-name h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-card .category-name .category-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Mobile Responsive Category Grid */
@media (max-width: 992px) {
    .category-grid,
    .category-grid-2-cols,
    .category-grid-3-cols,
    .category-grid-4-cols,
    .category-grid-5-cols,
    .category-grid-6-cols {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.5rem;
    }

    .category-card {
        min-height: 250px;
    }

    .category-image-wrapper {
        height: 180px;
    }

    .category-card .category-name {
        padding: 1.2rem 0.8rem;
    }

    .category-card .category-name h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .category-grid,
    .category-grid-2-cols,
    .category-grid-3-cols,
    .category-grid-4-cols,
    .category-grid-5-cols,
    .category-grid-6-cols {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.2rem;
        padding: 0.5rem 0;
    }

    .category-card {
        min-height: 220px;
    }

    .category-image-wrapper {
        height: 160px;
    }

    .category-card .category-name {
        padding: 1rem 0.8rem;
    }

    .category-card .category-name h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    .category-card .category-name .category-desc {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .category-grid,
    .category-grid-2-cols,
    .category-grid-3-cols,
    .category-grid-4-cols,
    .category-grid-5-cols,
    .category-grid-6-cols {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .category-card {
        min-height: 200px;
    }

    .category-image-wrapper {
        height: 140px;
    }

    .category-card .category-name {
        padding: 0.8rem 0.6rem;
    }

    .category-card .category-name h3 {
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
    }

    .category-card .category-name .category-desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
    }
}

@media (max-width: 360px) {
    .category-grid,
    .category-grid-2-cols,
    .category-grid-3-cols,
    .category-grid-4-cols,
    .category-grid-5-cols,
    .category-grid-6-cols {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .category-card {
        min-height: 180px;
    }

    .category-image-wrapper {
        height: 120px;
    }

    .category-card .category-name {
        padding: 0.6rem 0.5rem;
    }

    .category-card .category-name h3 {
        font-size: 0.9rem;
    }

    .category-card .category-name .category-desc {
        display: none; /* Hide description on very small screens */
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .category-card:hover {
        transform: none;
    }

    .category-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .category-card:hover img {
        transform: none;
    }
}

/* Ensure category showcase section has proper spacing */
.category-showcase-section {
    padding: 3rem 0;
}

@media (max-width: 768px) {
    .category-showcase-section {
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    .category-showcase-section {
        padding: 1.5rem 0;
    }
}


/* --- Brand Story Section --- */
.section-full-width {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 5rem 0;
    margin-top: 4rem;
    margin-bottom: 4rem;
}

.brand-story-section {
    position: relative;
    background-color: var(--primary-color-darker);
    color: var(--surface-color);
}

.brand-story-section .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--secondary-color-rgb), 0.5);
}

.story-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.story-content h2 {
    color: var(--surface-color);
    font-size: 2.8rem;
}

.story-content .btn-secondary {
    background: transparent;
    border: 2px solid var(--surface-color);
    color: var(--surface-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.story-content .btn-secondary:hover {
    background-color: var(--surface-color);
    border-color: var(--surface-color);
    color: var(--primary-color-darker);
}


/* --- Ingredient Spotlight --- */
.ingredient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    text-align: center;
}

.ingredient-item h3 {
    font-family: var(--font-family-serif);
    font-size: 1.5rem;
    margin-top: 1rem;
}

.ingredient-item p {
    font-size: 0.95rem;
    color: var(--text-color-light);
}

/* --- Testimonials --- */
.testimonials-section {
    background-color: var(--background-color);
    padding: 5rem 0;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.testimonial-card .quote {
    font-size: 1.1rem;
    font-style: italic;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.testimonial-card .author {
.testimonial-author {
    font-weight: 600;
    color: var(--text-color);
    text-align: right;
}


/* --- Product Detail Page --- */
.product-detail-container {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .product-detail-layout {
        grid-template-columns: 1.2fr 1fr;
        gap: 4rem;
    }
}

/* Image Gallery & Zoom */
.product-gallery {
    width: 100%;
}

.product-image-main-container {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    background-color: #f9f9f9;
}

.product-image-wrapper {
    overflow: hidden;
    position: relative;
    border-radius: var(--border-radius);
    aspect-ratio: 1 / 1; /* Enforce a square aspect ratio */
    background-color: #f9f9f9; /* Light background for any letterboxing */
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the container without distortion */
    transition: transform 0.3s ease;
}

.product-image-main-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.product-image-main-container.zoomed img {
    transform: scale(1.5);
}

/* Product Info */
.product-info-main {
    padding-top: 1rem;
}

.product-title {
    font-family: var(--font-family-serif);
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.product-price {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.product-purchase-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.quantity-selector {
    flex-grow: 1;
}

.quantity-selector .form-control {
    width: 80px;
    text-align: center;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    width: fit-content;
}

.quantity-controls .quantity-btn {
    background-color: var(--surface-color);
    border: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.quantity-controls .quantity-btn:hover {
    background-color: var(--border-color);
}

.quantity-controls .quantity-input {
    width: 80px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 0.75rem 0.5rem;
    font-size: 1.1rem;
    background-color: var(--surface-color);
}

.quantity-controls .quantity-input:focus {
    outline: none;
    background-color: #fff;
}

.btn-add-to-cart {
    flex-grow: 2;
    font-size: 1.1rem;
    padding: 16px 24px;
}

/* Accordion */
.accordion-container {
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid #eee;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    margin: 0;
}

.accordion-button {
    width: 100%;
    text-align: left;
    background: var(--surface-color);
    border: none;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease;
}

.accordion-button:hover {
    background-color: #f9f9f9;
}

.accordion-button::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.accordion-button:not(.collapsed)::after {
    transform: translateY(-50%) rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    background: #fdfdfd;
}

.accordion-content.show {
    max-height: 500px; /* Adjust as needed */
}

.accordion-body {
    padding: 1.5rem;
    line-height: 1.7;
    color: #555;
}

/* Sticky Purchase Bar */
.sticky-purchase-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.4s ease;
    visibility: hidden;
}

.sticky-purchase-bar.visible {
    transform: translateY(0);
    visibility: visible;
}

.sticky-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sticky-bar-product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sticky-bar-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.sticky-bar-title {
    font-weight: 500;
}

.sticky-bar-action {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.sticky-bar-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}


/* --- Footer --- */
.footer {
    text-align: center;
    padding: 4rem 2rem;
    margin-top: 4rem;
    background: #4a372d; /* Slightly softer than secondary-color */
    color: rgba(255, 255, 255, 0.8);
}

.footer p {
    margin: 0;
}

/* Star Rating Styles */
.star-rating {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem; /* Space between rating and price */
}

.star-rating i {
    color: #ffc107; /* A standard gold color for stars */
    font-size: 0.9rem;
    margin-right: 2px;
}

.star-rating .review-count {
    font-size: 0.8rem;
    color: #6c757d; /* A muted text color */
    margin-left: 0.5rem;
}

.star-rating .no-reviews {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

.product-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.product-card-actions .btn {
    flex-grow: 1;
}

.btn-quick-view {
    background-color: #6c757d;
    color: #fff;
}

.btn-quick-view:hover {
    background-color: #5a6268;
}

/*--------------------------------------------------------------
# Quick View Modal
--------------------------------------------------------------*/
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show, .modal-overlay:target, .modal-overlay[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

/* Smaller modal for cart notifications */
#added-to-cart-modal .modal-content {
    max-width: 500px;
}

.modal-overlay:target .modal-content, .modal-overlay[style*="display: flex"] .modal-content, .modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.quick-view-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.quick-view-gallery .quick-view-main-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.quick-view-details h2 {
    margin-top: 0;
    font-size: 1.8rem;
}

.quick-view-details .price {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.quick-view-details p {
    line-height: 1.6;
}

.loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid var(--primary-color); /* Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

@media (max-width: 768px) {
    .quick-view-layout {
        grid-template-columns: 1fr;
    }
    .modal-content {
        padding: 1.5rem;
    }
    .quick-view-details h2 {
        font-size: 1.5rem;
    }
}


/* Search Results Page */
.search-results-page .page-title {
    margin-bottom: 2rem;
    text-align: center;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    border: 1px dashed #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.no-results p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #555;
}

.no-results .btn {
    margin-top: 1rem;
}

/*--------------------------------------------------------------
# Product Page
--------------------------------------------------------------*/
.product-page-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.product-gallery .main-image-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.product-gallery .main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details-main .product-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.product-meta-top {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.product-meta-top .reviews-link {
    color: var(--text-muted);
    text-decoration: none;
}
.product-meta-top .reviews-link:hover {
    color: var(--primary-color);
}

.product-price-main {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-short-description {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.add-to-cart-form.modern {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.add-to-cart-form.modern .quantity-selector {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.add-to-cart-form.modern .quantity-btn,
.add-to-cart-form.modern .quantity-input {
    border: none;
    background: var(--surface-color);
    padding: 0 1rem;
    height: 50px;
}

.add-to-cart-form.modern .quantity-input {
    width: 50px;
    text-align: center;
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
}
.add-to-cart-form.modern .quantity-input::-webkit-outer-spin-button,
.add-to-cart-form.modern .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart-form.modern .quantity-btn {
    cursor: pointer;
    font-size: 1.2rem;
}

.add-to-cart-form.modern .btn-add-to-cart {
    flex-grow: 1;
    height: 50px;
}

/* Product Info Tabs */
.product-info-tabs {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tab-headers {
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-link {
    border: none;
    background: none;
    padding: 1rem 0;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.tab-link.active {
    color: var(--text-color);
    font-weight: 600;
}

.tab-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-link.active::after {
    transform: scaleX(1);
}

.tab-content {
    display: none;
    padding: 2rem 0;
    line-height: 1.7;
}

.tab-content.active {
    display: block;
}

@media (min-width: 768px) {
    .product-page-layout {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}


/*--------------------------------------------------------------
# Checkout Page
--------------------------------------------------------------*/
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.checkout-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.checkout-section {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.checkout-section .section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Payment Options */
.payment-options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-option {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.payment-option:has(input:checked) {
    border-color: var(--primary-color);
    background-color: var(--primary-color-light);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.payment-option-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    cursor: pointer;
}

.payment-option-title {
    font-weight: 600;
    color: var(--text-color);
}

.payment-option-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.mpesa-instructions {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.mpesa-instructions ol {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Order Summary Sidebar */
.checkout-sidebar .order-summary {
    position: sticky;
    top: 120px; /* Adjust based on header height */
}

.order-summary-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-item-image {
    position: relative;
}

.summary-item-image img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.summary-item-quantity {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid var(--surface-color);
}

.summary-item-info {
    flex-grow: 1;
}

.summary-item-name {
    font-weight: 500;
}

.summary-item-price {
    font-weight: 600;
}

.order-summary-total {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.total-row.grand-total {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.checkout-form .btn-block {
    margin-top: 2rem;
}

/* Responsive Layout */
@media (min-width: 992px) {
    .checkout-layout {
        grid-template-columns: 1fr 400px; /* Main content and sidebar */
        align-items: flex-start;
    }
}

/*--------------------------------------------------------------
# Admin Styles
--------------------------------------------------------------*/
:root {
    --admin-bg: #f8f9fa;
    --admin-sidebar-bg: #2c3e50;
    --admin-sidebar-text: #ecf0f1;
    --admin-sidebar-active: #3498db;
    --admin-header-bg: #ffffff;
    --admin-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.admin-container {
    display: flex;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1010;
    transition: width 0.3s ease;
}

.admin-container.sidebar-collapsed .admin-sidebar {
    width: 80px;
}

.sidebar-header {
    padding: 1.25rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-header .logo {
    color: var(--surface-color);
}

.admin-nav {
    flex-grow: 1;
}

.admin-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-nav a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.admin-nav a:hover, .admin-nav li.active > a {
    background: var(--admin-sidebar-active);
    color: var(--surface-color);
}

.admin-nav a i {
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--admin-sidebar-text);
    opacity: 0.8;
}

.sidebar-footer a:hover {
    opacity: 1;
    color: var(--surface-color);
}

.sidebar-footer a i {
    font-size: 1.1rem;
    margin-right: 1rem;
}

.admin-container.sidebar-collapsed .admin-nav span,
.admin-container.sidebar-collapsed .sidebar-header .logo,
.admin-container.sidebar-collapsed .sidebar-footer span {
    display: none;
}

.admin-container.sidebar-collapsed .admin-nav a,
.admin-container.sidebar-collapsed .sidebar-footer a {
    justify-content: center;
}

.admin-container.sidebar-collapsed .admin-nav a i,
.admin-container.sidebar-collapsed .sidebar-footer a i {
    margin-right: 0;
}

.admin-main-content {
    flex-grow: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    background: var(--admin-bg);
}

.admin-container.sidebar-collapsed .admin-main-content {
    margin-left: 80px;
}

.admin-header {
    background: var(--admin-header-bg);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--admin-shadow);
    position: sticky;
    top: 0;
    z-index: 1005;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.admin-main {
    padding: 2rem;
}

/* Admin Table Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--background-color);
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: #f1f3f5;
}

@media (max-width: 992px) {
    .admin-sidebar {
        left: -260px;
        width: 260px;
    }
    .admin-container.sidebar-collapsed .admin-sidebar {
        left: 0;
    }
    .admin-main-content {
        margin-left: 0;
    }
}

.admin-sidebar {
    width: 250px;
    background: var(--secondary-color);
    color: var(--surface-color);
    padding: 2rem;
    min-height: 100vh;
}

.admin-sidebar h2 {
    color: var(--surface-color);
    text-align: center;
    margin-bottom: 2rem;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar ul li a {
    display: block;
    color: var(--surface-color);
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    transition: background-color 0.3s ease;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background-color: var(--primary-color);
}

.admin-main {
    flex: 1;
    padding: 2rem;
    background: #f9f9f9;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background-color: var(--light-grey);
    font-weight: bold;
}

.admin-table tr:hover {
    background-color: #f9f9f9;
}

/* --- Order Status Badges --- */
[class*="status-"] {
    padding: 5px 10px;
    border-radius: 15px;
    color: var(--surface-color);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}
.status-pending { background-color: #ffc107; color: #333; }
.status-processing { background-color: #17a2b8; }
.status-shipped { background-color: #007bff; }
.status-completed { background-color: #28a745; }
.status-cancelled { background-color: #dc3545; }

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.product-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1rem;
    text-align: center;
}

.product-card img {
    max-width: 100%;
    height: auto;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.product-card h3 {
    font-size: 1.2rem;
}

.product-card .price {
    font-weight: bold;
    color: #e8491d;
    font-size: 1.1rem;
}

.product-card .btn {
    display: inline-block;
    background: #e8491d;
    color: var(--surface-color);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: var(--surface-color);
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: .25rem;
    font-size: 80%;
    color: #dc3545;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: .25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.btn-success {
    color: var(--surface-color);
    background-color: #28a745;
    border-color: #28a745;
}

.btn-light {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

.btn-block {
    display: block;
    width: 100%;
}

.card {
    position: relative;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: var(--surface-color);
    background-clip: border-box;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: .25rem;
}

.card-body {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.bg-light {
    background-color: #f8f9fa!important;
}

.mt-5 {
    margin-top: 3rem!important;
}

.mx-auto {
    margin-left: auto!important;
    margin-right: auto!important;
}

/* --- Cart Page --- */
.cart-page-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.cart-items-list {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.cart-items-list h1 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.cart-item-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-card:last-child {
    border-bottom: none;
}

.cart-item-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.cart-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-info .item-name {
    font-family: var(--font-family-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-info .item-price {
    color: var(--text-color-light);
    margin-bottom: 1rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-quantity .quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px;
}

.cart-item-quantity .btn-update {
    padding: 8px 12px;
    font-size: 0.9rem;
    background-color: var(--accent-color);
    color: var(--surface-color);
}
.cart-item-quantity .btn-update:hover {
    background-color: var(--primary-color);
}


.cart-item-subtotal {
    font-weight: 600;
    font-size: 1.1rem;
    margin-left: auto;
    text-align: right;
}

.cart-item-remove a {
    color: var(--text-color-light);
    font-size: 0.9rem;
    text-decoration: underline;
    margin-top: 0.5rem;
}
.cart-item-remove a:hover {
    color: var(--error-color);
}


.cart-summary {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 120px; /* Adjust based on header height */
}

.cart-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.empty-cart-container {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.empty-cart-container i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.empty-cart-container p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .cart-page-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .cart-item-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .cart-item-subtotal {
        margin-left: 0;
        margin-top: 1rem;
    }
    .cart-item-info {
        align-items: center;
    }
}

/* Checkout Page */
.checkout-container, .checkout-success-container {
    width: 100%;
    margin-top: 2rem;
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 5px;
}

.order-summary {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 5px;
}

.summary-item, .summary-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.checkout-form .form-group {
    margin-bottom: 1.5rem;
}

.payment-options {
    margin-top: 0.5rem;
}

.mpesa-instructions {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 20px;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.1);
}

.mpesa-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #28a745;
}

.mpesa-header h4 {
    color: #28a745;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.mpesa-number {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    display: inline-block;
    font-weight: 600;
    margin: 0;
}

.mpesa-steps h5 {
    color: #155724;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.mpesa-step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mpesa-step-list li {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.mpesa-step-list li:hover {
    transform: translateX(5px);
}

.step-number {
    background: #28a745;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

.highlight-number {
    background: #ffc107;
    color: #212529;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.mpesa-note {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.mpesa-note p {
    margin: 0;
    color: #0c5460;
    font-size: 0.9rem;
}

.mpesa-note i {
    color: #17a2b8;
    margin-right: 8px;
}

.checkout-success-container {
    text-align: center;
}

/* Advanced Order Status Management */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #ffc107; color: #212529; }
.status-processing { background: #17a2b8; color: white; }
.status-shipped { background: #6f42c1; color: white; }
.status-delivered { background: #28a745; color: white; }
.status-completed { background: #28a745; color: white; }
.status-cancelled { background: #dc3545; color: white; }
.status-on_hold { background: #fd7e14; color: white; }
.status-refunded { background: #6c757d; color: white; }

.priority-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-low { background: #e9ecef; color: #495057; }
.priority-normal { background: #d1ecf1; color: #0c5460; }
.priority-high { background: #f8d7da; color: #721c24; }
.priority-urgent { background: #dc3545; color: white; }

.fulfillment-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.fulfillment-unfulfilled { background: #f8d7da; color: #721c24; }
.fulfillment-partial { background: #fff3cd; color: #856404; }
.fulfillment-fulfilled { background: #d4edda; color: #155724; }

/* Status Timeline */
.status-timeline {
    position: relative;
    padding-left: 30px;
}

.status-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.timeline-marker {
    position: absolute;
    left: -25px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-marker i {
    font-size: 8px;
    color: #28a745;
}

.timeline-content {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 3px solid #28a745;
}

.timeline-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.status-change {
    font-weight: 600;
}

.old-status {
    color: #6c757d;
    text-decoration: line-through;
}

.new-status {
    color: #28a745;
}

.timeline-meta,
.timeline-reason,
.timeline-notification {
    margin-top: 5px;
}

.timeline-reason {
    font-style: italic;
    color: #495057;
}

/* Enhanced Status Form */
#reason-group {
    transition: all 0.3s ease;
}

#status-update-form .form-check {
    margin-top: 10px;
}

/* Admin Panel */
.admin-container {
    display: flex;
}

.admin-nav {
    width: 200px;
    background: var(--secondary-color);
    color: var(--surface-color);
    min-height: 100vh;
    padding: 1rem;
}

.admin-nav ul {
    list-style: none;
    padding: 0;
}

.admin-nav ul li a {
    color: var(--surface-color);
    text-decoration: none;
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--primary-color-darker);
}
}

.admin-main {
    flex-grow: 1;
    padding: 2rem;
    background: var(--background-color);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    background: var(--surface-color);
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

.admin-table th {
    background-color: var(--background-color);
}

.admin-table img {
    max-width: 60px;
    border-radius: 5px;
}


/* Admin Order Details */
.order-details-container {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 5px;
}

.order-meta {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.order-meta p {
    margin-bottom: 0.5rem;
}

.order-total {
    text-align: right;
    margin-top: 2rem;
}

/* Quick View Modal Styles */
.quick-view-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.quick-view-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.quick-view-gallery .main-image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.quick-view-gallery .quick-view-main-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-soft);
    border: 1px solid var(--color-border);
}

.quick-view-gallery .gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    color: var(--color-text-dark);
    font-size: 1rem;
}

.quick-view-gallery .gallery-arrow:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.quick-view-gallery .gallery-arrow.prev {
    left: 10px;
}

.quick-view-gallery .gallery-arrow.next {
    right: 10px;
}

.quick-view-gallery .btn-view-details {
    width: 100%;
    text-align: center;
    background-color: var(--color-dark);
    color: #fff;
    padding: 0.8rem;
    font-weight: 600;
}

.quick-view-details .product-brand {
    font-size: 0.9rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.quick-view-details h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.quick-view-details .star-rating {
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.quick-view-details .star-rating .review-count {
    color: var(--color-text-light);
    margin-left: 0.5rem;
}

.quick-view-details .price {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 1rem;
}

.quick-view-details .stock-status {
    font-weight: 500;
    margin-bottom: 1rem;
}

.quick-view-details .stock-status.in-stock {
    color: var(--color-success);
}

.quick-view-details .stock-status.out-of-stock {
    color: var(--color-danger);
}

.quick-view-details .description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-med);
    margin-bottom: 1.5rem;
}

.quick-view-details .add-to-cart-form {
    display: flex;
    gap: 1rem;
}

.quick-view-details .add-to-cart-form .btn-primary {
    flex-grow: 1;
}

/* Product Card Enhancements */
.product-card {
    position: relative;
    overflow: hidden; /* Ensures the overlay doesn't spill out */
}

.product-image-wrapper {
    position: relative;
}

.product-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-card-overlay {
    opacity: 1;
}

.btn-quick-view {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-quick-view:hover {
    background-color: var(--accent-color);
}

.product-card-actions {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}

.add-to-cart-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quantity-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.quantity-selector .quantity-btn {
    background-color: #f5f5f5;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1;
}

.quantity-selector .quantity-btn:hover {
    background-color: #e0e0e0;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    padding: 0.5rem 0;
}

/* Hide spinner arrows on number inputs */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.add-to-cart-form .btn {
    width: 100%;
}

.product-info h3 {
    font-size: 1.1rem; /* Slightly larger for emphasis */
    margin-bottom: 0.5rem;
}

.product-info .price {
    font-size: 1.25rem; /* Make price more prominent */
    font-weight: bold;
    color: var(--accent-color);
    margin-top: 0.5rem;
}

/* Product Info Sections */
.product-info-section {
    margin-bottom: 2rem;
}

.product-info-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.product-info-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
}

/* Order Status Styles */
.status-pending {
    background-color: #ffc107; /* Yellow */
    color: var(--secondary-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-processing {
    background-color: #17a2b8; /* Teal */
    color: var(--surface-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-shipped {
    background-color: #007bff; /* Blue */
    color: var(--surface-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-completed {
    background-color: var(--success-color);
    color: var(--surface-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-cancelled {
    background-color: var(--error-color);
    color: var(--surface-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}


/* Cart Popover Enhancements */
.cart-popover {
    /* Existing styles */
    width: 350px; /* A bit wider for more content */
}

.popover-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
}

.popover-items-container {
    max-height: 300px; /* Limit height and allow scrolling */
    overflow-y: auto;
}

.popover-item {
    display: flex;
    padding: 0.75rem 1rem;
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.popover-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.popover-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: none !important;
    transform: none !important;
}

.popover-item-info {
    flex-grow: 1;
}

.popover-item-name {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.popover-item-price {
    font-size: 0.9rem;
    color: #555;
}

.popover-item-actions {
    margin-left: auto;
}

.btn-remove-from-cart {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1rem;
}

.popover-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
}

.popover-total {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.popover-empty {
    padding: 2rem 1rem;
    text-align: center;
    display: none; /* Hidden by default */
}

.cart-popover.is-empty .popover-header,
.cart-popover.is-empty .popover-footer,
.cart-popover.is-empty .popover-items-container {
    display: none;
}

.cart-popover.is-empty .popover-empty {
    display: block;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    background: var(--secondary-color);
    color: var(--surface-color);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.dropdown-toggle:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.dropdown.show .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none !important;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #fff;
    min-width: 280px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 9999;
    border-radius: 8px;
    padding: 0;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    margin-top: 5px;
}

.dropdown-menu.show {
    display: block !important;
    animation: dropdownFadeIn 0.2s ease-out;
}

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

.dropdown-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-header .user-info strong {
    font-size: 0.95rem;
    font-weight: 600;
}

.dropdown-header .user-info small {
    font-size: 0.8rem;
    opacity: 0.9;
}

.dropdown-section-header {
    padding: 0.5rem 1.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
    background-color: #f8f9fa;
}

.dropdown-item {
    color: #333;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #f8f9fa;
    color: var(--primary-color);
    text-decoration: none;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: #6c757d;
    transition: color 0.2s ease;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-item.logout-item {
    border-top: 1px solid #e9ecef;
    margin-top: 0.25rem;
    color: #dc3545;
}

.dropdown-item.logout-item:hover {
    background-color: #f8d7da;
    color: #721c24;
}

.dropdown-item.logout-item i {
    color: #dc3545;
}

.dropdown-item.logout-item:hover i {
    color: #721c24;
}

.dropdown-item.disabled {
    color: #6c757d;
    pointer-events: none;
    background-color: transparent;
    font-weight: bold;
}

.dropdown-divider {
    height: 1px;
    margin: 0.5rem 0;
    overflow: hidden;
    background-color: #e9ecef;
}

/* User avatar in dropdown */
.user-avatar-small img {
    border: 2px solid rgba(255,255,255,0.3);
}


/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    max-width: 320px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background-color: var(--success-bg-color);
    color: var(--success-color);
    border-left: 5px solid var(--success-color);
}

.toast-error {
    background-color: var(--error-bg-color);
    color: var(--error-color);
    border-left: 5px solid var(--error-color);
}

/* Auth Page Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
}

.auth-card {
    background-color: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

.auth-form .form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.switch-auth-link {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

/* Added to Cart Modal Actions */
.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.modal-actions .btn {
    width: 100%;
    text-align: center;
}

/* Added to Cart Modal Styles */
.added-item-details {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.added-item-details picture {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.added-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: none !important; /* Remove any transitions that might cause shaking */
    transform: none !important; /* Prevent any transform effects */
}

/* Prevent hover effects on cart modal and popover images */
.added-item-details picture:hover .added-item-image,
.modal-content .added-item-image:hover,
.cart-popover img:hover,
.popover-item-image img:hover {
    transform: none !important;
    transition: none !important;
}

.added-item-details .item-info {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
}

.added-item-details .item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.added-item-details .item-variation {
    font-size: 0.9rem;
    color: var(--text-color-light);
    margin: 0 0 0.25rem 0;
}

.added-item-details .item-price,
.added-item-details .item-quantity {
    font-size: 0.9rem;
    color: var(--text-color-light);
    margin: 0 0 0.25rem 0;
}

.cart-summary {
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 1rem 0;
}

.cart-summary p {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.cart-summary p:last-child {
    margin-bottom: 0;
}

/* Flash Message Close Button */
.close-flash {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
    background-color: transparent;
    border: 0;
    cursor: pointer;
}
