/* ================== VARIABLES (إذا ما عندكش) ================== */
:root{
  --bg:#ffffff;
  --primary:#2f3e2f;
  --accent:#ff5000;
  --danger:#e11d48;
  --muted:#6b7280;
  --white:#fff;
  --shadow:0 10px 30px rgba(0,0,0,.08);
  --max-width:1400px;
  --gutter:8px;
}

/* ================== HEADER ================== */
.store-header{
  width:100%;
  background:var(--bg);
  position:sticky;
  top:0;
  z-index:2000; /* فوق overlay */
  border-bottom:1px solid rgba(0,0,0,.04);
}

.header-inner{
  max-width:var(--max-width);
  height: 65px;
  margin:0 auto;
  padding:10px 20px; /* أفضل من calc باش يكون ثابت */
  display:flex;
  align-items:center;
  justify-content:space-evenly; /* أهم تعديل */
  gap:8px; /* نقصناها شوية */
}

/* ================== LEFT ================== */
.header-left{
  display:flex;
  align-items:center;
  gap:24px;
}

/* logo */
/* ================== BRAND (FIXED + ALIEXPRESS STYLE) ================== */
.brand{
  display:flex;
  align-items:center;
  gap:10px; /* نقصنا المسافة باش يولي compact */
  text-decoration:none;
  transition:transform .2s ease;
}

/* hover خفيف */
.brand:hover{
  transform:scale(1.05);
}

/* LOGO */
.brand-logo{
  width:180px; /* كان 150 → صغرناه باش يولي احترافي */
  height:auto;
  margin-top: 12px;
  object-fit:contain; /* أفضل من cover للوغو */
  background:transparent; /* كان none */
  box-shadow:none; /* نحينا shadow باش يولي clean */
}


/* nav */
.main-nav{
  display:flex;
  justify-content: center;
  align-items:center;
  gap:16px;
}
.main-nav > a{
  border:none;
  background:#fff;
  color:#25322a;
  text-decoration:none;
  font-weight:600;
  padding:10px 16px;
  border-radius:999px;
  cursor:pointer;
  transition:.25s ease;
}
.categories-btn{
  border:none; /* نحينا border */
  background:#fff;
  color:#25322a;
  font-weight:600;
  padding:10px 16px;
  border-radius:999px;
  cursor:pointer;
  transition:.25s ease;
}

/* hover orange */
.categories-btn:hover{
  background:var(--accent);
  color:#fff;
}
.categories-wrapper.open .categories-btn{
  background:var(--accent);
  color:#fff;
}
/* ================== SEARCH ================== */
/* ================== SEARCH FIX ================== */
.header-search{
  position:relative;
  flex:1;
  max-width:520px;
  display:flex;
  align-items:center;
  z-index:50;
}

.header-search input{
  flex:1;
  min-width:0;
  padding:10px 14px;
  border:2px solid #111;
  border-right:none;
  border-radius:30px 0 0 30px;
  font-size:14px;
  outline:none;
}

.header-search input:focus{
  border-color:var(--accent);
}

.header-search button{
  padding:0 18px;
  height:44px;
  border:2px solid #111;
  background:#111;
  color:#fff;
  border-radius:0 30px 30px 0;
  cursor:pointer;
}

.search-suggestions{
  display:none;
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  background:#fff;
  border-radius:16px;
  box-shadow:0 14px 35px rgba(0,0,0,.14);
  z-index:99999;
  padding:8px 0;
  max-height:430px;
  overflow-y:auto;
}

.search-suggestions.active{
  display:block;
}

.suggest-item{
  display:grid;
  grid-template-columns:28px 1fr 46px 24px;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  text-decoration:none;
  color:#222;
  transition:.2s ease;
}

.suggest-item:hover{
  background:#f6f6f6;
}

.suggest-info strong{
  display:block;
  font-size:15px;
  font-weight:700;
}

.suggest-info span{
  display:block;
  font-size:13px;
  color:#777;
  margin-top:3px;
}

.suggest-item img{
  width:42px;
  height:42px;
  object-fit:cover;
  border-radius:10px;
}

.suggest-empty{
  padding:18px;
  color:#777;
  text-align:center;
}

/* ================== MOBILE SEARCH FIX ================== */
@media (max-width:900px){
  .header-search{
    position:absolute;
    left:12px;
    right:12px;
    top:calc(100% + 8px);
    max-width:none;
    display:flex;
    background:#fff;
    border-radius:999px;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateY(-8px);
    transition:.15s ease;
    z-index:9999;
  }

  .header-search.active{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translateY(0);
  }

  .header-search input{
    border:1px solid #e8edf3;
    border-right:none;
    border-radius:999px 0 0 999px;
    padding:12px 14px;
    font-size:13px;
  }

  .header-search button{
    width:46px;
    height:46px;
    padding:0;
    border:none;
    border-radius:0 999px 999px 0;
    background:#111;
  }

  .search-suggestions{
    top:calc(100% + 10px);
    border-radius:14px;
    max-height:320px;
  }

  .suggest-item{
    grid-template-columns:24px 1fr 40px;
    gap:10px;
    padding:10px 12px;
  }

  .suggest-icon{
    display:none;
  }
}
/* ================== RIGHT ================== */
.header-actions{
  display:flex;
  align-items:center;
  gap:12px;
}
.header-pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:11px 15px;
  border-radius:999px;
  text-decoration:none;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  font-weight:700;
  box-shadow:0 6px 18px rgba(15,23,42,.04);
  transition:.25s ease;
}

.header-pill:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(15,23,42,.08);
}

.header-pill span{
  max-width:130px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}


/* cart */
.cart-link{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:12px;
  background:rgba(0,0,0,.03);
  text-decoration:none;
  color:#111;
  font-weight:700;
}
.cart-link .count{
  background:var(--primary);
  color:#fff;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
}

/* buttons */
.btn{
  padding:8px 14px;
  border-radius:999px;
  font-weight:700;
  text-decoration:none;
  color:#fff;
}
.btn-login{background:var(--primary);}
.btn-signup{background:var(--accent);}

/* user dropdown */
.user-dropdown{position:relative;}
.user-trigger{
  background:none;
  border:none;
  cursor:pointer;
  font-weight:700;
  color:var(--primary);
}
.user-menu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width:190px;
  background:var(--white);
  border-radius:10px;
  box-shadow: var(--shadow);
  display:none;    /* toggled via JS */
  padding:6px 6px;
  overflow:hidden;
  z-index:2200;
}
.user-menu a{
  display:block;
  padding:10px 12px;
  color:#2c2c2c;
  text-decoration:none;
  font-weight:600;
  border-radius:8px;
}
.user-menu a:hover{ background:#f5f8f5; color:var(--primary); }

/* MOBILE SEARCH BUTTON */
.mobile-search-toggle{
  display:none;
  width:48px;
  height:48px;
  border:none;
  border-radius:50%;
  background:#fff;
  color:var(--text);
  box-shadow:0 6px 18px rgba(15,23,42,.06);
  cursor:pointer;
  align-items:center;
  justify-content:center;
  font-size:18px;
  border:1px solid var(--border);
}



/* ================== CATEGORIES (MEGA MENU) ================== */
.categories-wrapper{ position:relative; }
.categories-mega{
  position:absolute;
  top:calc(100% + 14px);
  left:0;
  width:min(720px, 92vw);
  background:#fff;
  border:1px solid var(--border);
  border-radius:24px;
  box-shadow:var(--shadow);
  padding:18px;
  opacity:0;
  visibility:hidden;
  transform:translateY(-6px);
  transition:opacity .15s ease, transform .15s ease, visibility .15s;
  pointer-events:none;
}
.categories-wrapper:hover .categories-mega,
.categories-wrapper.open .categories-mega{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
  pointer-events:auto;
}

.mega-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}
.mega-header a{
  text-decoration:none;
  color:var(--accent);
  font-weight:700;
}
.mega-kicker{
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  margin:0 0 4px;
}
.mega-header h3{
  margin:0;
  font-size:1.25rem;
  color:var(--text);
}
.mega-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
}
.mega-card{
  display:flex;
  flex-direction:column;
  gap:10px;
  text-decoration:none;
  color:var(--text);
  font-weight:600;
}
.mega-card img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:18px;
  background:#f8fafc;
}


@media (max-width: 900px){

  /* نخبي عناصر desktop */
  .main-nav,
  .account-pill,
  .cart-link,
  .categories-mega{
    display:none !important;
  }

  .store-header{
    position:sticky;
    top:0;
    z-index:3000;
    background:#fff;
    border-bottom:1px solid rgba(0,0,0,.06);
  }

  .header-inner{
    max-width:100%;
    display:grid;
    grid-template-columns:42px 1fr 42px;
    align-items:center;
    height:64px;
    min-height:64px;
    padding:0 14px;
    gap:10px;
    position:relative;
  }

  /* ===== gauche : menu ===== */
  .header-menu{
    grid-column:1;
    justify-self:start;
    display:flex;
    align-items:center;
    justify-content:flex-start;
  }

  .mobile-menu-toggle{
    display:inline-flex !important;
    width:42px;
    height:42px;
    align-items:center;
    justify-content:center;
    border:none;
    background:transparent;
    font-size:22px;
    color:#0f172a;
    cursor:pointer;
    padding:0;
    margin:0;
  }

  /* ===== center : logo ===== */
  .brand{
    grid-column:2;
    justify-self:center;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0;
    padding:0;
    transform:none !important;
  }

  .brand-logo{
    width:110px;
    height:auto;
    margin:0;
    object-fit:contain;
    background:transparent;
    box-shadow:none;
  }

  /* ===== droite : search ===== */
  .header-actions{
    grid-column:3;
    justify-self:end;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:0;
  }

  .mobile-search-toggle{
    display:inline-flex !important;
    width:42px;
    height:42px;
    align-items:center;
    justify-content:center;
    border:none;
    background:transparent;
    color:#0f172a;
    font-size:18px;
    cursor:pointer;
    padding:0;
    margin:0;
    box-shadow:none;
    border:none;
  }

  /* search dropdown */
  .header-search{
    position:absolute;
    left:12px;
    right:12px;
    top:calc(100% + 8px);
    z-index:20;
    display:flex;
    align-items:center;
    background:#fff;
    border:1px solid #e8edf3;
    border-radius:999px;
    overflow:visible;
    box-shadow:0 14px 32px rgba(15,23,42,.12);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateY(-8px);
    transition:.15s ease;
    max-width:none;
  }

  .header-search.active{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translateY(0);
  }

  .header-search input{
    flex:1;
    min-width:0;
    border:none;
    padding:12px 14px;
    font-size:13px;
    outline:none;
  }

  .header-search button{
    width:46px;
    height:46px;
    border:none;
    background:#111;
    color:#fff;
    border-radius:0;
    cursor:pointer;
    padding:0;
  }
}

/* ===== MENU ICON ===== */
.mobile-menu-toggle{
  display:none;
}

/* ===== SIDEBAR ===== */
.mobile-menu-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  backdrop-filter:blur(6px);
  opacity:0;
  visibility:hidden;
  transition:.22s ease;
  z-index:4000;
}

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

.mobile-menu-drawer{
  position:fixed;
  top:0;
  left:0;
  width:min(86vw,340px);
  height:100dvh;

  display:flex;
  flex-direction:column;

  background:
    radial-gradient(circle at top left, rgba(255,80,0,.12), transparent 38%),
    linear-gradient(180deg,#fff 0%,#f8fafc 100%);

  box-shadow:22px 0 70px rgba(15,23,42,.28);

  transform:translateX(-105%);
  transition:transform .28s cubic-bezier(.22,1,.36,1);

  z-index:5000;
  overflow:hidden;
  border-radius:0 28px 28px 0;
}

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

.mobile-menu-head{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px 18px 16px;
  border-bottom:1px solid rgba(15,23,42,.08);
}

.mobile-menu-brand{
  position:absolute;
  left:16px;
  display:flex;
  align-items:center;
  gap:10px;
}

.mobile-menu-brand img{
  width:42px;
  height:42px;
  object-fit:cover;
  border-radius:14px;
  background:#fff;
  box-shadow:0 8px 18px rgba(0,0,0,.08);
}

.mobile-menu-brand strong{
  display:none;
}

.mobile-menu-brand small{
  display:none;
}

.mobile-menu-head > strong{
  font-size:20px;
  font-weight:900;
  color:#111827;
  letter-spacing:-.03em;
}

.mobile-menu-close{
  position:absolute;
  right:16px;
  width:38px;
  height:38px;
  border:none;
  border-radius:999px;
  background:#fff;
  color:#111827;
  box-shadow:0 10px 24px rgba(15,23,42,.10);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.drawer-section-title{
  padding:16px 10px 7px;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#9ca3af;
}
.drawer-feature{
  min-height:64px;
}

.drawer-feature span{
  display:block;
}
.drawer-social-row{
  margin-top:auto;

  display:flex;
  justify-content:center;
  gap:12px;

  padding:18px 0 8px;
}

.social-menu{
  width:46px;
  height:46px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  text-decoration:none;
  font-size:18px;
  transition:.2s ease;
}

.social-menu:hover{
  transform:translateY(-3px);
}

.social-menu.insta{
  background:linear-gradient(135deg,#833ab4,#fd1d1d,#fcb045);
}

.social-menu.fb{
  background:#1877f2;
}

.social-menu.wa{
  background:#25d366;
}

.logout-link{
  background:#ef4444 !important;
  color:#fff !important;
}

.drawer-feature small{
  display:block;
  font-size:11px;
  color:#6b7280;
  font-weight:700;
  margin-top:3px;
}



.mobile-drawer-nav{
  flex:1;

  display:flex;
  flex-direction:column;
  gap:8px;

  padding:16px 12px;

  overflow-y:auto;
}

.mobile-drawer-nav a{
  position:relative;
  display:grid;
  grid-template-columns:42px 1fr auto;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:#111827;
  font-weight:800;
  padding:10px 12px 10px 8px;
  border-radius:18px;
  background:rgba(255,255,255,.72);
  border:1px solid rgba(15,23,42,.06);
  box-shadow:0 8px 22px rgba(15,23,42,.045);
  transition:.2s ease;
}

.mobile-drawer-nav a:hover,
.mobile-drawer-nav a:active{
  transform:translateX(3px);
  background:#fff7ed;
  border-color:rgba(255,80,0,.22);
}

.mobile-drawer-nav a i{
  width:42px;
  height:42px;
  border-radius:15px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#f3f4f6;
  color:#111827;
  font-size:17px;
}

.mobile-drawer-nav a:hover i{
  background:var(--accent);
  color:#fff;
}

.mobile-drawer-nav a span,
.mobile-drawer-nav .cart-badge{
  font-size:14px;
  line-height:1.1;
}

.mobile-drawer-nav b{
  min-width:26px;
  height:26px;
  padding:0 8px;
  border-radius:999px;
  background:#111827;
  color:#fff;
  font-size:12px;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.mobile-drawer-nav a[href*="cart"] b{
  background:var(--accent);
}

.mobile-drawer-nav a::after{
  content:"";
  position:absolute;
  right:12px;
  bottom:7px;
  width:0;
  height:3px;
  border-radius:999px;
  background:var(--accent);
  transition:.2s ease;
}

.mobile-drawer-nav a:hover::after{
  width:34px;
}

@media(max-width:390px){
  .mobile-menu-drawer{
    width:88vw;
    border-radius:0 22px 22px 0;
  }

  .mobile-menu-head{
    padding:18px 14px 12px;
  }

  .mobile-drawer-nav{
    padding:12px 9px;
  }

  .mobile-drawer-nav a{
    grid-template-columns:38px 1fr auto;
    padding:8px;
    border-radius:15px;
  }

  .mobile-drawer-nav a i{
    width:38px;
    height:38px;
    border-radius:13px;
    font-size:15px;
  }
}


/* =========================================================
   Header polish — CSS only, existing colors preserved
   ========================================================= */
.store-header{backdrop-filter:saturate(160%) blur(10px)}
.header-inner{min-width:0}
.logo, .brand, .header-actions, .nav-links{min-width:0}
.header-search, .search-form{min-width:0; flex:1 1 280px}
.header-search input, .search-form input{
  width:100%;
  min-width:0;
}
.nav-links a, .header-actions a, .header-actions button{
  white-space:nowrap;
}
@media (max-width: 992px){
  .header-inner{gap:10px}
  .nav-links{overflow-x:auto; scrollbar-width:none}
  .nav-links::-webkit-scrollbar{display:none}
}
@media (max-width: 768px){
  .store-header{top:0}
  .header-inner{
    padding-inline:12px;
    flex-wrap:wrap;
  }
  .header-search, .search-form{order:3; flex-basis:100%}
}

/* =========================================================
   Header motion + desktop/mobile finish - colors preserved
   ========================================================= */
@keyframes headerDrop{
  from{opacity:0; transform:translateY(-12px)}
  to{opacity:1; transform:translateY(0)}
}

@keyframes drawerItemIn{
  from{opacity:0; transform:translateX(-14px)}
  to{opacity:1; transform:translateX(0)}
}

.store-header{
  animation:headerDrop .38s cubic-bezier(.22,1,.36,1) both;
  box-shadow:0 8px 28px rgba(15,23,42,.045);
}

.main-nav > a,
.categories-btn,
.header-pill,
.mobile-search-toggle,
.mobile-menu-toggle{
  transition:
    transform .2s ease,
    background .2s ease,
    color .2s ease,
    box-shadow .2s ease,
    border-color .2s ease;
}

.main-nav > a:hover{
  background:#fff7ed;
  color:var(--accent);
  transform:translateY(-1px);
}

.header-search input,
.header-search button{
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}

.header-search:focus-within input{
  box-shadow:0 0 0 4px rgba(255,80,0,.10);
}

.header-search button:hover,
.mobile-search-toggle:hover,
.mobile-menu-toggle:hover{
  transform:translateY(-1px);
}

.categories-mega{
  transform-origin:top left;
}

.mega-card{
  min-width:0;
  padding:8px;
  border-radius:18px;
  transition:transform .22s ease, background .22s ease;
}

.mega-card:hover{
  transform:translateY(-3px);
  background:#fff7ed;
}

.mega-card span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.mobile-menu-drawer.active .mobile-drawer-nav a{
  animation:drawerItemIn .28s cubic-bezier(.22,1,.36,1) both;
}

.mobile-menu-drawer.active .mobile-drawer-nav a:nth-child(2){animation-delay:.03s}
.mobile-menu-drawer.active .mobile-drawer-nav a:nth-child(3){animation-delay:.06s}
.mobile-menu-drawer.active .mobile-drawer-nav a:nth-child(4){animation-delay:.09s}
.mobile-menu-drawer.active .mobile-drawer-nav a:nth-child(5){animation-delay:.12s}
.mobile-menu-drawer.active .mobile-drawer-nav a:nth-child(6){animation-delay:.15s}

.search-suggestions{
  overscroll-behavior:contain;
}

@media (min-width:901px){
  .header-inner{
    justify-content:space-between;
  }

  .header-menu{
    display:none;
  }

  .brand{
    flex:0 0 auto;
  }

  .main-nav{
    flex:0 0 auto;
  }

  .header-actions{
    flex:0 0 auto;
  }
}

@media (max-width:1100px) and (min-width:901px){
  .brand-logo{
    width:145px;
  }

  .main-nav > a,
  .categories-btn{
    padding-inline:12px;
  }

  .header-search{
    max-width:420px;
  }

  .header-pill span{
    max-width:88px;
  }
}

@media (max-width:900px){
  .store-header{
    box-shadow:0 8px 24px rgba(15,23,42,.06);
  }

  .header-search{
    top:calc(100% + 10px);
    transform:translateY(-10px) scale(.98);
  }

  .header-search.active{
    transform:translateY(0) scale(1);
  }

  .search-suggestions{
    left:0;
    right:0;
    max-height:min(52dvh, 360px);
  }

  .suggest-item{
    grid-template-columns:42px 1fr auto;
  }
}

@media (max-width:420px){
  .header-inner{
    grid-template-columns:38px 1fr 38px;
    height:58px;
    min-height:58px;
    padding-inline:10px;
  }

  .mobile-menu-toggle,
  .mobile-search-toggle{
    width:38px;
    height:38px;
  }

  .brand-logo{
    width:96px;
  }

  .mobile-drawer-nav a span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}

@media (prefers-reduced-motion: reduce){
  .store-header,
  .mobile-menu-drawer.active .mobile-drawer-nav a{
    animation:none !important;
  }
}
