/* ============================================================
   ETCHLY GLOBAL STYLES
   Shared across all pages: header, footer, buttons, avatar menu
   ============================================================ */

/* BASE & ETCHLY BRAND COLORS */
        :root {
            --bg: #0b0e12;
            --panel: #10151c;
            --muted: #9aa3b2;
            --hi: #f7fbff;
            --accent: #00A9E0;
            /* Etchly Blue */
            --warn: #F58220;
            /* Etchly Orange */
            --success: #28a745;
            --danger: #dc3545;
            --header-height: 90px;

            /* Light Mode Variables for consistency */
            --main-bg: #FFFFFF;
            --content-text: #0b0e12;
            --card-bg: #FFFFFF;
            --card-border: #e0e0e0;
            --light-panel: #f7f7f9;
            --light-border: #b6bcc4;
            --light-hi: #10151c;
            --light-muted: #5b667a;
            --light-grid: #d8dade;
            --theme-orange: #FF8C00;

            /* NEW DARK MODE FOR TOGGLING */
            --dark-bg: var(--bg);
            --dark-panel: var(--panel);
            --dark-hi: var(--hi);
            --dark-muted: var(--muted);
            --dark-grid: var(--grid);
            --dark-card-bg: var(--panel);
            --dark-card-border: #1f2733;
        }

        * {
            box-sizing: border-box
        }

        html,
        body {
            height: 100%
        }

        body {
            margin: 0;
            display: flex;
            flex-direction: column;
            /* Use Light Mode defaults */
            background: var(--main-bg);
            color: var(--content-text);
            font: 14px/1.4 system-ui, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
            transition: background 0.3s, color 0.3s;
            /* Enable smooth transition */
            position: relative;
            /* Container for absolute banner */
            min-height: 100vh;
        }

        /* NEW SPLASH SCREEN STYLES */
        #splashScreen {
            position: fixed;
            /* Fixed position over everything */
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: white;
            /* White page background */
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            /* Higher than everything else */
            opacity: 1;
            /* Start visible */
            transition: opacity 1.5s ease-out;
            /* The fade-out transition */
        }

        #splashScreen.hidden {
            opacity: 0;
            /* Using pointer-events: none is crucial to allow clicking content underneath */
            pointer-events: none;
        }

        /* This style ensures the rest of the body content is hidden until the splash screen is ready to fade */
        body.loading {
            overflow: hidden;
            /* Prevent scrolling during splash screen */
        }

        
/* HEADER STYLES */
        header {
            height: var(--header-height);
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: linear-gradient(180deg, var(--light-panel), var(--main-bg));
            border-bottom: 1px solid var(--card-border);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
            transition: background 0.3s, border-bottom 0.3s, box-shadow 0.3s;
            position: relative;
            z-index: 2;
        }

        header .brand {
            display: flex;
            align-items: center;
        }

        header .brand a {
            display: flex;
            align-items: center;
        }

        header .brand img {
            height: 72px;
            width: auto;
            border-radius: 8px;
            object-fit: contain;
        }

        /* Hide mobile burger on desktop */
        .mobile-burger {
            display: none;
        }

        header .btns {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: nowrap;
        }

        /* Hide mobile header buttons on desktop */
        .mobile-header-btns {
            display: none;
        }

        .btn {
            appearance: none;
            border: 1px solid var(--card-border);
            background: var(--card-bg);
            color: var(--content-text);
            padding: 10px 18px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9em;
            text-decoration: none;
            display: inline-block;
            white-space: nowrap;
            transition: all 0.2s;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }

        .btn:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        header .btn {
            border: 1px solid var(--card-border);
            background: var(--card-bg);
            color: var(--content-text);
        }

        header .btn:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        #startNewDesignBtn {
            background: var(--theme-orange);
            border-color: var(--theme-orange);
            color: #fff;
            font-weight: 700;
        }

        #startNewDesignBtn:hover {
            background: #e07000;
            border-color: #e07000;
            color: #fff;
        }

        /* View Cart button */
        #viewCartBtn {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
            font-weight: 700;
            padding: 10px 18px;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            position: relative;
        }

    /* Cart page - Back to Designer = teal, Template Store = outlined */
    #backToDesignerBtn, #backToCartBtn {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
            font-weight: 700;
        }
    #backToDesignerBtn:hover, #backToCartBtn:hover {
            background: #0090c0;
            border-color: #0090c0;
            color: #fff;
        }
    #templateStoreBtn {
            background: var(--theme-orange);
            border-color: var(--theme-orange);
            color: #fff;
            font-weight: 700;
        }
    #templateStoreBtn:hover {
            background: #e07000;
            border-color: #e07000;
            color: #fff;
        }

    /* Sign Up / Login button - outlined teal */
    #loginSignupBtn {
            background: transparent;
            border: 1px solid var(--accent);
            color: var(--accent);
            font-weight: 600;
        }
    #loginSignupBtn:hover {
            background: var(--accent);
            color: #fff;
        }

    /* Contact Us button - outlined */
    #viewContactBtn {
            background: transparent;
            border: 1px solid var(--card-border);
            color: var(--content-text);
        }
    #viewContactBtn:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        #viewCartBtn:hover {
            background: #0090c0;
            border-color: #0090c0;
            color: #fff;
        }

        /* Contact Us Button */
        .btn-contact,
        header .btn-contact {
            background: var(--accent) !important;
            border-color: var(--accent) !important;
            color: #fff !important;
            font-weight: 700;
        }

        .btn-contact:hover,
        header .btn-contact:hover {
            background: #0090c0 !important;
            border-color: #0090c0 !important;
            color: #fff !important;
        }
        
        /* Cart Badge Styles */
        .cart-badge {
            background: var(--warn);
            color: #fff;
            font-size: 11px;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: 10px;
            min-width: 18px;
            text-align: center;
            margin-left: 4px;
        }
        
        .cart-badge:empty,
        .cart-badge[data-count="0"] {
            display: none;
        }

        /* Wishlist Button Styles */
        #viewWishlistBtn {
            background: transparent;
            border-color: #ff6b81;
            color: #ff6b81;
            font-weight: 700;
        }

        #viewWishlistBtn:hover {
            background: #ff6b81;
            color: white;
        }

        /* Wishlist Badge Styles */
        .wishlist-badge {
            background: #ff6b81;
            color: #fff;
            font-size: 11px;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: 10px;
            min-width: 18px;
            text-align: center;
            margin-left: 2px;
        }
        
        .wishlist-badge:empty,
        .wishlist-badge[data-count="0"] {
            display: none;
        }

        
/* AVATAR MENU FIX (Z-INDEX IS INHERITED FROM HEADER) */
        .account-menu-container {
            position: relative;
            display: inline-block;
            margin-left: 8px;
            z-index: 100;
        }

        #accountMenu {
            display: none;
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 5px;
            min-width: 200px;
            border-radius: 10px;
            border: 1px solid var(--card-border);
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            overflow: hidden;
            background: var(--light-panel);
            border: 1px solid var(--card-border);
            border-radius: 12px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            z-index: 101;
            min-width: 200px;
            padding: 8px 0;
            transition: all 0.3s;
        }

        .account-menu-item {
            display: block;
            padding: 10px 15px;
            color: var(--light-hi);
            text-decoration: none;
            cursor: pointer;
        }

        .account-menu-item:hover {
            background: var(--light-grid);
        }

        #signOutMenuItem, #signOutMenuItemMenu {
            color: var(--danger);
            border-top: 1px solid var(--card-border);
            margin-top: 5px;
            padding-top: 10px;
        }

        #signOutMenuItem:hover, #signOutMenuItemMenu:hover {
            background: #fcebeb;
        }

        #userAvatarContainer {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 42px;
            width: 42px;
            border-radius: 50%;
            background: var(--light-panel);
            cursor: pointer;
            display: none;
        }

        #headerAvatar {
            height: 40px;
            width: 40px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--accent);
        }

        
/* THEME SWITCH STYLES (unchanged from last revision) */
        .theme-switch-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 15px;
            color: var(--light-muted);
            border-top: 1px solid var(--card-border);
            margin-top: 5px;
            padding-top: 10px;
        }

        .switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--light-border);
            transition: .4s;
            border-radius: 24px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 4px;
            bottom: 4px;
            background-color: var(--light-hi);
            transition: .4s;
            border-radius: 50%;
        }

        input:checked+.slider {
            background-color: var(--accent);
        }

        input:checked+.slider:before {
            transform: translateX(20px);
        }


        
/* TOAST NOTIFICATIONS */
        .toast-container {
            position: fixed;
            top: 100px;
            right: 20px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }

        .toast {
            background: var(--light-panel);
            border: 1px solid var(--card-border);
            border-left: 4px solid var(--success);
            border-radius: 8px;
            padding: 12px 16px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            display: flex;
            align-items: center;
            gap: 10px;
            max-width: 320px;
            pointer-events: auto;
            animation: toastSlideIn 0.3s ease;
        }

        .toast.success { border-left-color: var(--success); }
        .toast.error { border-left-color: var(--danger); }
        .toast.info { border-left-color: var(--accent); }

        .toast-icon { font-size: 18px; }
        .toast-message { flex: 1; color: var(--content-text); font-size: 13px; }
        .toast-close {
            background: none;
            border: none;
            color: var(--light-muted);
            cursor: pointer;
            font-size: 18px;
            padding: 0;
        }

        @keyframes toastSlideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        @keyframes toastSlideOut {
            from { transform: translateX(0); opacity: 1; }
            to { transform: translateX(100%); opacity: 0; }
        }

        /* CART BADGE ANIMATION */
        .cart-badge.bump {
            animation: cartBump 0.4s ease;
        }

        @keyframes cartBump {
            0% { transform: scale(1); }
            50% { transform: scale(1.4); }
            100% { transform: scale(1); }
        }

        
/* ============================================= */
        /* TRUST BADGES SECTION */
        /* ============================================= */

        .trust-badges-section {
            background: var(--accent);
            padding: 25px 0;
        }

        .trust-badges-container {
            width: 90%;
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
            gap: 20px;
        }

        .trust-badge {
            display: flex;
            align-items: center;
            gap: 10px;
            color: #fff;
        }

        .trust-icon {
            font-size: 1.8em;
        }

        .trust-text {
            font-weight: 600;
            font-size: 0.95em;
        }

        /* ============================================= */
        /* ENHANCED FOOTER */
        /* ============================================= */

        .site-footer {
            background: #1a1f27;
            color: #a0a8b4;
            padding: 0;
        }

        .footer-content {
            width: 90%;
            max-width: 1400px;
            margin: 0 auto;
            padding: 50px 0 30px;
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr;
            gap: 40px;
        }

        .footer-section h4 {
            color: #fff;
            font-size: 1.1em;
            margin: 0 0 20px 0;
            font-weight: 600;
        }

        .footer-about p {
            line-height: 1.7;
            font-size: 0.9em;
        }

        .footer-social {
            display: flex;
            gap: 12px;
            margin-top: 20px;
        }

        .social-icon {
            width: 40px;
            height: 40px;
            background: rgba(255,255,255,0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            transition: all 0.2s;
        }

        .social-icon:hover {
            background: var(--accent);
            transform: translateY(-3px);
        }

        .footer-links ul,
        .footer-support ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .footer-links li,
        .footer-support li {
            margin-bottom: 12px;
        }

        .footer-links a,
        .footer-support a {
            color: #a0a8b4;
            text-decoration: none;
            font-size: 0.9em;
            transition: color 0.2s;
        }

        .footer-links a:hover,
        .footer-support a:hover {
            color: var(--accent);
        }

        .payment-icons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .payment-icon {
            background: #fff;
            border-radius: 4px;
            padding: 5px 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .footer-bottom {
            border-top: 1px solid rgba(255,255,255,0.1);
            padding: 20px 0;
            font-size: 0.85em;
        }

        .footer-bottom-content {
            width: 90%;
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
        }

        .footer-bottom p {
            margin: 0;
            text-align: center;
        }

        .footer-bottom a {
            color: var(--accent);
            text-decoration: none;
        }

        .footer-bottom a:hover {
            text-decoration: underline;
        }

        @media (max-width: 600px) {
            .footer-bottom-content {
                flex-direction: column;
                text-align: center;
            }

            .footer-bottom p {
                text-align: center;
            }
        }

        
/* ============================================= */
        /* BACK TO TOP BUTTON */
        /* ============================================= */

        .back-to-top {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: var(--accent);
            color: #fff;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(0, 169, 224, 0.4);
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px);
            transition: all 0.3s ease;
            z-index: 9999;
        }

        .back-to-top.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .back-to-top:hover {
            background: #0090c0;
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(0, 169, 224, 0.5);
        }

        .back-to-top:active {
            transform: translateY(0);
        }

        
/* DARK MODE OVERRIDES */
        body.dark-mode {
            background: var(--dark-bg);
            color: var(--dark-hi);
        }

        body.dark-mode .toast {
            background: var(--dark-panel);
            border-color: var(--dark-card-border);
        }

        body.dark-mode .toast-message {
            color: var(--dark-hi);
        }

        body.dark-mode #templateSort {
            background-color: var(--dark-panel);
            border-color: var(--dark-card-border);
            color: var(--dark-hi);
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        }

        body.dark-mode #templateSort option {
            background: var(--dark-panel);
            color: var(--dark-hi);
        }

        body.dark-mode header {
            background: linear-gradient(180deg, var(--dark-panel), var(--dark-bg));
            border-bottom: 1px solid var(--dark-card-border);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
        }

        body.dark-mode header .btn {
            border: 1px solid var(--dark-card-border);
            background: var(--dark-panel);
            color: var(--dark-hi);
        }

        body.dark-mode header .btn:hover {
            border-color: var(--dark-muted);
            background: #1f2631;
        }

        body.dark-mode #startNewDesignBtn {
            color: var(--dark-hi);
        }

        /* NEW: Dark Mode View Cart Button */
        body.dark-mode #viewCartBtn {
            color: var(--dark-hi);
        }

        /* Dark Mode Contact Button */
        body.dark-mode .btn-contact {
            color: #fff;
        }

        /* Dark Mode Overrides for Category Bar (MODIFIED) */
        body.dark-mode .category-nav-container {
            background: var(--accent);
            border-bottom: 1px solid var(--dark-card-border);
        }

        body.dark-mode .category-nav-item {
            color: var(--dark-hi);
            /* White text */
        }

        body.dark-mode .category-nav-item:hover {
            color: var(--content-text);
            /* Dark text on orange background */
            background: var(--warn);
            /* Use dark mode orange for hover */
        }

        body.dark-mode .category-nav-item.active-category {
            color: var(--content-text);
            /* Dark text on orange background */
            background: var(--warn);
            /* Use dark mode orange for active */
            box-shadow: inset 0 -4px 0 rgba(255, 255, 255, 0.2);
        }

        /* Dark Mode overrides for template card buttons */
        body.dark-mode #useTemplateBtn {
            color: var(--dark-hi);
        }

        body.dark-mode #addToCartBtn {
            color: var(--dark-hi);
        }

        body.dark-mode #accountMenu {
            background: var(--dark-panel);
            border: 1px solid var(--dark-card-border);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
        }

        body.dark-mode .account-menu-item {
            color: var(--dark-hi);
        }

        body.dark-mode .account-menu-item:hover {
            background: #1f2631;
        }

        body.dark-mode #signOutMenuItem {
            border-top: 1px solid var(--dark-card-border);
        }

        body.dark-mode #signOutMenuItem:hover {
            background: #250f11;
        }

        body.dark-mode .sidebar {
            background: var(--dark-panel);
            border: 1px solid var(--dark-card-border);
        }

        body.dark-mode .sidebar h3 {
            color: var(--dark-hi);
            border-bottom: 1px solid var(--dark-card-border);
        }

        body.dark-mode .sidebar label {
            color: var(--dark-muted);
        }

        body.dark-mode .sidebar input[type="text"],
        body.dark-mode .sidebar select {
            background: var(--dark-bg);
            color: var(--dark-hi);
            border: 1px solid #2e3947;
        }

        body.dark-mode .search-controls {
            border-bottom: 1px solid var(--dark-card-border);
        }

        body.dark-mode .search-controls select {
            background: var(--dark-panel);
            color: var(--dark-hi);
        }

        body.dark-mode .template-card {
            background: var(--dark-card-bg);
            border: 1px solid var(--dark-card-border);
        }

        body.dark-mode .template-preview {
            background: var(--dark-panel);
            border: 1px solid var(--dark-card-border);
        }

        body.dark-mode .template-info h3 {
            color: var(--dark-hi);
        }

        body.dark-mode .template-info .specs,
        body.dark-mode .template-info .description {
            color: var(--dark-muted);
        }

        .theme-switch-container {
            border-top: 1px solid var(--card-border);
            margin-top: 5px;
            padding-top: 10px;
        }

        body.dark-mode .theme-switch-container {
            color: var(--dark-muted);
            border-top: 1px solid var(--dark-card-border);
        }

        body.dark-mode .slider {
            background-color: #3c4656;
        }

        body.dark-mode .slider:before {
            background-color: var(--dark-hi);
        }

        
/* NEW FOOTER STYLES */
        footer {
            width: 100%;
            padding: 15px 0;
            background: var(--light-panel);
            color: var(--light-muted);
            text-align: center;
            font-size: 0.85rem;
            border-top: 1px solid var(--card-border);
            margin-top: auto;
            /* Push footer to the bottom */
            z-index: 5;
            /* Ensure it appears over the banner if scrolling far down */
        }

        footer a {
            color: var(--accent);
            /* Etchly Blue */
            text-decoration: none;
            font-weight: 600;
        }

        footer a:hover {
            text-decoration: underline;
        }

        body.dark-mode footer {
            background: var(--dark-panel);
            border-top: 1px solid var(--dark-card-border);
            color: var(--dark-muted);
        }

        /* Custom Prompt/Modal Styles */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            /* Initially hidden */
            justify-content: center;
            align-items: center;
            z-index: 1000;
            /* Ensure it is on top of everything */
        }

        #customPromptBox {
            background: var(--main-bg);
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
            max-width: 400px;
            width: 90%;
            text-align: center;
            border: 1px solid var(--card-border);
            color: var(--content-text);
        }

        #customPromptMessage {
            font-size: 1.1em;
            margin-bottom: 25px;
            line-height: 1.5;
            color: var(--content-text);
        }

        #customPromptButtons {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 20px;
        }

        .custom-prompt-btn {
            appearance: none;
            border: 1px solid var(--card-border);
            background: #f0f0f0;
            color: var(--content-text);
            padding: 10px 20px;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            min-width: 80px;
            transition: all 0.2s;
        }

        .custom-prompt-btn:hover {
            filter: brightness(0.95);
        }

        /* Styling for Yes/No buttons */
        #promptYesBtn {
            background: var(--accent);
            /* Blue */
            border-color: var(--accent);
            color: var(--hi);
            /* White Text */
        }

        #promptNoBtn,
        #promptCancelBtn {
            background: #e0e0e0;
            border-color: #c0c0c0;
            color: var(--content-text);
        }

        /* Dark Mode Overrides for Modal */
        body.dark-mode #customPromptBox {
            background: var(--dark-panel);
            border: 1px solid var(--dark-card-border);
            color: var(--dark-hi);
        }

        body.dark-mode #customPromptMessage {
            color: var(--dark-hi);
        }

        body.dark-mode .custom-prompt-btn {
            background: var(--dark-panel);
            border: 1px solid var(--dark-card-border);
            color: var(--dark-hi);
        }

        body.dark-mode #promptYesBtn {
            background: var(--accent);
            border-color: var(--accent);
            color: var(--hi);
        }

        body.dark-mode #promptNoBtn,
        body.dark-mode #promptCancelBtn {
            background: #2b3340;
            border-color: #3c4656;
            color: var(--dark-hi);
        }

        
/* ===== SLIDE MENU (matches designermob.html) ===== */
        .mobile-menu-btn {
            display: none;
            width: 36px;
            height: 36px;
            border: none;
            border-radius: 8px;
            background: var(--page-bg);
            color: var(--content-text);
            font-size: 16px;
            cursor: pointer;
            align-items: center;
            justify-content: center;
        }

        body.dark-mode .mobile-menu-btn {
            background: var(--dark-bg);
            color: var(--dark-hi);
        }

        .menu-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 99998;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s;
        }

        .menu-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        .slide-menu {
            position: fixed;
            top: 0;
            right: -300px;
            width: 280px;
            max-width: 85vw;
            height: 100%;
            background: #fff;
            z-index: 99999;
            display: flex;
            flex-direction: column;
            transition: right 0.3s ease;
            box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
        }

        body.dark-mode .slide-menu {
            background: var(--dark-panel);
        }

        .slide-menu.show {
            right: 0;
        }

        .menu-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 15px;
            border-bottom: 1px solid var(--card-border);
        }

        body.dark-mode .menu-header {
            border-bottom-color: var(--dark-card-border);
        }

        .menu-user {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .menu-avatar {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--accent);
        }

        .menu-user-details {
            display: flex;
            flex-direction: column;
        }

        .menu-user-name {
            font-weight: 600;
            font-size: 15px;
            color: var(--content-text);
        }

        body.dark-mode .menu-user-name {
            color: var(--dark-hi);
        }

        .menu-user-email {
            font-size: 12px;
            color: var(--muted-text);
            max-width: 150px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        body.dark-mode .menu-user-email {
            color: var(--dark-muted);
        }

        .menu-close {
            width: 36px;
            height: 36px;
            border: none;
            border-radius: 50%;
            background: var(--page-bg);
            color: var(--content-text);
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        body.dark-mode .menu-close {
            background: var(--dark-bg);
            color: var(--dark-hi);
        }

        .menu-nav {
            flex: 1;
            overflow-y: auto;
            padding: 10px 0;
        }

        .menu-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 20px;
            color: var(--content-text);
            text-decoration: none;
            font-size: 15px;
            transition: background 0.2s;
        }

        body.dark-mode .menu-item {
            color: var(--dark-hi);
        }

        .menu-item:active {
            background: var(--page-bg);
        }

        body.dark-mode .menu-item:active {
            background: var(--dark-bg);
        }

        .menu-item i {
            width: 20px;
            text-align: center;
            color: var(--accent);
        }

        .menu-divider {
            height: 1px;
            background: var(--card-border);
            margin: 10px 20px;
        }

        body.dark-mode .menu-divider {
            background: var(--dark-card-border);
        }

        .menu-footer {
            padding: 15px 20px;
            border-top: 1px solid var(--card-border);
        }

        body.dark-mode .menu-footer {
            border-top-color: var(--dark-card-border);
        }

        .theme-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: var(--content-text);
            font-size: 14px;
        }

        body.dark-mode .theme-toggle {
            color: var(--dark-hi);
        }

        .toggle-switch {
            position: relative;
            width: 50px;
            height: 26px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background: var(--card-border);
            border-radius: 26px;
            transition: 0.3s;
        }

        .toggle-slider:before {
            content: "";
            position: absolute;
            height: 20px;
            width: 20px;
            left: 3px;
            bottom: 3px;
            background: white;
            border-radius: 50%;
            transition: 0.3s;
        }

        .toggle-switch input:checked + .toggle-slider {
            background: var(--accent);
        }

        .toggle-switch input:checked + .toggle-slider:before {
            transform: translateX(24px);
        }

        
/* ======================================================= */
        /* == RESPONSIVE WEB DESIGN (RWD) STYLES FOR MOBILE/TABLET == */
        /* ======================================================= */
        @media (max-width: 1000px) {

            /* HEADER ADJUSTMENTS - Stack logo above buttons */
            header {
                display: flex;
                flex-direction: column;
                align-items: center;
                height: auto;
                padding: 10px 15px;
                gap: 10px;
            }

            /* stickyNavStack handles all sticky positioning */

            header .brand {
                width: 100%;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }

            header .brand img {
                height: 50px;
            }

            /* Show burger in top right on mobile */
            .mobile-burger {
                display: flex;
                width: 44px;
                height: 44px;
                padding: 0;
                align-items: center;
                justify-content: center;
                background: var(--panel);
                border: 1px solid var(--border);
                border-radius: 8px;
                font-size: 20px;
                color: var(--hi);
                cursor: pointer;
            }

            /* Hide desktop buttons on mobile */
            header .btns {
                display: none;
            }

            /* Show mobile menu button */
            .mobile-menu-btn {
                display: flex;
            }

            /* Mobile header buttons row - centered below logo */
            .mobile-header-btns {
                display: flex;
                gap: 8px;
                align-items: center;
                justify-content: center;
                width: 100%;
            }

            .mobile-header-btns .btn {
                padding: 10px 14px;
                font-size: 13px;
                border-radius: 8px;
                white-space: nowrap;
            }

            .mobile-header-btns .btn-menu {
                width: 44px;
                height: 44px;
                padding: 0;
                display: flex;
                align-items: center;
                justify-content: center;
                background: #e9ebf0;
                border: 1px solid #d1d5db;
                color: #374151;
                font-size: 18px;
            }

            body.dark-mode .mobile-header-btns .btn-menu {
                background: #1f2937;
                border-color: #374151;
                color: #f3f4f6;
            }

            .mobile-header-btns .btn-create {
                background: var(--accent);
                color: white;
                border: none;
            }

            .mobile-header-btns .btn-wishlist {
                background: #fff;
                border: 1px solid #e5e7eb;
                color: #ef4444;
                padding: 10px 14px;
                min-width: 44px;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            body.dark-mode .mobile-header-btns .btn-wishlist {
                background: var(--dark-panel);
                border-color: var(--dark-card-border);
            }

            .mobile-header-btns .btn-cart {
                background: var(--accent);
                color: white;
                padding: 10px 14px;
                border: none;
                min-width: 44px;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .mobile-header-btns .btn-login {
                background: var(--theme-orange);
                color: white;
                padding: 10px 14px;
                border: none;
                min-width: 44px;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 16px;
            }

            
