/* assets/css/style.css */

/* Reset & Basics */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    /* Remove blue highlight on tap */
    /* outline: none; - Removing global reset for accessibility */
}

/* Accessibility: Show focus only for keyboard users */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

:root {
    /* Premium Palette - dynamic from DB but defaults refreshed */
    --primary: #000000;
    --primary-rgb: 0, 0, 0;
    --secondary: #2D3436;
    --bg: #ffffff;
    --glass: rgba(255, 255, 255, 0.95);
    /* Increased opacity for better readability */
    --glass-border: rgba(255, 255, 255, 0.6);
    --text: #2D3436;
    --text-light: #636E72;
    --white: #ffffff;
    --radius: 16px;
    --shadow: none;
    /* Removed shadow */
    --shadow-hover: none;
    /* Removed shadow */

    /* Z-Index Architecture */
    --z-back: -1;
    --z-normal: 1;
    --z-sticky: 900;
    --z-header: 1000;
    --z-overlay: 1001;
    --z-drawer: 1002;
    --z-modal: 2000;
    --z-toast: 10000;
}

/* Page Loader */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    /* Brand Background */
    z-index: 99999;
    /* Topmost */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-circle {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    /* Shadow removed */
    position: relative;
}

/* Optional: Add a spinner ring or just pulse the logo */
.loader-circle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    animation: loaderSpin 1s linear infinite;
}

.loader-circle img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    /* Pulse the logo itself */
    animation: loaderLogoPulse 1.5s infinite ease-in-out;
}

@keyframes loaderSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes loaderLogoPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.9);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Fonts */
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/Cairo-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cairo';
    src: url('../fonts/Cairo-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cairo';
    src: url('../fonts/Cairo-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cairo';
    src: url('../fonts/Cairo-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Local Font Options */
@font-face {
    font-family: 'Almarai';
    src: url('../fonts/Almarai-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Almarai';
    src: url('../fonts/Almarai-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alexandria';
    src: url('../fonts/Alexandria-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alexandria';
    src: url('../fonts/Alexandria-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AGC';
    src: url('../fonts/AGC-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AGC';
    src: url('../fonts/AGC-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

body {
    direction: rtl;
    text-align: right;
    font-family: var(--main-font), 'Cairo', sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Sticky Footer Layout */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
    transition: 0.3s;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 700;
    text-align: center;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: var(--z-normal);
}

.btn-primary {
    background: var(--primary);
    /* Use Admin Variable */
    color: var(--btn-text, #ffffff);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--secondary);
    border: 1px solid #eee;
}

.btn-secondary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* Header */
.site-header {
    background: var(--header-bg);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    box-shadow: none;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.header-inner {
    min-height: 60px;
    /* Soft compact height */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--header-text) !important;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo img {
    height: 40px;
    width: auto;
}

/* Icons Fix */
.mobile-toggle,
.mobile-cart-icon {
    color: var(--header-icon) !important;
}

.mobile-toggle span {
    background-color: var(--header-icon) !important;
}

/* Desktop Nav */
.nav-categories {
    display: flex;
    list-style: none;
    gap: 30px;
}


.nav-categories a {
    text-decoration: none;
    color: var(--header-text) !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
    padding-bottom: 5px;
}

/* Header Hover Effect (Moved from inline) */
.nav-categories a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 2px;
}

.nav-categories a:hover::after,
.nav-categories a.active-link::after {
    width: 100%;
}

.nav-icons {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-icon {
    color: var(--header-icon);
    transition: transform 0.2s;
}

.nav-icon svg {
    stroke: var(--header-icon);
}

.nav-icon:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.nav-icon:hover svg {
    stroke: var(--primary) !important;
    /* Force primary on hover */
}

/* Sidebar Tabs Active (Moved from inline) */
.sidebar-tabs .tab-btn.active {
    border-bottom-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* Desktop: Show nav */
@media (min-width: 769px) {
    .nav-desktop {
        display: flex;
        flex: 1;
        justify-content: space-between;
        align-items: center;
        margin: 0 30px;
    }

    .nav-desktop .nav-categories {
        display: flex;
        gap: 20px;
        align-items: center;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .nav-desktop .nav-icons {
        display: flex;
        gap: 5px;
        align-items: center;
        margin-right: auto;
        /* Push to left edge in RTL */
    }

    .nav-desktop li {
        position: relative;
    }

    .nav-desktop a {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 8px 0;
        color: var(--text);
        font-weight: 500;
        font-size: 0.95rem;
        transition: color 0.3s;
    }

    .nav-desktop a:hover {
        color: var(--primary);
    }

    /* Nav Icons (Cart, Favorites, Search) */
    .nav-desktop .nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
        border-radius: 50%;
        transition: background 0.3s, color 0.3s;
    }

    .nav-desktop .nav-icon:hover {
        background: #f1f2f6;
        color: var(--primary);
    }

    .mobile-toggle {
        display: none;
        /* Hide on desktop */
    }
}

/* Duplicate mobile-bottom-nav removed */

/* Hero Section */
.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    background-color: var(--secondary);
    /* Use Admin Variable */
    background-size: cover;
    background-position: center;
    margin: 20px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: none;
}

/* Offcanvas Menu */
.offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 300px;
    height: 100%;
    background: var(--white);
    transition: transform 0.3s ease-out;
    will-change: transform;
    z-index: var(--z-drawer);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: block;
}

.offcanvas.active {
    transform: translateX(0);
}

.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-overlay);
    /* High z-index */
    visibility: hidden;
    /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease-out, visibility 0s linear 0.3s;
    /* Delay visibility hidden until opacity is done */
    will-change: opacity;
}

.offcanvas-overlay.active {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    animation: fadeUp 0.5s ease-out;
}

.hero-logo-circle {
    width: 100px;
    height: 100px;
    background: var(--white);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeUp 0.7s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    font-weight: 900;
}

/* Cards */
.category-card {
    text-align: center;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
    background: transparent;
    /* No frame */
    border: none;
    box-shadow: none;
    padding: 0;
}

.category-card:hover {
    transform: none;
}

.cat-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 35px;
    /* Softer edges */
    object-fit: cover;
    margin-bottom: 10px;
    transition: 0.3s;
    box-shadow: none;
}

.cat-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.category-card:hover .cat-img {
    transform: none;
}

/* Section Title */
.section-title {
    margin: 20px 0 15px;
    font-weight: 800;
    position: relative;
    display: table;
    width: 100%;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    width: 100%;
}


/* Skeleton Loading - See bottom of file for unified styles */


/* Reveal Animation - See unified styles at bottom of file */

/* Mobile Adjustment */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Force 2 columns on mobile */
        gap: 10px;
    }
}



/* List View Styles */
.product-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 70px;
}

.product-grid.list-view .product-card-img {
    width: 70px;
    height: auto;
    /* Fixed width, auto height to stretch */
    flex-shrink: 0;
    aspect-ratio: auto !important;
}

.product-grid.list-view .product-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 5px 10px;
    justify-content: center;
}

.product-grid.list-view .product-card-desc {
    -webkit-line-clamp: 1;
    line-clamp: 1;
    /* Show only 1 line in list view for compactness */
    margin-bottom: 0px;
}

.product-grid.list-view .product-card-action {
    margin-top: auto;
}

/* Fix for List View Image Expansion */
.product-grid.list-view .product-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ensure skeleton loads correctly in list view */
.product-grid.list-view .product-card.skeleton-card {
    display: flex;
    flex-direction: row;
}

/* Product Card (Base) */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: 0.3s;
    position: relative;
}

/* Skeleton Loading Placeholder — Circular Spinner */
.product-card-img.skeleton {
    background: #f5f5f5;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-card-img.skeleton::after {
    content: '';
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
}

.product-card-img.skeleton img {
    opacity: 0;
}

/* Fade In Zoom - Image Load Animation */
.fade-in-zoom {
    animation: fadeInZoom 0.3s ease-out forwards;
}

@keyframes fadeInZoom {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Spinner for Lazy Load Sections */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Discount Badge - Default (Grid View: Top Right of Card/Image) */
.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff3548;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 5;
}

/* Favorite Button - See unified definition below at ~L1477 */

/* Quantity Button Click Effect */
.qty-btn {
    transition: transform 0.1s;
}

.qty-btn:active {
    transform: scale(0.9);
}

/* Product Options UI (Modal) */
.option-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.option-chip {
    position: relative;
}

.option-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-chip span {
    display: block;
    padding: 6px 14px;
    background: #f1f2f6;
    border: 1px solid #eee;
    border-radius: 12px;
    font-size: 0.90rem;
    font-weight: 600;
    color: #2d3436;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 60px;
}

.option-chip input:checked+span {
    background: var(--primary);
    color: var(--btn-text, #fff);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: none;
}

.addon-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.addon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.2s;
}

.addon-item:hover {
    background: #f9f9f9;
}

.addon-item input {
    width: 18px;
    height: 18px;
    margin-left: 10px;
    accent-color: var(--primary);
}

.addon-item.selected {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.addon-info {
    display: flex;
    flex-direction: column;
}

.addon-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.addon-price {
    font-size: 0.72rem;
    color: #777;
}

/* In Grid View: Badge is Right, Fav is Left (Default above) */

/* In List View: Badge is Left (see above), so Fav should be Right */
.product-grid.list-view .fav-btn {
    left: auto;
    right: 10px;
    top: 10px;
}

/* Discount Badge - List View: see unified rule below */

.product-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    /* Widescreen Image */
    background: #f9f9f9;
    position: relative;
    overflow: hidden;
}

.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-body {
    padding: 10px;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text);
    line-height: 1.2;
}

.product-card-desc {
    color: #777;
    font-size: 0.8rem;
    margin-bottom: 0px;
    height: 25px;
    overflow: hidden;
}

.product-card-price {
    color: var(--text);
    font-weight: 700;
    font-size: 1rem;
    /* Adjusted */
}

/* .product-card-old-price: see unified rule below */

.product-card-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Align bottom */
}

.product-card:hover {
    transform: none;
    box-shadow: none;
}

/* Sticky Nav for Menu */
.sticky-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: none;
    /* Removed shadow */
    border-bottom: 1px solid #f0f0f0;
    /* Light border instead of shadow */
    padding: 10px 0 10px;
    position: sticky;
    top: 60px;
    /* Adjusted to match Header Height */
    z-index: var(--z-sticky);
}

/* ... (rest of styles) ... */

@media (max-width: 768px) {
    .sticky-nav {
        top: 60px;
        /* Mobile Header Height Adjusted */
    }
}

.cat-link {
    background: white;
    border: 1px solid #eee;
    padding: 6px 16px;
    border-radius: 18px;
    transition: 0.3s;
    white-space: nowrap;
    display: inline-block;
}

.cat-link:hover {
    background: var(--bg);
    color: var(--text);
    border-color: #ddd;
    transform: none;
    box-shadow: none;
}

.cat-link.active {
    background: var(--primary);
    color: var(--btn-text, white);
    border-color: var(--primary);
    transform: none;
    box-shadow: none;
}

/* Footer */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0 30px;
    margin-top: auto;
    border-top: var(--footer-border);
    text-align: center;
}

.site-footer p {
    color: var(--footer-text);
}

/* Contact Icons */
.site-footer svg {
    fill: var(--footer-contact-icon);
    color: var(--footer-contact-icon);
}

/* Social Icons */
.site-footer .social-link {
    color: var(--footer-social-icon);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.site-footer .social-link:hover {
    opacity: 0.8;
}

.site-footer .social-link svg {
    fill: currentColor;
    color: currentColor;
    /* Ensure SVG inherits from social-link */
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 20px;
    font-size: 0.9rem;
    color: var(--footer-copyright);
    opacity: 0.8;
    margin-top: 10px;
}

/* View Toggle Styles */
.view-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #f1f2f6;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid #eee;
    width: 90px;
    /* Fixed width for consistency */
}

.view-btn {
    border: none;
    background: none;
    padding: 8px 0;
    /* Increase padding */
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    flex: 1;
    /* Equal width */
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.view-btn:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.03);
}

.view-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: none;
    /* Removed shadow */
    font-weight: bold;
}

/* List View Specific Overrides: see unified rule below */

/* Global Price Alignment */
.product-card-action>div {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Default row direction places 1st item (Price) on Right, 2nd (Old) on Left in RTL */
}

.product-card-old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.75rem;
    margin: 0;
}

/* List View Specific Overrides */
.product-grid.list-view .product-card-action {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
}

/* Position Discount Badge in List View (Top Left of Card) */
.product-grid.list-view .discount-badge {
    right: auto !important;
    left: 10px !important;
    top: 10px !important;
}

.product-grid.list-view .product-card-old-price {
    margin: 0;
    font-size: 0.8rem;
}

/* Position Discount Badge in List View */
.product-grid.list-view .product-card-img span {
    top: auto !important;
    bottom: auto !important;
    right: auto !important;
    left: 0 !important;
    top: 0 !important;
    border-radius: 0 0 4px 0 !important;
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
}

/* Custom Select Styles - Robust Display Logic */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    min-width: 140px;
    width: 100%;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    font-size: 0.9rem;
    color: var(--text);
    height: 38px;
    /* Fixed height match inputs */
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 14px;
    /* Match form inputs */
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
    /* Base Z-Index */
}

/* Open State Trigger */
.custom-select-wrapper.open .custom-select-trigger {
    border-radius: 14px 14px 0 0;
    border-bottom: 1px solid #eee;
}

.custom-select-trigger .arrow {
    width: 10px;
    height: 10px;
    border-bottom: 2px solid #777;
    border-right: 2px solid #777;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-right: 10px;
    margin-top: -4px;
}

.custom-select-wrapper.open .custom-select-trigger .arrow {
    transform: rotate(225deg);
    margin-top: 4px;
}

.custom-options {
    position: absolute;
    display: none;
    /* Default hidden */
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 14px 14px;
    box-shadow: none;
    max-height: 250px;
    overflow-y: auto;
    z-index: 99999;
    /* Critical: Highest Z-Index */
    margin-top: 0;
}

/* Open State Options */
.custom-select-wrapper.open .custom-options {
    display: block !important;
    /* Force visible */
}

.custom-option {
    display: block;
    padding: 12px 15px;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: 0.2s;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background-color: #f9f9f9;
    color: var(--primary);
}

.custom-option.selected {
    background-color: var(--bg);
    /* Light background */
    color: var(--primary);
    font-weight: 600;
}

/* Mobile Bottom Nav - See unified styles below */

/* .nav-item styles moved to unified mobile-bottom-nav section below */

/* Center Search FAB */
.nav-item-center {
    position: relative;
    top: -20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    text-decoration: none;
}

.search-fab {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: var(--btn-text, white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: 0.3s;
    border: 4px solid white;
    position: absolute;
    top: -5px;
}

.nav-item-center.active .search-fab {
    background: var(--primary);
    box-shadow: none;
}

.nav-item-center:hover .search-fab {
    transform: translateY(-3px);
}

/* Scroll To Top - Modern */
.scroll-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: var(--primary);
    color: var(--btn-text, white);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: none;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: var(--z-sticky);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: 0.3s;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: none;
}

/* Footer Gap Fix */
body .site-footer {
    padding-bottom: 100px;
    /* Extra space for bottom nav */
}

/* Modal Premium */
#product-modal-content {
    animation: fadeUp 0.4s ease-out;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }



    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        margin: 10px;
        border-radius: 15px;
        height: 60vh;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-logo-circle {
        width: 80px;
        height: 80px;
    }

    .header-inner {
        padding: 0 15px;
        height: 60px;
    }

    /* .mobile-bottom-nav handled globally now */
    /* body padding handled globally now */
}

/* Favorite Button - Larger & Shared */
.fav-btn {
    position: absolute;
    top: 8px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #aaa;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.1);
    z-index: 5;
    line-height: 0;
}

.fav-btn.active {
    color: #ff4757;
    background: #fff;
}

.fav-btn:hover {
    transform: scale(1.1);
}

.modal-fav-btn {
    top: 8px;
    right: 8px;
    /* Top Right specifically for modal as requested */
    left: auto;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding-bottom: 50px;
}

/* Cart Redesign */
.cart-fixed-actions {
    position: fixed;
    bottom: 80px;
    /* Aligned with Bottom Nav top */
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
    z-index: var(--z-sticky);
    /* Below scroll-top/modal, above content */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
    min-height: 80px;
    /* Standardize height */
}

.cart-item-clean {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    margin-bottom: 0;
    /* Continuous list */
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    /* Separator */
    background: transparent;
    box-shadow: none;
}

.cart-item-clean:last-child {
    border-bottom: none;
}

/* .mobile-toggle default hidden handled above */


/* Default hidden */

/* CRITICAL FIX: Force SVG Icon Sizes */
.nav-item svg,
.mobile-toggle svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    display: block;
    margin: 0 auto;
}

/* Product Grid - Responsive (Min 2 cols on mobile) */
/* Product Grid defined earlier at line 405 */

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Force 2 Columns on Mobile */
@media (max-width: 600px) {

    .product-grid,
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(46, 204, 113, 0.95);
    backdrop-filter: blur(5px);
    color: white;
    padding: 10px 24px;
    border-radius: 30px;
    box-shadow: none;
    z-index: var(--z-toast);
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateX(-50%) translateY(-20px);
}

.toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Skeleton Loading - Unified & Fixed */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: #dbdbdb !important;
    /* Proper gray */
    background-image: linear-gradient(90deg, #dbdbdb 25%, #f0f0f0 50%, #dbdbdb 75%) !important;
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    position: relative;
    overflow: hidden;
    z-index: var(--z-normal);
}

/* .product-card-img.skeleton - See unified definition below */

/* The shimmer effect layer - optional if background-image above works, but nice to handle Overlay style */
.product-card-img::before,
.cat-img::before {
    /* Removing legacy shimmer to avoid double animation if .skeleton is used */
    content: none;
}

/* Ensure images cover the skeleton when loaded */
.product-card-img img,
.cat-img img {
    z-index: 2;
    position: relative;
    /* Removed background: #fff to prevent white box before load */
    background: transparent;
}

/* Bottom Sheet Modal */
/* Bottom Sheet Modal - Consolidated & Fixed */
.bottom-sheet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: none;
    align-items: flex-end;
    justify-content: center;

    /* Background Fade Transition */
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.5s ease;
}

.bottom-sheet-modal.active {
    display: flex;
}

.bottom-sheet-modal.visible {
    background-color: rgba(0, 0, 0, 0.5);
}

.bottom-sheet-content {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.1);

    /* Transform Transition */
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    /* Hint to browser for smoother animation */
}

/* Ensure transition works in both directions */
.bottom-sheet-modal.visible .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.bottom-sheet-body {
    overflow-y: auto;
    flex: 1;
    padding-bottom: 50px;
    /* Safe area */
}

.close-btn {
    background: #f0f0f0;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    cursor: pointer;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-sticky);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5px);
    transition: transform 0.3s ease-in-out;
    /* Smooth slide animation */
}

.mobile-bottom-nav.floating {
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: auto;
    border-radius: 20px;
    box-shadow: none;
    border: 1px solid #e0e0e0;
}

.mobile-bottom-nav.nav-hidden {
    transform: translateY(100%);
}

.mobile-bottom-nav.floating.nav-hidden {
    transform: translateY(calc(100% + 40px));
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
    color: #777;
    font-size: 0.7rem;
    text-decoration: none;
    transition: color 0.3s;
}

.mobile-cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: var(--btn-text, white);
    font-size: 0.7rem;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 1.5px solid white;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary);
}

.mobile-bottom-nav .nav-item span {
    display: block;
    margin-top: 0;
}

/* Search FAB (Center Button) */
.mobile-bottom-nav .nav-item-center {
    position: relative;
    margin-top: -30px;
}

.mobile-bottom-nav .search-fab {
    width: 60px;
    height: 60px;
    top: 0px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.mobile-bottom-nav .search-fab:active {
    transform: scale(0.95);
}

/* Footer Padding - merged into .site-footer above */

/* .copyright - merged into unified definition above */

.social-link {
    display: inline-flex;
    transition: transform 0.2s ease;
}

.social-link:active {
    transform: scale(0.85);
}

/* Hide on Desktop */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none;
    }

    .site-footer {
        padding-top: 60px;
        padding-bottom: 50px !important;
    }
}

/* Animated Mobile Toggle & Controls */
@media (max-width: 768px) {
    .mobile-controls {
        display: flex !important;
    }

    .mobile-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        /* Reduced width */
        height: 16px;
        /* Compact height */
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }

    .mobile-toggle .bar {
        width: 100%;
        height: 2px;
        /* Thinner bars */
        background: #333;
        border-radius: 10px;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        /* Bouncy transition */
    }

    /* Modern Untraditional Look */
    .mobile-toggle .bar:nth-child(2) {
        width: 70%;
        margin-right: auto;
    }

    /* Animation State - Smaller X */
    .mobile-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
        width: 100%;
    }

    .mobile-toggle.active .bar:nth-child(2) {
        opacity: 0;
        width: 0;
    }

    .mobile-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
        width: 100%;
    }

    /* Mobile Cart Icon */
    .mobile-cart-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        color: #333;
    }
}

/* Hero Entrance Animation */
@keyframes heroFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    opacity: 0;
    animation: heroFadeInUp 0.6s ease-out forwards;
}

/* body flexbox merged into main body rule above */

.site-main {
    flex: 1 0 auto;
}

/* =========================================
   Image Loading Animations
   ========================================= */

@keyframes zoomOutReveal {
    0% {
        /* transform: scale(1.15); Removed zoom out */
        opacity: 0;
    }

    100% {
        /* transform: scale(1); */
        opacity: 1;
    }
}

/* @keyframes spin defined above in Animations section */

/* Skeleton Wrapper with Spinner */
.product-card-img.skeleton {
    position: relative;
    background: #f7f7f7;
    overflow: hidden;
}

/* The Spinner */
.product-card-img.skeleton::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -15px;
    margin-left: -15px;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
    /* Uses theme color */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 2;
}

/* Ensure image takes up space but hidden initially */
.product-card-img.skeleton img {
    opacity: 0;
}

/* The Animation Class applied on load */
.fade-in-zoom {
    animation: zoomOutReveal 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Standard Modal Styles (Unified) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    overflow-y: auto;
    display: none;
    /* JS toggles display: flex */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    animation: fadeUp 0.3s ease-out;
    position: relative;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    border: 1px solid #eee;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: none !important;
    color: var(--text);
    transition: 0.3s;
}

.modal-close:hover {
    background: #f9f9f9;
    color: var(--primary);
    transform: rotate(90deg);
}

/* Footer Social Icons Custom Size */
.site-footer .social-link svg {
    width: 18px !important;
    height: 18px !important;
    transition: transform 0.2s;
}

.site-footer .social-link:hover svg {
    transform: scale(1.2);
}

/* =========================================
   Side Cart Drawer Styles
   ========================================= */
.side-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2500;
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s ease;
}

.side-cart {
    position: fixed;
    top: 0;
    right: 0;
    /* Fix alignment */
    transform: translateX(100%);
    /* Initially hidden */
    width: 380px;
    max-width: 90%;
    height: 100%;
    background: #fff;
    z-index: 2600;
    border-left: 1.5px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    will-change: transform;
    backface-visibility: hidden;
}

.side-cart.active {
    transform: translateX(0);
}

.side-cart-overlay.active {
    visibility: visible;
    opacity: 1;
}

.side-cart-header {
    padding: 20px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-cart-close {
    background: #f8f8f8;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.side-cart-close:hover {
    background: #eee;
    color: var(--primary);
}

.side-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.side-cart-footer {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #f5f5f5;
}

/* Cart Item in Side Drawer */
.side-cart-item {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid #fafafa;
    transition: background 0.2s;
}

.side-cart-item:hover {
    background: #fcfcfc;
}

.side-cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.side-cart-info {
    flex: 1;
}

.side-cart-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    line-height: 1.3;
}

.side-cart-details {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
}

.side-cart-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
}

.side-cart-actions {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.remove-item {
    color: #ff4757;
    background: #fff5f5;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: 0.2s;
}

.remove-item:hover {
    background: #ff4757;
    color: white;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f8f8;
    padding: 4px 8px;
    border-radius: 20px;
    direction: ltr;
}

.qty-minus,
.qty-plus {
    border: none;
    background: none;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.qty-val {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 15px;
    text-align: center;
}

/* Scrollbar for Side Cart */
.side-cart-content::-webkit-scrollbar {
    width: 5px;
}

.side-cart-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.side-cart-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.side-cart-content::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Button & Summary Refinements */
.btn {
    box-shadow: none !important;
}

#summary-items div,
#summary-items span {
    font-size: 0.82rem !important;
}

#summary-items img {
    width: 35px !important;
    height: 35px !important;
}

.cart-fixed-actions {
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05) !important;
}