/* =========================================================
   GLOBAL FONT (ONE SOURCE OF TRUTH)
   ========================================================= */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Apply everywhere */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #111827;
}

/* =========================================================
   ROOT VARIABLES (DESIGN TOKENS – SINGLE SOURCE OF TRUTH)
   ========================================================= */

:root {
    /* Brand */
    --brand-purple: #7c66f4;
    --primary-blue: #2563eb;

    /* Layout */
    --header-height: 112px;

    /* ===============================
       TYPOGRAPHY SCALE (AMAZON-LIKE)
       =============================== */
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-lg: 16px;

    /* Font weights */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
}

/* =========================================================
   GLOBAL BOX MODEL FIX (CRITICAL)
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* =========================================================
   STEP 2 – GLOBAL LAYOUT (DO NOT TOUCH)
   ========================================================= */


.header-root {
      overflow: visible;   /* 🔥 REQUIRED */
      z-index: 2000;
      position: relative;
}

footer {
    background: #f8f9fb;
}

body.menu-open {
    overflow: hidden;
}

/* 🔥 Hide sticky cart when mobile menu is open */
body.menu-open .sticky-cart-bar {
    display: none !important;
}

/* ===============================
   GLOBAL LAYOUT CONTRACT (FINAL)
   =============================== */

html, body {
    height: 100%;
    margin: 0;
}

body {
    background: #ffffff;
    overflow-x: hidden; /* 🔥 critical mobile fix */
}

/* Footer sticks to bottom */
footer {
    margin-top: auto;
    width: 100%;
}
/* =========================================================
   BRAND LOGO – ICON + TEXT (PRODUCTION FINAL)
   ========================================================= */

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

/* Logo icon */
.site-logo {
    height: 52px;
    width: auto;
    flex-shrink: 0;
}

/* Text container */
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

/* ===============================
   BRAND NAME (PROFESSIONAL)
   =============================== */

.brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    /* calm, authoritative color */
    color: #4338ca;

    position: relative;
}

/* subtle accent underline (brand-only) */
.brand-name {
    font-size: 21px;
    font-weight: 700;              /* confident, not loud */
    letter-spacing: 0.02em;        /* premium spacing */
    text-transform: uppercase;
    color: #4338ca;
    line-height: 1.1;
    white-space: nowrap;
}


/* optional tagline */
.brand-tagline {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    letter-spacing: 0.02em;
}


/* Brand should NEVER get nav underline */
.brand-logo::after,
.brand-logo a::after {
    display: none !important;
}
/* ===============================
   MOBILE BRAND TUNING
   =============================== */

@media (max-width: 768px) {

    .site-logo {
        height: 44px;
    }

    .brand-name {
         font-size: 18px;
         letter-spacing: 0.015em;
    }

    .brand-name::after {
        width: 28px;
        height: 2px;
    }

    .brand-tagline {
        font-size: 10px;
    }
}

/* =========================================================
   HEADER (UNCHANGED)
   ========================================================= */
/* =========================================================
   🔔 TOP PROMO / OFFER BAR (PRODUCTION)
   ========================================================= */

.top-promo {
    background: linear-gradient(90deg, #6d5dfc, #8b7bff);
    color: #ffffff;
    text-align: center;

    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;

    padding: 8px 16px;

    position: relative;
    z-index: 10010;

    box-shadow: 0 2px 6px rgba(0,0,0,0.15);

    /* 🔑 IMPORTANT — DO NOT BLOCK HEADER CLICKS */
    pointer-events: none;
}

.top-promo strong {
    color: #ffe066;
    font-weight: 700;
}

@keyframes promoGlow {
    0%   { text-shadow: 0 0 0 rgba(255,224,102,0); }
    50%  { text-shadow: 0 0 8px rgba(255,224,102,0.6); }
    100% { text-shadow: 0 0 0 rgba(255,224,102,0); }
}

.top-promo span {
    animation: promoGlow 3s ease-in-out infinite;
}

.site-navbar {
    background: linear-gradient(to right, #ffffff, #f6f3ff);
    border-bottom: 1px solid #eee;
}

/* =========================================================
   PROFESSIONAL HEADER LAYOUT (FIXED)
   ========================================================= */

.site-navbar {
    background: linear-gradient(to right, #ffffff, #f6f3ff);
    border-bottom: 1px solid #eee;
    width: 100%;
}

/* ===== MAIN HEADER ROW ===== */
.site-navbar {
position: sticky;
top: 0;
z-index: 10009;
background: #ffffff;
border-bottom: 1px solid #e5e7eb;
}

/* ===== SEARCH BAR ===== */
/* ===============================
   SEARCH – ALWAYS CENTERED
   =============================== */
.nav-search {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;     /* 🔥 forces true center */
}

.search-form {
display: flex;
border: 2px solid #febd69; /* Amazon orange */
border-radius: 6px;
overflow: hidden;
}


.search-form input {
flex: 1;
padding: 10px 12px;
font-size: 0.95rem;
border: none;
outline: none;
   min-width: 0;     /* 🔥 CRITICAL flexbox fix */
}
.search-form button {
    background: #febd69;
    border: none;
    width: 50px;
    font-size: 20px;
    cursor: pointer;
}

@media (max-width: 992px) {
    .search-form {
        border-radius: 8px;
    }

    .search-form input {
        padding: 12px 14px;
        font-size: 1rem;
    }
}

/* ===== CATEGORY BAR ===== */
.category-bar {
background: #232f3e; /* Amazon dark bar */
}


.category-container {
display: flex;
gap: 18px;
padding: 8px 16px;
overflow-x: auto;
}


.category-container a {
color: #ffffff;
font-size: 0.9rem;
}

@media (max-width: 768px) {
.nav-container {
grid-template-columns: auto 1fr auto;
}


.nav-search {
max-width: 100%;
}


.category-container {
gap: 14px;
font-size: 0.85rem;
}
}
/* =========================================================
   HEADER – AMAZON STYLE (FINAL)
   ========================================================= */

.site-navbar {
    background: linear-gradient(to right, #ffffff, #f6f3ff);
    border-bottom: 1px solid #eee;
    width: 100%;
}

/* AMAZON-STYLE FULL WIDTH HEADER */
/* ===============================
   DESKTOP HEADER GRID (LOCKED)
   =============================== */
.nav-container {
    width: 100%;
    padding: 12px 16px;

    display: grid;
    grid-template-columns: auto 1fr auto; /* 🔒 left | center | right */
    align-items: center;
    column-gap: 24px;
}



/* LEFT: logo + menu together */
.nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}


/* Menu */
.nav-links {
    display: flex;
    gap: 24px;
}

/* ===============================
   NAV MENU (SECONDARY)
   =============================== */

.nav-links a {
    font-size: 1rem;
    font-weight: 600;
    color: #7a74c9;   /* softer than brand */
    text-decoration: none;
    white-space: nowrap;
}

/* ===============================
   NAV MENU (SECONDARY)
   =============================== */

/* RIGHT: auth, cart, avatar */
.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

/* ===============================
   DESKTOP NAV LINKS – SIZE UPGRADE
   =============================== */
.nav-links a {
    font-size: 1.15rem;          /* ⬆ bigger */
    font-weight: 700;
    color: var(--brand-purple);
    text-decoration: none;
    white-space: nowrap;

    padding: 8px 4px;            /* ⬆ better click area */
    letter-spacing: 0.02em;      /* premium feel */
}


/* RIGHT */
.nav-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    color: var(--brand-purple);
    text-decoration: none;
}

.cart-link img {
    height: 28px;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--brand-purple);
    color: #fff;
    font-size: 0.7rem;
    border-radius: 50%;
    padding: 2px 6px;
}

/* ===============================
   AUTH LINKS – DESKTOP SIZE
   =============================== */
.auth-links a {
    font-size: 1.1rem;           /* ⬆ bigger */
    font-weight: 700;
    color: var(--brand-purple);
    text-decoration: none;

    padding: 8px 6px;
}


/* =========================================================
   USER MENU
   ========================================================= */


.avatar {
    width: 34px;
    height: 34px;
    background: var(--brand-purple);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    pointer-events: auto;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 44px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 9999;
}

.user-menu {
    position: relative;
    cursor: pointer;
    z-index: 3000; /* 🔥 REQUIRED */
}

/* REMOVE hover-based dropdown */
.user-menu:hover .user-dropdown-menu {
    display: none;
}

/* CLICK-based dropdown (JS controlled) */
.user-menu.open .user-dropdown-menu {
    display: block;
}

/* =========================================================
   USER DROPDOWN – FINAL POLISH (DESKTOP)
   ========================================================= */
.user-menu {
    position: relative;
    z-index: 20000;
}

.user-dropdown-menu {
      position: absolute;
      top: 110%;
      right: 0;
      min-width: 180px;
      background: #fff;
      border-radius: 8px;
      box-shadow: 0 12px 30px rgba(0,0,0,0.15);
      z-index: 20001;
      display: none;
}

/* Make sure nothing blocks clicks */
.user-dropdown-menu,
.user-menu button {
  pointer-events: auto;
}

/* Desktop: mobile elements must NOT intercept clicks */
@media (min-width: 769px) {
  .mobile-menu,
  .mobile-backdrop {
    pointer-events: none !important;
  }
}

.user-menu.open .user-dropdown-menu {
    display: block;
}

/* Dropdown items */
.user-dropdown-menu a,
.user-dropdown-menu button {
    width: 100%;
    padding: 10px 14px;

    font-size: 0.9rem;
    font-weight: 500;
    color: #111;

    background: none;
    border: none;
    text-align: left;
    cursor: pointer;

    display: block;
    align-items: center;
    gap: 10px;
}

/* Hover */
.user-dropdown-menu a:hover,
.user-dropdown-menu button:hover {
    background: #f3f4f6;
}


.dropdown-logout {
  color: #dc2626;
  font-weight: 600;
}

/* Divider */
.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 6px 0;
}

/* Logout emphasis */
.user-dropdown-menu button {
    color: #dc2626;
    font-weight: 600;
}

.header-root,
.site-navbar,
.nav-container,
.nav-right {
    overflow: visible !important;
}


/* =========================================================
   HAMBURGER + MOBILE MENU (UNCHANGED)
   ========================================================= */

/* =========================================================
   HAMBURGER
   ========================================================= */
/* 🔒 HIDDEN BY DEFAULT (DESKTOP + INITIAL LOAD) */
.hamburger {
    display: none;                /* ✅ KEY FIX */
    width: 48px;
    height: 48px;
    border-radius: 12px;

    background: linear-gradient(
        135deg,
        rgba(124,102,244,0.15),
        rgba(124,102,244,0.30)
    );

    border: none;
    cursor: pointer;

    align-items: center;
    justify-content: center;

    transition: background 0.25s ease;
}


.hamburger:hover {
    background: linear-gradient(
        135deg,
        rgba(124,102,244,0.25),
        rgba(124,102,244,0.45)
    );
}
.hamburger-icon line {
    stroke: var(--brand-purple);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition:
        transform 0.35s ease,
        opacity 0.25s ease;
    transform-origin: center;
}
/* When menu is open */
body.menu-open .hamburger-icon line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.menu-open .hamburger-icon line:nth-child(2) {
    opacity: 0;
}

body.menu-open .hamburger-icon line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 480px) {
    .hamburger {
        width: 50px;
        height: 50px;
    }

    .hamburger-icon {
        width: 28px;
        height: 28px;
    }
}



/* =========================================================
   MOBILE MENU (RIGHT DRAWER – FIXED)
   ========================================================= */
/* =========================================================
   MOBILE MENU – FORCE FULL VIEWPORT HEIGHT (FIX)
   ========================================================= */

/* Sticky cart BELOW mobile menu */
.sticky-cart-bar {
    z-index: 4000;
}



/* Lock body height when menu is open */
body.menu-open {
    height: 100vh;
    overflow: hidden;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: var(--brand-purple);
    color: #fff;
    z-index: 10010;
    transition:  right 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 24px rgba(0,0,0,0.25);
}



.mobile-menu.active {
    right: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(0);
}

/* ===== MENU HEADER ===== */

/* ===== MOBILE MENU HEADER (PROD MATCH) ===== */
.mobile-menu-header {
    background: #ffffff;
    padding: 14px 16px;
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-header img {
    height: 44px;
    width: auto;
}

.mobile-close {
    background: none;
    border: none;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    color: #111827;
}

/* ===== MENU LINKS ===== */

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.mobile-menu-links a {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 14px 0;
    text-decoration: none;
}

.mobile-menu-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 993px) {
    .mobile-menu,
    .mobile-backdrop {
        display: none !important;
    }
}

/* ===== AUTH ===== */

.mobile-auth {
    margin-top: 24px;
    padding: 20px;
    font-weight: 600;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.mobile-auth a {
    display: block;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    margin-top: 10px;
}

/* =========================================================
   BACKDROP (DIM PAGE)
   ========================================================= */

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   RESPONSIVE – HEADER (FIXED)
   ========================================================= */

@media (max-width: 992px) {

    /* Hide desktop-only items */
    .nav-links,
    .auth-links,
    .cart-link {
        display: none !important;
    }

    /* ✅ KEEP avatar visible on mobile */
    .user-menu {
        display: flex !important;
        align-items: center;
    }

      .nav-container {
            flex-wrap: wrap; /* 🔥 allows second row */
            row-gap: 10px;
        }
}


@media (max-width: 992px) {

    .nav-right {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        min-width: 48px;
    }

    .hamburger {
        display: flex !important;
        pointer-events: auto !important;
    }

}

/* =========================================================
   SHOP PAGE (PRODUCTION MATCH)
   ========================================================= */

.shop-page {
    background: #f6f7fb;
    padding: 24px 0 48px;
}

.shop-container {
    max-width: 1280px;
    margin: auto;
    padding: 24px;

    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;

    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
}

/* ===== SIDEBAR ===== */

.shop-sidebar {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

.shop-sidebar h6 {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    color: #111;
}

.shop-sidebar a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
}

.shop-sidebar a:hover,
.shop-sidebar a.active {
    background: #edf2ff;
    color: var(--primary-blue);
}

/* ===== CONTENT ===== */

.shop-content {
    display: flex;
    flex-direction: column;
}

/* ===== TOOLBAR ===== */

.shop-toolbar {
    background: #ffffff;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;

    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 18px;
}


.shop-toolbar-actions {
    display: flex;
    gap: 8px;
}

.shop-toolbar input,
.shop-toolbar select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* ===== PRODUCTS GRID ===== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

/* ===== PRODUCT CARD ===== */

.product-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-img {
    width: 100%;
    height: 190px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin-bottom: 10px;
    aspect-ratio: 1 / 1;       /* 🔥 FORCE SQUARE */
    background: #f5f5f5;
    border-radius: 12px;
}

.product-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.product-price {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.out-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 6px;
    border-radius: 6px;
}

/* ===== BUTTONS (FINAL FIX – LOGIN & LOGOUT SAFE) ===== */

.product-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Base button – applies to <a> and <button> */
.shop-btn {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    padding: 0;
    margin: 0;

    background: none;
    border: 1.5px solid transparent;

    text-decoration: none !important;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
}

/* VIEW */
.shop-btn-view {
    background: #ffffff;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* ADD TO CART */
.shop-btn-cart {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #ffffff;
}

/* Hover */
.shop-btn:hover {
    opacity: 0.95;
}


/* ===== PAGINATION ===== */

.pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination a {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
}

.pagination a.active {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

/* ===== MOBILE ===== */

.filter-toggle {
    display: none;
}

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

    .shop-page {
        padding: 16px 0 32px;
    }

    .filter-toggle {
        display: block;
        margin-bottom: 12px;
        padding: 8px 12px;
        border-radius: 8px;
        border: 1px solid #ddd;
        background: #fff;
    }

    .shop-sidebar {
        display: none;
    }

    .shop-sidebar.open {
        display: block;
    }
}

/* =========================================================
   AUTH PAGES (UNCHANGED)
   ========================================================= */

.auth-page {
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f7fb;
}

.auth-card {
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.auth-card-lg {
    max-width: 860px;
}

.auth-card h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.auth-card input,
.auth-card select,
.auth-card button {
    height: 44px;
    font-size: 1rem;
}


/* =========================================================
   BUTTON LINK RESET (SHOP)
   ========================================================= */

.shop-btn,
.shop-btn:link,
.shop-btn:visited {
    text-decoration: none !important;
}

.shop-btn-view,
.shop-btn-cart {
    text-decoration: none !important;
}


/* =========================================================
   USER DROPDOWN – PRO UI + FEATURES
   ========================================================= */

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

.notif-bell {
    position: relative;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--brand-purple);
}

.notif-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 7px;
    height: 7px;
    background: red;
    border-radius: 50%;
}

.user-dropdown-header {
    padding: 12px 16px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.role-badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: #dc2626;
    padding: 3px 8px;
    border-radius: 999px;
}

.logout-btn {
    color: #dc2626 !important;
    font-weight: 700;
}
/* =========================================================
   DROPDOWN COLOR NORMALIZATION (PRO LOOK)
   ========================================================= */

.user-dropdown-menu a,
.user-dropdown-menu button {
    color: #1f2937; /* slate-800 */
    font-weight: 500;
}

.user-dropdown-menu a span,
.user-dropdown-menu button span {
    color: inherit;
}

.user-dropdown-menu a:hover,
.user-dropdown-menu button:hover {
    background: #f1f5f9;
    color: var(--primary-blue);
}

/* Icons unified */
.user-dropdown-menu a::before,
.user-dropdown-menu button::before {
    opacity: 0.8;
}

/* Remove emoji color chaos */
.user-dropdown-menu a,
.user-dropdown-menu button {
    filter: grayscale(0.15);
}

/* Logout emphasis (only) */
.logout-btn {
    color: #dc2626 !important;
}

.logout-btn:hover {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

/* Dark mode dropdown */
body.dark .user-dropdown-menu a,
body.dark .user-dropdown-menu button {
    color: #e5e7eb;
}

body.dark .user-dropdown-menu a:hover,
body.dark .user-dropdown-menu button:hover {
    background: #1e293b;
}
/* =========================================================
   NOTIFICATION BELL (PROFESSIONAL)
   ========================================================= */

.notif-bell {
    position: relative;
    font-size: 18px;
    text-decoration: none;
    color: var(--brand-purple);
}

.notif-bell:hover {
    opacity: 0.85;
}

.notif-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

/* ===============================
   GLOBAL MOBILE SAFETY NET
   =============================== */


/* 🔒 FINAL MOBILE SAFETY NET */
@media (max-width: 768px) {

    .product-layout,
    .product-media,
    .product-details {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .product-image-wrapper,
    .product-thumbs {
        max-width: 100%;
        overflow-x: auto;
    }
}
/* =========================================================
   🔒 LAYOUT LOCK – DO NOT MODIFY
   ---------------------------------------------------------
   - Header spacing is controlled ONLY by .page-content
   - Never add margin/padding to header or pages
   - All pages MUST use .page-content
   ========================================================= */

.page-content {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;

    /* ✅ PRODUCTION spacing */
    padding: 24px 16px 32px;
}


/* ===============================
   PAGE WRAPPER (SAFE FLEX)
   =============================== */

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrapper > footer {
    margin-top: auto;
}

@media (max-width: 768px) {

    /* Prevent double horizontal padding */
    .page-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .shop-container {
        padding: 12px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* =========================================================
   MOBILE OVERFLOW GUARD (FINAL)
   ========================================================= */
@media (max-width: 768px) {
    body,
    .page-wrapper,
    .page-content,
    .shop-page,
    .shop-container {
        max-width: 100vw;
        overflow-x: hidden;
    }
}


/* =========================================================
   HEADER MOBILE WIDTH FIX (CRITICAL)
   ========================================================= */

/* Prevent children from forcing overflow */
img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

/* =========================================================
   HAMBURGER CLICK STACK FIX (CRITICAL)
   ========================================================= */
@media (max-width: 992px) {
    .site-navbar,
    .nav-container,
    .nav-right {
        position: relative;
        z-index: 10005;
         overflow: visible !important;
    }


    .hamburger {
        z-index: 10006;
        pointer-events: auto;
    }
}

@media (max-width: 992px) {
    .mobile-backdrop {
        z-index: 9998;
    }

    .mobile-menu {
        z-index: 10000;
    }

    .hamburger {
        z-index: 10006;
        pointer-events: auto;
    }
}

/* Swipe hint */
.mobile-menu {
    touch-action: pan-y;
}

@media (max-width: 992px) {

    .nav-left {
        gap: 12px;
        flex-shrink: 0;
    }

    .nav-search {
        flex: 1;
        min-width: 0;      /* 🔥 REQUIRED for flex shrink */
    }

    .nav-right {
        flex-shrink: 0;
    }
}

@media (max-width: 992px) {
    .hamburger {
        width: 40px;
        height: 40px;
        font-size: 22px;
        z-index: 10006;
    }
}

/* =========================================================
   HIDE HAMBURGER WHEN MOBILE MENU IS OPEN
   ========================================================= */

body.menu-open .hamburger {
    display: none !important;
}
body.menu-open {
    overflow: hidden;
}
/* =========================================================
   MOBILE MENU STACK FIX (CRITICAL)
   ========================================================= */


/* Keep hamburger clickable until menu opens */
body.menu-open .hamburger {
    display: none !important;
}

/* Ensure mobile menu is the ONLY top layer */
.mobile-menu {
    z-index: 11000;
}

.mobile-backdrop {
    z-index: 10900;
}

/* Prevent ghost text overlap */
.site-navbar,
.nav-container,
.nav-left,
.nav-right {
    transform: translateZ(0);
     overflow: visible !important;
}
/* Prevent side sections from stretching */
.nav-left,
.nav-right {
    white-space: nowrap;
}



/* ===============================
   AUTH PAGES (LOGIN / REGISTER)
   =============================== */

.auth-page {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: #f6f7fb;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

/* 🔥 IMPORTANT: Auth pages must not be width constrained */
.auth-page .auth-card {
    margin: 0 auto;
}

/* ===============================
   MOBILE FIX
   =============================== */

@media (max-width: 768px) {
    .auth-page {
        padding: 16px;
    }

    .auth-card {
        max-width: 100%;
        padding: 20px;
    }
}

/* ===============================
   MENU-OPEN SAFETY FOR AUTH
   =============================== */

/* Prevent mobile menu state from breaking login/register */
body.menu-open .auth-page {
    overflow: visible;
}

body.menu-open .auth-card {
    transform: none;
}
.auth-layout {
    max-width: 100% !important;
    padding: 0 !important;
}

/* ===============================
   MOBILE MENU – LOGOUT LINK
   =============================== */

.logout-form {
    margin: 0;
}

.logout-link {
    all: unset;                  /* remove button styles */
    display: block;
    width: 100%;
    padding: 14px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
}

/* Match other menu items hover */
.logout-link:hover {
    opacity: 0.85;
}
.mobile-admin-links {
    display: flex;
    flex-direction: column;
}

.mobile-admin-link {
    display: block;
}
/* =========================================================
   ADMIN PAGES — DISABLE STICKY FOOTER (CRITICAL)
   ========================================================= */

body.admin-page .page-wrapper {
    min-height: unset !important;
    display: block !important;
}

body.admin-page footer {
    margin-top: 0 !important;
}
/* =========================================================
   ADMIN PAGES — REMOVE GLOBAL PAGE-CONTENT PADDING
   ========================================================= */

body.admin-page .page-content {
    padding-bottom: 0 !important;
}

/* =========================================================
   📌 STICKY HEADER (AMAZON STYLE)
   ========================================================= */

/* Keep promo bar static */
.top-promo {
    position: relative;
    z-index: 10010;
}

/* Sticky navbar */
.site-navbar {
    position: sticky;
    top: 0;
    z-index: 10009;
    background: linear-gradient(to right, #ffffff, #f6f3ff);
}

/* Prevent layout jump when sticky */
.site-navbar::after {
    content: "";
    display: block;
    height: 1px;
}

/* =========================================================
   🎯 ACTIVE MENU UNDERLINE (DESKTOP)
   ========================================================= */

.nav-links a {
    position: relative;
    padding-bottom: 6px;
}

/* underline ONLY for menu links, NOT brand */
.nav-links > a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 3px;
    background: var(--brand-purple);
    border-radius: 999px;
    transition: width 0.25s ease;
}

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


/* =========================================================
   📱 MOBILE HEADER SPACING (PIXEL FIX)
   ========================================================= */

@media (max-width: 768px) {

    /* Navbar padding reduced */
    .nav-container {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    /* Logo size balance */
      .site-logo {
          height: 48px;   /* clear but compact */
      }

    /* Right side spacing */
    .nav-right {
        gap: 12px;
    }

    /* Hamburger alignment */
    .hamburger {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
}

/* ===============================
   USER DROPDOWN – FIX VISIBILITY
   =============================== */

.user-dropdown,
.profile-dropdown,
.avatar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 9999; /* 🔥 MUST be higher than header & hero */
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
@media (max-width: 992px) {

    /* 🔥 MOBILE HEADER = AMAZON MODE */
    .nav-container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 10px;
    }

    /* ROW 1: ☰ + LOGO */
    .nav-left {
        order: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
    }

    /* ROW 1: CART / LOGIN */
    .nav-right {
        order: 2;
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
    }

    /* ROW 2: SEARCH (FULL WIDTH) */
    .nav-search {
        order: 3;
        width: 100%;
        flex: 0 0 100%;
        margin-top: 4px;
    }
}


/* 🌙 Dark mode hamburger */
body.dark .hamburger {
    background: linear-gradient(
        135deg,
        rgba(124,102,244,0.25),
        rgba(124,102,244,0.45)
    );
}

body.dark .hamburger-icon line {
    stroke: #e5e7eb;
}
body.dark .hamburger:hover {
    background: linear-gradient(
        135deg,
        rgba(124,102,244,0.35),
        rgba(124,102,244,0.6)
    );
}

/* ===============================
   HOME PAGE AD BANNER (SAFE)
   =============================== */

.home-ad-banner {
    width: 100%;
    background: #fff;
    overflow: hidden;
    border-bottom: 1px solid #eee;
}

.home-ad-link {
    display: block;
    width: 100%;
    text-align: center;
}

.home-ad-link img {
    width: 100%;
    max-height: 160px;      /* ✅ KEY FIX */
    object-fit: cover;   /* prevents crop */
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .home-ad-link img {
        max-height: 70px;
    }
}

/* ===============================
   HOME ADS – SLIDE MODE (ACTIVE)
   =============================== */

#homeAdsContainer {
    position: relative;
    height: 44px;
    overflow: hidden;

    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px;

    display: flex;
    align-items: center;
}

/* Track that holds slides */
.ad-slide-track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Individual slide */
.ad-slide {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
    font-weight: 600;
    color: #ffffff;

    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.5s ease, opacity 0.4s ease;
}

/* Active slide */
.ad-slide.active {
    opacity: 1;
    transform: translateX(0);
}

/* Exit animation */
.ad-slide.exit-left {
    opacity: 0;
    transform: translateX(-100%);
}
/* ===============================
   ADMIN TOP NAV
   =============================== */

.admin-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
}

.admin-link {
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.admin-link:hover {
    background: rgba(37, 99, 235, 0.08);
}

.admin-link.add-ad {
    background: #2563eb;
    color: #fff;
}

.admin-link.add-ad:hover {
    background: #1e40af;
}
/* Ensure header is above promo banners */
.site-header,
.header,
header {
    position: relative;
    z-index: 2000;
}

/* Avatar dropdown must be on top */
.user-avatar,
.profile-menu,
.avatar-dropdown {
    position: relative;
    z-index: 2100;
}

.home-ad-banner:empty {
    display: none;
}

/* =========================================================
   🔒 ADMIN PAGES — HEADER CLICK FIX (FINAL)
   ========================================================= */

/* Lower admin content stack */
body:has(.admin-card) .container,
body:has(.admin-card) .admin-card,
body:has(.admin-card) table {
    position: relative;
    z-index: 1;
}

/* Force header ABOVE admin pages */
body:has(.admin-card) header,
body:has(.admin-card) .site-navbar,
body:has(.admin-card) .nav-container {
    position: relative;
    z-index: 12000 !important;
}

/* Avatar & dropdown must stay clickable */
body:has(.admin-card) .user-menu {
    position: relative;
    z-index: 12010 !important;
}

body:has(.admin-card) .user-dropdown-menu {
    position: absolute;
    z-index: 12020 !important;
}

/* =========================================================
   🔥 FIX: MOVE HAMBURGER TO RIGHT (MOBILE ONLY)
   ========================================================= */
@media (max-width: 992px) {

    /* Force nav row layout */
    .nav-container {
        display: flex;
        align-items: center;
    }

    /* Push hamburger to extreme right */
    .hamburger {
        margin-left: auto;
        order: 99;              /* ensure last item */
        z-index: 10020;
        font-size: 24px;
        background: none;
        border: none;
    }

    /* Ensure nav-right does NOT push it back */
    .nav-right {
        margin-left: 0 !important;
        order: 10;
    }
}

@media (max-width: 992px) {

    .nav-container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 10px;
    }

    /* ROW 1: LOGO (LEFT) */
    .nav-left {
        order: 1;
        flex: 1;
        min-width: 0;
    }

    /* ROW 1: BELL + AVATAR + HAMBURGER (RIGHT) */
    .nav-right {
        order: 2;
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
    }

    /* ROW 2: SEARCH FULL WIDTH */
    .nav-search {
        order: 3;
        width: 100%;
        flex: 0 0 100%;
        margin-top: 6px;
    }
}

/* ======================================================
   MOBILE HAMBURGER MENU – FINAL FIX (RIGHT SLIDE)
   ====================================================== */

/* Default: NEVER show mobile menu on desktop */
.mobile-menu,
.mobile-backdrop {
  display: none !important;
}

/* MOBILE ONLY */
@media (max-width: 768px) {

  .mobile-menu {
    display: block !important;
    position: fixed;
    top: 0;
    right: 0;              /* ✅ OPEN FROM RIGHT */
    left: auto;
    width: 85%;
    max-width: 340px;
    height: 100dvh;        /* ✅ modern viewport height */
    background: #7c66f4;
    z-index: 10010;

    /* Slide animation */
    transform: translateX(100%);
    transition: transform 0.3s ease;

    /* CONTENT FIX */
    overflow-y: auto;
    padding: 16px 18px 24px;
    box-sizing: border-box;
  }

  .mobile-menu.active {
    transform: translateX(0);
  }

  .mobile-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  body.menu-open {
    overflow: hidden;
    height: 100dvh;
  }
}

/* DESKTOP SAFETY – NEVER LOCK DESKTOP */
@media (min-width: 769px) {
  body.menu-open {
    overflow: auto !important;
    height: auto !important;
  }
}

/* Mobile menu link spacing */
.mobile-menu nav a {
  display: block;
  padding: 12px 0;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
}

.mobile-menu nav a + a {
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* Logout spacing */
.mobile-auth {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.25);
}

/* =========================================================
   🔥 FINAL AVATAR DROPDOWN STACK FIX (ABSOLUTE GUARANTEE)
   ========================================================= */

/* Ensure header creates proper stacking context */
.site-navbar {
  position: relative !important;
  z-index: 5000 !important;
  overflow: visible !important;
}

/* Avatar container */
.user-menu {
  position: relative !important;
  z-index: 6000 !important;
}

/* Dropdown must sit above EVERYTHING */
.user-dropdown-menu {
  position: absolute !important;
  top: 110%;
  right: 0;
  z-index: 99999 !important;  /* 🔥 extremely high */
  display: none;
}

/* JS toggle */
.user-menu.open .user-dropdown-menu {
  display: block !important;
}

/* Prevent hero / banners from blocking clicks */
.top-promo,
.category-bar,
.home-ad-banner,
.ad-slide,
.ad-slide-track {
  z-index: 1 !important;
  position: relative;
}

/* =========================================
   🔥 FORCE USER DROPDOWN TO FRONT
   ========================================= */

.user-dropdown-menu {
    position: absolute !important;
    top: 110% !important;
    right: 0 !important;

    display: none;

    min-width: 220px;
    max-height: 70vh;            /* ✅ allows long menus */
    overflow-y: auto;            /* ✅ enables scrolling */
    overflow-x: hidden;

    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);

    z-index: 100000 !important;
}

/* ===============================
   MOBILE MENU SECTIONS
   =============================== */

.mobile-section {
    margin-bottom: 24px;
}

.mobile-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.25);
}

/* Remove top border for first section */
.mobile-section:first-child .mobile-section-title {
    border-top: none;
    padding-top: 0;
}

/* Admin styling */
.admin-title {
    color: #ffe066;
}

.admin-section a {
    font-weight: 600;
}
.mobile-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 18px 0 8px;
    opacity: 0.7;
}

.mobile-section a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    text-decoration: none;
    color: #ffffff;
}

.mobile-section a + a {
    border-top: 1px solid rgba(255,255,255,0.15);
}

/*
===================================================
    user avatar drop down
===================================================*/


/* Dropdown items */
.dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #111;
    text-decoration: none;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

/* Space block */
.dropdown-spacing {
    height: 6px;
}

/* Divider line */
.dropdown-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 8px 0;
}

/* Logout button spacing */
.dropdown-logout {
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
}

.dropdown-logout:hover {
    background: #f3f4f6;
}
/* =========================================
   DESKTOP DROPDOWN – MATCH MOBILE STRUCTURE
   ========================================= */

.desktop-dropdown {
    min-width: 260px;
    max-height: 75vh;
    overflow-y: auto;
    padding: 16px 18px;
}

/* Sections */
.desktop-section {
    margin-bottom: 22px;
}

.desktop-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    opacity: 0.6;
}

/* Admin title highlight */
.desktop-section.admin-section .desktop-section-title {
    color: #dc2626;
}

/* Links */
.desktop-dropdown a {
    display: block;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
}

.desktop-dropdown a + a {
    border-top: 1px solid #f1f5f9;
}

/* Hover */
.desktop-dropdown a:hover {
    color: var(--primary-blue);
}

/* Logout */
.desktop-logout {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

.desktop-logout button {
    background: none;
    border: none;
    padding: 10px 0;
    width: 100%;
    text-align: left;
    font-weight: 700;
    color: #dc2626;
    cursor: pointer;
}

.desktop-logout button:hover {
    opacity: 0.8;
}
/* ===============================
   PROFESSIONAL BRANDING STYLE
   =============================== */

.logo-link {
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.85;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 0;
}

/* Logo Container */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.site-logo {
    height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Brand Text Container */
.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1;
}

/* Main Brand Name - ITALIC */
.brand-name {
    font-size: 22px;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.5px;
    color: #5b3df5;
    white-space: nowrap;
}

.brand-accent {
    font-weight: 600;
    font-style: italic;
    color: #5b3df5;
}

/* Tagline - ITALIC */
.brand-tagline {
    font-size: 11px;
    font-weight: 500;
    font-style: italic;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 2px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .brand-logo {
        gap: 12px;
    }

    .site-logo {
        height: 40px;
    }

    .brand-name {
        font-size: 18px;
    }

    .brand-tagline {
        font-size: 9px;
        letter-spacing: 1.2px;
    }
}

@media (max-width: 480px) {
    .site-logo {
        height: 36px;
    }

    .brand-name {
        font-size: 16px;
    }

    .brand-tagline {
        font-size: 8px;
    }
}


