/* =====================================================
   Project  : WellCare – صيدلية إلكترونية وإرشاد صحي
   Course   : Web Design
   File     : style.css (ROOT)
   Students :
   - سفيان ناصر الخطابي (232269)
   - مالك جمال مملوك (232858)
===================================================== */

/* =====================
   Root Variables (Light)
   ===================== */
:root{
  --bg: #f6fbf8;
  --bg2:#eff8f3;
  --card:#ffffff;

  --text:#0f172a;
  --muted:#475569;

  --brand:#1f8a4c;
  --brand2:#22c55e;

  --ring: rgba(34,197,94,.22);
  --border: rgba(15,23,42,.12);

  --shadow: 0 10px 25px rgba(2,44,22,.10);
  --shadow2: 0 6px 16px rgba(2,44,22,.08);

  --radius: 18px;
}

/* =====================
   Dark Mode Variables
   ===================== */
body.dark{
  --bg: #0b1220;
  --bg2:#0f1b2e;
  --card:#0f1b2e;

  --text:#e5e7eb;
  --muted:#a7b0c0;

  --border: rgba(229,231,235,.12);
  --shadow: 0 12px 28px rgba(0,0,0,.35);
  --shadow2: 0 8px 18px rgba(0,0,0,.28);
}

/* =====================
   Reset & Base
   ===================== */
*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: "Cairo", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(34,197,94,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(31,138,76,.14), transparent 55%),
    var(--bg);
  color: var(--text);
}

a{ text-decoration: none; color: inherit; }

.container{
  width: min(1150px, 92%);
  margin-inline: auto;
}

.muted{ color: var(--muted); }

h1,h2,h3,h4,h5,h6{
  line-height: 1.35;
  margin: 0 0 10px 0;
}

p{
  line-height: 1.9;
  margin: 0;
}

/* =====================
   Global Spacing (fix “لاصق”)
   ===================== */
main > section{ margin-bottom: 80px; }

.section{ padding: 70px 0; }
.section--alt{ background: linear-gradient(180deg, transparent, rgba(34,197,94,.08), transparent); }

.section__head{
  display:flex;
  justify-content: space-between;
  align-items:flex-end;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom: 40px;
}

/* =====================
   Accessibility / Focus
   ===================== */
:where(a, button, input, textarea, select):focus-visible{
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

/* =====================
   Buttons / Chips
   ===================== */
.btn{
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  box-shadow: var(--shadow2);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.btn:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  filter: brightness(1.02);
}

.btn:active{ transform: translateY(0); }

.btn--primary{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  border: none;
}

.btn--secondary{
  background: rgba(34,197,94,.12);
}

.chip{
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .9rem;
  border: 1px solid rgba(34,197,94,.3);
  background: rgba(34,197,94,.12);
  transition: transform .18s ease, background .18s ease;
  color: var(--text);
}
.chip:hover{ transform: translateY(-1px); }

.badge{
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  font-weight: 900;
}

/* =====================
   Topbar / Navbar
   ===================== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:16px;
  padding: 14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.brand__logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg,var(--brand),var(--brand2));
  display:grid;
  place-items:center;
  box-shadow: var(--shadow2);
  overflow: hidden;
}

/* ✅ Logo image instead of “W” */
.brand__logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  display:block;
}

/* If you want NO green badge background, uncomment:
.brand__logo{ background: transparent; box-shadow:none; }
.brand__logo img{ padding:0; }
*/

.nav{ display:flex; gap:20px; }

.nav__link{
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .18s ease, transform .18s ease;
}

.nav__link:hover{
  background: rgba(34,197,94,.12);
  transform: translateY(-1px);
}

.nav__link.is-active{
  background: rgba(34,197,94,.15);
  border: 1px solid rgba(34,197,94,.22);
}

/* Mobile burger (optional if you have it) */
.burger{
  width: 44px;
  height: 44px;
  display: none;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow2);
  cursor: pointer;
}
.burger span{
  display:block;
  height:2px;
  margin:6px 10px;
  background: var(--text);
  border-radius:2px;
}

.mobileNav{
  border-top: 1px solid var(--border);
  padding: 10px 0;
}
.mobileNav__link{
  display:block;
  padding: 12px 4%;
}
.mobileNav__link:hover{ background: rgba(34,197,94,.10); }
#mobileNav[hidden]{ display:none !important; }

/* =====================
   Hero
   ===================== */
.hero{ padding: 80px 0; }

.hero__grid{
  display:grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}

.hero h1{
  font-size: clamp(28px, 3.2vw, 44px);
  margin: 0;
}

.hero__content{
  display:flex;
  flex-direction: column;
  gap: 24px;
}

.hero__stats{
  display:flex;
  gap:14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.stat{
  background: rgba(34,197,94,.12);
  padding: 10px 14px;
  border-radius: 999px;
  display:inline-flex;
  gap:10px;
  align-items:center;
}

.hero__cta{
  display:flex;
  gap:18px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.note{
  margin-top: 10px;
  color: var(--muted);
  font-size: .95rem;
}

/* =====================
   Grid / Cards / Products
   ===================== */
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card,
.product,
.product-card{
  background: color-mix(in oklab, var(--card) 92%, transparent);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow2);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover,
.product:hover,
.product-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(34,197,94,.28);
}

/* Image area for product cards */
.prodImg{
  height: 150px;
  border-radius: 16px;
  background:
    radial-gradient(140px 70px at 20% 20%, rgba(34,197,94,.26), transparent 65%),
    radial-gradient(160px 90px at 80% 0%, rgba(31,138,76,.18), transparent 65%),
    linear-gradient(135deg, rgba(34,197,94,.14), rgba(255,255,255,0));
  border: 1px solid rgba(34,197,94,.18);
  margin-bottom: 14px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.prodTop{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap:12px;
}

.prodTitle{ margin: 0 0 6px 0; font-size: 1.05rem; }
.prodDesc{ margin: 0; color: var(--muted); font-size: .95rem; }

.prodMeta{
  display:flex;
  gap:8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.prodFooter{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap:12px;
  margin-top: 14px;
}

.price strong{ font-size: 1.1rem; }

/* ✅ Your images mapping (matches your exact file names) */
.product-card[data-id="1"] .prodImg,
.product[data-id="1"] .prodImg{ background-image: url("images/vitaminC.jpg"); }

.product-card[data-id="2"] .prodImg,
.product[data-id="2"] .prodImg{ background-image: url("images/tablets.jpg"); }

.product-card[data-id="3"] .prodImg,
.product[data-id="3"] .prodImg{ background-image: url("images/cough-syrup.jpg"); }

.product-card[data-id="4"] .prodImg,
.product[data-id="4"] .prodImg{ background-image: url("images/health guidenss.jpg"); }

.product-card[data-id="5"] .prodImg,
.product[data-id="5"] .prodImg{ background-image: url("images/contact_us.jpg"); }

.product-card[data-id="6"] .prodImg,
.product[data-id="6"] .prodImg{ background-image: url("images/cosmic.jpg"); }

/* =====================
   Filters (if you have them)
   ===================== */
.filters{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.filters__group{
  background: color-mix(in oklab, var(--card) 92%, transparent);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow2);
}

.filters__title{ margin: 0 0 12px; font-size: 1rem; }

.filters__row{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

.pillOption{
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--card);
  color: var(--text);
  transition: transform .18s ease, background .18s ease;
}
.pillOption:hover{ transform: translateY(-1px); }
.pillOption.active{
  background: rgba(34,197,94,.25);
  border-color: rgba(34,197,94,.35);
}

/* =====================
   Forms / Contact
   ===================== */
.contact{
  display:grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 40px;
  align-items: start;
  margin-top: 40px;
}

.form{
  background: color-mix(in oklab, var(--card) 92%, transparent);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.field{
  display:flex;
  flex-direction: column;
  gap: 8px;
}

.field__label{ font-size: .92rem; color: var(--muted); }

input, textarea, select{
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease;
}

textarea{ resize: vertical; }

input:focus, textarea:focus, select:focus{
  border-color: rgba(34,197,94,.35);
  box-shadow: 0 0 0 4px var(--ring);
  outline: none;
}

input::placeholder,
textarea::placeholder{
  color: color-mix(in oklab, var(--muted) 85%, white);
  opacity: 1;
}

/* =====================
   Accordion (Guidance)
   ===================== */
.accordion{ display:grid; gap: 16px; }

.accItem{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  box-shadow: var(--shadow2);
  overflow: hidden;
}

.accBtn{
  width: 100%;
  text-align: right;
  padding: 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 800;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  transition: background .18s ease;
  color: var(--text); /* ✅ fixes black text in dark mode */
}
.accBtn:hover{ background: rgba(34,197,94,.08); }

.accIcon{ font-size: 1.3rem; color: var(--brand); }

/* CSS-only accordion animation (works with aria-expanded + your JS) */
.accPanel{
  padding: 0 16px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .28s ease, opacity .28s ease, padding .28s ease;
  color: var(--muted);
}

.accBtn[aria-expanded="true"] + .accPanel{
  padding: 0 16px 16px;
  max-height: 500px;
  opacity: 1;
}

/* =====================
   Modal (optional, if you have it)
   ===================== */
.modal{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.45);
  opacity: 1;
  transition: opacity .22s ease;
}

/* ✅ THE FIX: hidden must win */
.modal[hidden]{
  display: none !important;
  opacity: 0;
}

.modal__dialog{
  background: var(--card);
  border-radius: var(--radius);
  width: min(850px, 92%);
  box-shadow: var(--shadow);
  position: relative;
  padding: 32px;
  transform: scale(.98);
  transition: transform .22s ease, opacity .22s ease;
  color: var(--text);
}

.modal:not([hidden]) .modal__dialog{ transform: scale(1); }

.modal__close{
  position: absolute;
  top: 12px;
  left: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg2);
  box-shadow: var(--shadow2);
  color: var(--text);
}

/* =====================
   Footer
   ===================== */
.footer{
  border-top: 1px solid var(--border);
  padding: 30px 0;
  background: color-mix(in oklab, var(--bg2) 70%, transparent);
  margin-top: 80px;
  color: var(--muted);
}

/* =====================
   Reduce Motion
   ===================== */
@media (prefers-reduced-motion: reduce){
  *{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 980px){
  .hero__grid{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: repeat(2,1fr); }
  .filters{ grid-template-columns: 1fr; }
  .contact{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .nav{ display:none; }
  .burger{ display:inline-block; }
  .grid{ grid-template-columns: 1fr; }
}

/* =========================
   Responsive grids (admin stats + order detail)
   تستبدل الأنماط المضمّنة لتتجاوب مع الجوال
   ========================= */
/* بطاقات لوحة التحكم: أفقية جنباً إلى جنب، وتلتفّ تلقائياً حسب عرض الشاشة */
.statsGrid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:16px;
}
.detailGrid{ display:grid; grid-template-columns:2fr 1fr; gap:20px; }
@media (max-width: 720px){
  .detailGrid{ grid-template-columns:1fr; }
}
/* =========================
   TOPBAR FIX (Logo + Actions)
   ضع هذا في آخر style.css
   ========================= */

/* Actions container */
.topbar__actions{
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

/* Pill buttons (theme + cart) */
.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);         /* ✅ يتغير مع dark mode */
  color: var(--text);              /* ✅ يتغير مع dark mode */
  box-shadow: var(--shadow2);
  cursor: pointer;
  min-height: 42px;
  line-height: 1;
}

.pill:hover{
  box-shadow: var(--shadow);
}

.pill__icon{
  display: inline-block;
  font-size: 1.05rem;
}

.pill__text{
  white-space: nowrap;
  font-weight: 700;
}

/* Badge stays readable */
.badge{
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  font-weight: 900;
}

/* =========================
   FINAL LOGO FIX (RECT LOGO)
   ========================= */

/* ========= LOGO FIX (for images with big white canvas) ========= */

.brand__logo{
  height: 65px;
  width: 140px;                 /* خليها مستطيل بدل مربع */
  padding: 0;                   /* لا padding */
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;             /* ✅ يقص أي زوائد */
  box-shadow: var(--shadow2);
}

.brand__logo img{
  height: 100%;
  width: 100%;
  object-fit: cover;            /* ✅ يملأ الإطار حتى لو فيه فراغ */
  display: block;
  transform: scale(1.25);       /* ✅ يكبّر اللوجو داخل الإطار */
  transform-origin: center;
}
/* زر + داخل المنتج */
.add-plus{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow2);
  transition: transform .15s ease, filter .15s ease;
}
.add-plus:hover{ transform: translateY(-2px); filter: brightness(1.05); }
.add-plus:active{ transform: translateY(0); }

/* زر السلة في الهيدر */
.cartBtn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow2);
}

/* mini cart dropdown */
.miniCart{
  position: absolute;
  top: 68px;
  inset-inline-start: 18px;   /* RTL: على اليسار (لو تبيه يمين غيّرها) */
  width: min(380px, 92vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 200;
}

.miniCart__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 6px 6px 10px;
  border-bottom: 1px solid var(--border);
}

.miniCart__close{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
}

.miniCart__items{
  max-height: 320px;
  overflow: auto;
  padding: 10px 6px;
  display: grid;
  gap: 10px;
}

.miniItem{
  display:flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}

.miniItem img{
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 12px;
}

.miniItem__info{ flex:1; }
.miniItem__name{ font-weight: 800; margin: 0; }
.miniItem__price{ color: var(--muted); font-size: 14px; margin-top: 4px; }

.miniItem__qty{
  display:flex;
  gap: 8px;
  align-items: center;
}

.qtyBtn{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.removeBtn{
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.miniCart__foot{
  border-top: 1px solid var(--border);
  padding: 10px 6px 6px;
  display:grid;
  gap: 10px;
}

.miniCart__total{
  display:flex;
  justify-content: space-between;
  align-items:center;
}

.miniCart__clear{
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: rgba(34,197,94,.12);
  cursor: pointer;
  color: var(--text);
}
/* =========================
   FIX: Mini Cart position (mobile/desktop)
   ========================= */
.topbar__actions{
  position: relative; /* مهم عشان miniCart يتموضع عليه */
}

.miniCart{
  top: calc(100% + 10px); /* بدل 68px */
  inset-inline-end: 0;    /* ✅ يطلع تحت زر السلة */
  inset-inline-start: auto;
  z-index: 999;
}

/* لو تحبها أعرض قليلاً */
.miniCart{ width: min(420px, 92vw); }

/* =========================
   Product images (NEW supplements)
   ========================= */

/* خلى الصورة تظهر كاملة بدون قص */
.prodImg{
  background-size: fit;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #ffffff; /* يخلي PNG واضح */
}

/* صورك الجديدة */
.product-card[data-id="7"]  .prodImg{ background-image: url("images/suplement_1.png"); }
.product-card[data-id="8"]  .prodImg{ background-image: url("images/suplement_2.png"); }
.product-card[data-id="9"]  .prodImg{ background-image: url("images/suplement_3.jpeg"); }
.product-card[data-id="10"] .prodImg{ background-image: url("images/suplement_4.jpg"); }
.product-card[data-id="11"] .prodImg{ background-image: url("images/suplement_5.png"); }

.topbar, .topbar__inner { overflow: visible !important; }

/* =========================
   Checkout Page Styles
   ========================= */
.checkoutWrap{
  display: grid;
  gap: 24px;
}

.checkoutCard{
  background: color-mix(in oklab, var(--card) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.checkoutHead{
  display:flex;
  justify-content: space-between;
  align-items:flex-end;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.checkoutItems{
  display: grid;
  gap: 12px;
}

.checkoutItem{
  display:grid;
  grid-template-columns: 72px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg2) 70%, transparent);
}

.checkoutImg{
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
}

.checkoutName{ font-size: 1.05rem; }
.checkoutMeta{ font-size: .92rem; margin-top: 4px; }

.checkoutQty{
  display:flex;
  align-items:center;
  gap: 10px;
}

.checkoutLineTotal{
  display:flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.checkoutSummary{
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display:grid;
  gap: 12px;
}

.sumRow{
  display:flex;
  justify-content: space-between;
  align-items:center;
}

.sumActions{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* empty box */
.emptyBox{
  text-align:center;
  padding: 26px;
  border: 1px dashed var(--border);
  border-radius: 18px;
}

/* =========================
   Thank You Overlay + Animation
   ========================= */
.thankYou{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display:grid;
  place-items:center;
  z-index: 9999;
}

.thankYou[hidden]{ display:none !important; }

.thankYou__card{
  width: min(520px, 92vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px;
  text-align:center;
  transform: scale(.95);
  opacity: 0;
}

.thankYou__icon{
  width: 74px;
  height: 74px;
  border-radius: 22px;
  margin: 0 auto 12px;
  display:grid;
  place-items:center;
  font-size: 34px;
  background: rgba(34,197,94,.15);
  border: 1px solid rgba(34,197,94,.25);
}

/* pop animation */
.ty-pop .thankYou__card{
  animation: popIn .35s ease forwards;
}

@keyframes popIn{
  from{ transform: scale(.92) translateY(8px); opacity: 0; }
  to{ transform: scale(1) translateY(0); opacity: 1; }
}

.thankYou__actions{
  margin-top: 16px;
  display:flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* responsive checkout grid */
@media (max-width: 720px){
  .checkoutItem{
    grid-template-columns: 64px 1fr;
    grid-auto-rows: auto;
  }
  .checkoutQty, .checkoutLineTotal{
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
/* =========================================
   Reduce space between hero description and cards
   Put this at the END of style.css
========================================= */

/* قلل padding تحت الهيرو */
.hero{
  padding-bottom: 28px !important;
  padding-top: 20px !important;
}

/* لو عنوان "منتجات مميزة" داخل section */
.section__head{
  margin-bottom: 14px !important;
}

/* قلل المسافة قبل شبكة الكروت */
.grid{
  margin-top: 10px !important;
}
/* =========================================
   FIX: spacing under topbar (products page)
   ========================================= */

/* مسافة عامة تحت الهيدر */
.topbar + main{
  padding-top: 60px;
}

/* لو صفحة المنتجات لها كلاس خاص */
.products-page{
  padding-top: 70px;
}

/* عنوان صفحة المنتجات */
.products-page h1,
.products-page .page-title{
  margin-top: 0;
  margin-bottom: 24px;
}
/* =========================================
   FIX: Navbar text stacking on products page
   Put at END of style.css
========================================= */

/* خلي عناصر الهيدر مرنة وتلف بشكل مرتب */
.topbar__inner{
  flex-wrap: wrap;
  row-gap: 10px;
}

/* القائمة نفسها: ما تخلي الكلام ينكسر */
.nav{
  display: flex;
  flex-wrap: wrap;          /* ✅ لو ما فيش مساحة، تنزل لسطر ثاني بشكل مرتب */
  gap: 12px;                /* ✅ أقل من 20 */
  justify-content: center;  /* ✅ شكل مرتب في الوسط */
  flex: 1;
  min-width: 280px;
}

.nav__link{
  white-space: nowrap;      /* ✅ يمنع "تواصل" و "معنا" يصيروا فوق بعض */
  padding: 8px 12px;        /* ✅ يقلل حجم البادينق */
  font-size: 0.98rem;
}

/* اسم البراند واللوجو ما ياخذوش مساحة كبيرة */
.brand{
  flex: 0 0 auto;
  min-width: 220px;
}

.brand__name,
.brand__sub{
  white-space: nowrap;
}

/* أزرار السلة + الوضع تبقى جنب بعض بدون ما تكسر التصميم */
.topbar__actions{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

/* للشاشات الصغيرة: خلي القائمة سطر واحد مع scroll بدل تكسير */
@media (max-width: 820px){
  .nav{
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  .nav::-webkit-scrollbar{ height: 6px; }
}
/* =========================
   Checkout page UI
========================= */
.checkoutItems{
  display: grid;
  gap: 12px;
}

.checkoutRow{
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 92%, transparent);
}

.checkoutThumb{
  width: 70px;
  height: 54px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(34,197,94,.18);
}

.checkoutTitle{
  font-weight: 800;
  margin: 0 0 4px 0;
}

.checkoutMeta{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .95rem;
}

.qtyBox{
  display:flex;
  align-items:center;
  gap: 8px;
  justify-content: end;
}

.qtyBtn{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow2);
}

.qtyNum{
  min-width: 28px;
  text-align:center;
  font-weight: 900;
}

.delBtn{
  border: none;
  background: rgba(239,68,68,.12);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  border: 1px solid rgba(239,68,68,.22);
}

/* Thank you animation */
.thanksIcon{
  font-size: 56px;
  display: inline-block;
  animation: pop .35s ease both;
}

@keyframes pop{
  from{ transform: scale(.6); opacity: .2; }
  to{ transform: scale(1); opacity: 1; }
}

/* ===== Products Filter UI (AUTO) ===== */
.productsFilterUI{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin: 10px 0 18px;
}

/* scrollable chips */
.filterBar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 6px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.filterBar::-webkit-scrollbar { height: 8px; }
.filterBar::-webkit-scrollbar-thumb { border-radius: 999px; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, opacity .12s ease;
}

.chip:hover { transform: translateY(-1px); }

.chip.is-active {
  border-color: color-mix(in oklab, var(--accent, #6cb) 65%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #6cb) 25%, transparent);
}

/* search */
.productSearch{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  color: inherit;
  outline: none;
}
/* ===== Products Filter UI ===== */
.productsFilterUI{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin: 10px 0 18px;
}

/* scrollable chips */
.filterBar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 6px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.filterBar::-webkit-scrollbar { height: 8px; }
.filterBar::-webkit-scrollbar-thumb { border-radius: 999px; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, opacity .12s ease;
}

.chip:hover { transform: translateY(-1px); }

.chip.is-active {
  border-color: color-mix(in oklab, var(--accent, #6cb) 65%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #6cb) 25%, transparent);
}

/* search */
.productSearch{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  color: inherit;
  outline: none;
}

/* ===== Price range slider ===== */
.priceFilterWrap{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 92%, transparent);
}

.priceLabel{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  opacity:.95;
}

.priceRange{
  width:100%;
  cursor:pointer;
}

/* ===== Accordion panel smooth ===== */
.accPanel{
  transition: max-height .25s ease, opacity .2s ease;
}

/* ===== Guidance Accordion Fix ===== */
.accPanel{
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease;
  padding: 0 14px;
}

.accItem.is-open .accPanel{
  max-height: 300px; /* كافي للنصوص القصيرة، لو عندك نص أطول زيدها */
  opacity: 1;
  padding: 12px 14px 14px;
}

.accBtn{
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.accIcon{
  font-size: 20px;
  line-height: 1;
}
/* ===== Price filter (compact & neutral) ===== */
.priceFilterWrap{
  max-width: 420px;          /* يقلل العرض */
  margin: 10px auto 16px;    /* في النص */
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 95%, transparent);
}

.priceLabel{
  font-size: 14px;
  opacity: .85;
  margin-bottom: 6px;
}

/* slider itself */
.priceRange{
  width: 100%;
  height: 4px;              /* أنحف */
  appearance: none;
  background: #777;         /* ❌ مش أزرق */
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

/* thumb (circle) */
.priceRange::-webkit-slider-thumb{
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ddd;         /* رمادي */
  border: 2px solid #20cb7b;
}

.priceRange::-moz-range-thumb{
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ddd;
  border: 2px solid #172e02;
}

/* ============= Order status chips & tracker (added for orders system) ============= */
.chip.status-pending    { background:#fef3c7; color:#92400e; }
.chip.status-processing { background:#dbeafe; color:#1e40af; }
.chip.status-shipped    { background:#e9d5ff; color:#6b21a8; }
.chip.status-delivered  { background:#dcfce7; color:#166534; }
.chip.status-cancelled  { background:#fee2e2; color:#991b1b; }

.orderSteps {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.orderStep {
  flex: 1;
  min-width: 110px;
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.02);
  position: relative;
}
.orderStep__dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--border);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: bold;
  margin-bottom: 6px;
}
.orderStep__label { font-size: 0.9em; }
.orderStep.is-done { background: rgba(34,197,94,.10); border-color: #22c55e; }
.orderStep.is-done .orderStep__dot { background: #22c55e; }
