/* 
   Nabadwip.Shop - Premium Digital Product Store
   Theme: Modern, Dark/Light Mode, Glassmorphism
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

@import 'dialog.css';
@import 'loader.css';

:root {
    --primary: #8B4513;
    /* Saddle Brown */
    --primary-dark: #6B3410;
    --secondary: #D2691E;
    /* Chocolate */
    --accent: #CD853F;
    /* Peru */

    --bg-body: #FAF5F0;
    --bg-card: #ffffff;
    --text-main: #3E2723;
    --text-muted: #6D4C41;
    --border: #D7CCC8;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --header-height: 70px;
}

[data-theme="dark"] {
    --bg-body: #2C1810;
    /* Deep Brown */
    --bg-card: #3E2723;
    /* Brown Card */
    --text-main: #F5F5DC;
    --text-muted: #BCAAA4;
    --border: #5D4037;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

.container {
    width: 80%;
    max-width: 1400px;
    /* Slight increase to allow 80% to breathe on larger screens */
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--border);
}

.btn-accent {
    background: linear-gradient(135deg, var(--secondary), #d946ef);
    color: white;
}

/* --- Header / Navbar --- */
.site-header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

[data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.8);
}

/* Force hide Admin Panel in header */
.site-header a[href*="admin"] {
    display: none !important;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-icons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
}

.nav-icons .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--secondary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Search */
.nav-search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-input {
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    width: 300px;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.nav-search-input:focus {
    width: 360px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.nav-search-icon {
    position: absolute;
    left: 0.8rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}


/* --- Mobile Nav --- */
.mobile-nav-toggle {
    display: none;
}

.mobile-bottom-nav {
    display: none;
}

/* --- Hero Section --- */
.hero {
    padding: 5rem 0;
    text-align: center;
    background: radial-gradient(circle at top center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* --- Product Grid --- */
.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* Fixed 5 columns on desktop */
    gap: 2rem;
    padding-bottom: 4rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 2px solid #8B4513;
    /* 2px brown border */
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.product-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: var(--bg-body);
}

/* Category Card Styles (Desktop) */
.category-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 1.5rem;
    overflow: hidden;
    border: 3px solid #8B4513;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(139, 69, 19, 0.25);
}

.category-image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-body);
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-label {
    padding: 1.25rem 1rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-card);
}

.product-details {
    padding: 1.5rem;
}

.product-category {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    transition: all 0.2s;
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- Authentication --- */
.auth-container {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Category Slider */
.category-nav {
    padding: 1.5rem 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.category-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0.5rem;
    /* More padding for shadows */
    justify-content: flex-start;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

.category-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

@media (min-width: 1024px) {
    .category-container {
        justify-content: center;
    }
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-width: 85px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.category-item .icon-placeholder,
.category-item img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--text-muted);
}

/* Specific styling for All Products icon */
.category-item:first-child .icon-placeholder {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: var(--text-main);
}

[data-theme="dark"] .category-item:first-child .icon-placeholder {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: var(--text-main);
}

/* Hover State */
.category-item:hover .icon-placeholder,
.category-item:hover img {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
    /* Primary color glow */
    border-color: var(--primary);
    color: var(--primary);
    background: white;
}

[data-theme="dark"] .category-item:hover .icon-placeholder {
    background: var(--bg-card);
}

.category-item:hover span {
    color: var(--primary);
    transform: translateY(-2px);
}

/* Active State */
.category-item.active .icon-placeholder,
.category-item.active img {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    transform: translateY(-5px) scale(1.05);
}

.category-item.active span {
    color: var(--primary);
    font-weight: 700;
}

.category-item span {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    transition: all 0.3s ease;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Banner Slider */
.home-slider {
    position: relative;
    width: 90%;
    max-width: 1400px;
    height: 400px;
    /* Fallback / Mobile specific height */
    overflow: hidden;
    background: var(--bg-card);
    margin: 0 auto 2rem;
    border-radius: var(--radius-lg);
}

@media (min-width: 1024px) {
    .home-slider {
        height: auto;
        /* Allow height to adapt based on width */
        aspect-ratio: 3/1;
        /* Common banner ratio (e.g. 1200x400), adjust as needed */
    }
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
    z-index: 10;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    /* Ensures the entire image is visible, stretching if necessary */
}

/* Navigation Buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.slider-btn:hover {
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* Dots */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

/* Mobile Search Styles */
.mobile-search-container {
    display: none;
    background: var(--bg-card);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 60px;
    /* Below header */
    z-index: 90;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive & Mobile First --- */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 1rem;
    }

    .auth-container {
        padding: 1rem;
        align-items: flex-start;
        /* Move to top on mobile */
        padding-top: 2rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    /* Hide Desktop Nav */
    .nav-links {
        display: none;
    }

    /* Show Mobile Toggle if needed (though we use bottom nav) */
    .mobile-nav-toggle {
        display: block;
    }

    /* Adjust Hero Typography */
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Adjust Product Grid for Mobile (3 Columns for Categories) */
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        /* Force 3 columns */
        gap: 0.5rem;
        /* Reduced gap for bigger cards */
        padding: 0 0.25rem 5rem 0.25rem;
        /* Minimal horizontal padding */
    }

    .product-card {
        border-radius: var(--radius-lg);
        /* Slightly smaller radius */
        border: 2px solid #8B4513;
        /* 2px brown border */
    }

    /* Category Card Specific Styles for Mobile */
    .category-card {
        display: flex;
        flex-direction: column;
        background: var(--bg-card);
        border-radius: 1rem;
        overflow: hidden;
        border: 2px solid #8B4513;
        text-decoration: none;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .category-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(139, 69, 19, 0.2);
    }

    .category-image-wrapper {
        width: 100%;
        aspect-ratio: 4/3;
        overflow: hidden;
        background: var(--bg-body);
    }

    .category-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .category-label {
        padding: 0.85rem 0.25rem;
        text-align: center;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-main);
        background: var(--bg-card);
    }

    .product-details {
        padding: 0.75rem;
        /* Compact padding */
    }

    .product-title {
        font-size: 1rem;
        /* Smaller title */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .product-price {
        font-size: 1.1rem;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* Mobile Header Adjustments */
    .site-header {
        height: 60px;
        padding: 0 0.5rem;
    }

    .navbar {
        padding: 0 0.5rem;
    }

    .brand {
        font-size: 1.25rem;
    }

    .mobile-search-toggle {
        display: inline-flex !important;
    }

    /* Show the large footer on mobile but adjust */
    footer {
        display: block !important;
        margin-bottom: 80px;
        /* Space for bottom nav */
        padding-bottom: 2rem;
        position: relative;
        z-index: 1;
    }

    /* Ensure body has padding for bottom nav */
    body {
        padding-bottom: 100px;
    }

    /* Bottom Navigation Bar - App Style */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        /* Fixed height */
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid var(--border);
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        /* Ensure it's on top */
        padding-bottom: env(safe-area-inset-bottom);
        /* Safe area for iPhone X+ */
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    }

    [data-theme="dark"] .mobile-bottom-nav {
        background: rgba(30, 41, 59, 0.95);
        border-top-color: var(--border);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 0.7rem;
        color: var(--text-muted);
        text-decoration: none;
        flex: 1;
        height: 100%;
    }

    .bottom-nav-item.active {
        color: var(--primary);
    }

    .bottom-nav-item.active i {
        transform: translateY(-2px);
    }

    .bottom-nav-item i {
        font-size: 1.4rem;
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .dot {
        width: 10px;
        height: 10px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        cursor: pointer;
        transition: background 0.3s;
    }

    .dot.active {
        background: white;
        transform: scale(1.2);
    }

    /* Mobile Search Styles */
    .mobile-search-container {
        display: none;
        background: var(--bg-card);
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 60px;
        /* Below header */
        z-index: 90;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* --- Responsive & Mobile First --- */
    @media (max-width: 768px) {
        .container {
            width: 100%;
            padding: 0 1rem;
        }

        .auth-container {
            padding: 1rem;
            align-items: flex-start;
            /* Move to top on mobile */
            padding-top: 2rem;
        }

        .auth-card {
            padding: 1.5rem;
        }

        /* Hide Desktop Nav */
        .nav-links {
            display: none;
        }

        /* Show Mobile Toggle if needed (though we use bottom nav) */
        .mobile-nav-toggle {
            display: block;
        }

        /* Adjust Hero Typography */
        .hero h1 {
            font-size: 2rem;
        }

        .hero p {
            font-size: 1rem;
        }

        /* Adjust Product Grid for Mobile (2 Columns) */
        .product-grid {
            grid-template-columns: repeat(2, 1fr);
            /* Force 2 columns */
            gap: 1rem;
            /* Smaller gap */
            padding: 0 0.5rem 5rem 0.5rem;
            /* Add bottom padding for nav */
        }

        .product-card {
            border-radius: var(--radius-lg);
            /* Slightly smaller radius */
        }

        .product-details {
            padding: 0.75rem;
            /* Compact padding */
        }

        .product-title {
            font-size: 1rem;
            /* Smaller title */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .product-price {
            font-size: 1.1rem;
        }

        .btn-icon {
            width: 32px;
            height: 32px;
            font-size: 0.9rem;
        }

        /* Mobile Header Adjustments */
        .site-header {
            height: 60px;
            padding: 0 0.5rem;
        }

        .navbar {
            padding: 0 0.5rem;
        }

        .brand {
            font-size: 1.25rem;
        }

        .mobile-search-toggle {
            display: inline-flex !important;
        }

        /* Show the large footer on mobile but adjust */
        footer {
            display: block !important;
            margin-bottom: 80px;
            /* Space for bottom nav */
            padding-bottom: 2rem;
            position: relative;
            z-index: 1;
        }

        /* Ensure body has padding for bottom nav */
        body {
            padding-bottom: 100px;
        }

        /* Bottom Navigation Bar - App Style */
        .mobile-bottom-nav {
            display: flex;
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 70px;
            /* Fixed height */
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid var(--border);
            justify-content: space-around;
            align-items: center;
            z-index: 1000;
            /* Ensure it's on top */
            padding-bottom: env(safe-area-inset-bottom);
            /* Safe area for iPhone X+ */
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
        }

        [data-theme="dark"] .mobile-bottom-nav {
            background: rgba(30, 41, 59, 0.95);
            border-top-color: var(--border);
        }

        .bottom-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            font-size: 0.7rem;
            color: var(--text-muted);
            text-decoration: none;
            flex: 1;
            height: 100%;
        }

        .bottom-nav-item.active {
            color: var(--primary);
        }

        .bottom-nav-item.active i {
            transform: translateY(-2px);
        }

        .bottom-nav-item i {
            font-size: 1.4rem;
            transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .home-slider {
            height: 250px;
        }

        .prev-btn,
        .next-btn {
            width: 32px;
            height: 32px;
            font-size: 1rem;
        }
    }

    /* Force hide Admin Panel in header */
    .site-header a[href*="admin"] {
        display: none !important;
    }

    /* --- Admin & Utility Styles --- */
    .card {
        background: var(--bg-card);
        border-radius: var(--radius-lg);
        padding: 1.5rem;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
        margin-bottom: 1.5rem;
    }

    .table {
        width: 100%;
        border-collapse: collapse;
    }

    .table th,
    .table td {
        padding: 1rem;
        text-align: left;
        border: 1px solid var(--border);
        /* Full borders */
    }

    .table th {
        font-weight: 600;
        color: var(--text-muted);
        background: var(--bg-body);
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
    }

    .table tr:nth-child(even) {
        background-color: rgba(0, 0, 0, 0.02);
        /* Striped effect */
    }

    .table-responsive {
        overflow-x: auto;
    }

    .text-danger {
        color: #ef4444 !important;
    }

    .text-success {
        color: #22c55e !important;
    }

    .text-muted {
        color: var(--text-muted) !important;
    }

    .badge {
        padding: 0.25rem 0.75rem;
        border-radius: 999px;
        font-size: 0.85rem;
        font-weight: 500;
        display: inline-block;
    }

    .badge-success {
        background: rgba(34, 197, 94, 0.1);
        color: #22c55e;
    }

    .badge-warning {
        background: rgba(234, 179, 8, 0.1);
        color: #eab308;
    }

    .badge-danger {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
    }

    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .table th {
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
    }

    .table tr:hover {
        background-color: rgba(99, 102, 241, 0.05);
    }

    .table td {
        vertical-align: middle;
    }

    /* Full Width Admin Table Adjustments */
    .main-content .card {
        width: 100%;
        max-width: none;
        border-radius: var(--radius-lg);
        overflow-x: hidden;
    }

    .main-content .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-content .table {
        width: 100%;
        /* Ensure it doesn't squish too much */
        white-space: nowrap;
    }

    /* Enforce Table Styling */
    .table tr:nth-child(even) {
        background-color: rgba(0, 0, 0, 0.02);
    }

    .table {
        border-collapse: collapse;
        width: 100%;
        border: 1px solid var(--border);
    }

    .table th,
    .table td {
        border: 1px solid var(--border);
        padding: 0.75rem;
        vertical-align: middle;
    }

    .table th {
        background-color: var(--bg-card);
        font-weight: 600;
        text-transform: uppercase;
    }


    .table th,
    .table td {
        text-align: center;
    }

    .table th:first-child,
    .table td:first-child {
        text-align: left;
    }

    /* Reset Table Alignment */
    .table th,
    .table td {
        text-align: left;
        vertical-align: middle;
    }

    .text-center {
        text-align: center !important;
    }

    .text-right {
        text-align: right !important;
    }

    .btn-warning {
        background-color: #f59e0b;
        color: white;
        border: none;
    }

    .btn-danger {
        background-color: #ef4444;
        color: white;
        border: none;
    }

    .btn-success {
        background-color: #22c55e;
        color: white;
        border: none;
    }

    .btn-dark {
        background-color: #1f2937;
        color: white;
        border: none;
    }
}

/* Skeleton Loader */
.skeleton-loader {
    display: grid;
    gap: 1rem;
}

.skeleton-item {
    height: 100px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    animation: pulse 1.5s infinite;
    border: 1px solid var(--border);
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Horizontal Product Card (for sub-categories) */
.product-grid-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    padding-bottom: 2rem;
}

@media (max-width: 768px) {
    .product-grid-horizontal {
        grid-template-columns: 1fr;
    }
}

.product-card-horizontal {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
    height: 140px;
}

.product-card-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pch-image-container {
    width: 35%;
    max-width: 120px;
    background: #fff;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
}

.pch-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pch-content {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.pch-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 4px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pch-weight {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.pch-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
}

.pch-prices {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.pch-mrp {
    font-size: 0.85rem;
    text-decoration: line-through;
    color: var(--text-muted);
}

.pch-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.pch-btn {
    background: #FFC107;
    border: none;
    padding: 4px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    color: #000;
    margin-left: auto;
    text-decoration: none;
    display: inline-block;
}

.pch-btn:hover {
    background: #FFB300;
}

.pch-discount {
    position: absolute;
    top: 0;
    right: 0;
    background: #FFE0B2;
    color: #E65100;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-bottom-left-radius: 6px;
    z-index: 5;
}

/* Optimized Category Grid (Mobile 3-cols, Desktop Responsive) */
.home-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .home-category-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem;
    }

    /* Match Desktop Look - Mini Version */
    .home-category-grid .category-card {
        padding: 0;
        /* Full bleed image */
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        overflow: hidden;
    }

    .home-category-grid .category-image-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 4/3;
        /* Match desktop ratio */
        margin-bottom: 0;
        display: block;
        background: var(--bg-body);
    }

    .home-category-grid .category-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        /* Crop to fit like desktop */
    }

    .home-category-grid .category-label {
        font-size: 0.75rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        color: var(--text-main);
        padding: 6px 4px;
        width: 100%;
    }
}

/* Floating View Cart Bar */
.floating-cart-bar {
    position: fixed;
    bottom: 80px;
    /* Above mobile bottom nav */
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    /* Start hidden */
    width: 90%;
    max-width: 500px;
    background: #1a1a1a;
    /* Dark background for contrast */
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    /* Pill shape */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    /* opacity: 0; */
    /* pointer-events: none; */
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    visibility: hidden;
}

[data-theme="dark"] .floating-cart-bar {
    background: #ffffff;
    color: #1a1a1a;
}

.floating-cart-bar.active {
    transform: translateX(-50%) translateY(0);
    visibility: visible;
}

.cart-bar-info {
    display: flex;
    flex-direction: column;
}

.cart-bar-count {
    font-weight: 700;
    font-size: 1rem;
}

.cart-bar-subtext {
    font-size: 0.75rem;
    opacity: 0.8;
}

.cart-bar-btn {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cart-bar-btn:hover {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .floating-cart-bar {
        bottom: 2rem;
        right: 2rem;
        left: auto;
        transform: translateY(150px);
    }

    .floating-cart-bar.active {
        transform: translateY(0);
    }
}

/* Footer Install Section */
.footer-install-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-xl);
    text-align: center;
    margin: 2rem auto;
    width: 90%;
    max-width: 800px;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.8s ease-out;
}

.footer-install-content i {
    color: rgba(255, 255, 255, 0.9);
}

.footer-install-section h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-install-section p {
    margin-bottom: 2rem;
    opacity: 0.9;
    font-size: 1.1rem;
}

.footer-install-btn {
    background: white;
    color: var(--primary);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.footer-install-btn:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .footer-install-section {
        padding: 2rem 1.5rem;
        margin-bottom: 6rem; /* Space for mobile nav */
    }
    
    .footer-install-section h3 {
        font-size: 1.4rem;
    }
}