:root {
  --ab-bg: #fffaf4;
  --ab-panel: #ffffff;
  --ab-accent: #e78c52;
  --ab-accent-dark: #d67431;
  --ab-text: #3a2f2f;
  --ab-muted: #9a8b8b;
  --ab-radius: 18px;
  --ab-shadow: 0 12px 30px rgba(0,0,0,0.07);
  --ab-nav-h: 62px;
  --ab-safe: env(safe-area-inset-bottom, 12px);
  --ab-ar-font: "Tajawal", "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ab-en-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ab-bg);
  color: var(--ab-text);
  font-family: var(--ab-en-font);
  -webkit-font-smoothing: antialiased;
}
body.is-ar {
  direction: rtl;
  font-family: var(--ab-ar-font);
}
img {
  max-width: 100%;
  display: block;
}
a {
  text-decoration: none;
  color: inherit;
}
button {
  font-family: inherit;
}
.container {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 14px;
}
.hide {
  display: none !important;
}

/* NAVBAR */
.ab-topbar {
  height: var(--ab-nav-h);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.ab-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ab-logo {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 4px solid #000;
  background: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
}
.ab-site-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.1;
}
.ab-menu-btn {
  width: 44px;
  height: 36px;
  border: none;
  background: #353535;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 7px 10px;
  cursor: pointer;
}
.ab-menu-btn span {
  background: #fff;
  height: 3px;
  border-radius: 3px;
}

/* LANGUAGE PILL — 3 buttons safe */
.ab-lang-toggle {
  display: inline-flex;
  gap: 4px;
  background: #e0e0e0;
  padding: 3px 4px;
  border-radius: 999px;
  align-items: center;
  max-width: 210px;          /* stop it from exploding on small screens */
  overflow: hidden;
}
.ab-lang-btn {
  border: none;
  background: transparent;
  padding: 3px 11px 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  flex: 1 1 auto;            /* let them share space */
  text-align: center;
}
.ab-lang-btn.active {
  background: #e78c52;
  color: #fff;
}
@media (max-width: 420px) {
  .ab-lang-toggle {
    max-width: 180px;        /* a bit tighter on very small iPhones */
  }
  .ab-lang-btn {
    padding-inline: 8px;
    font-size: 11px;
  }
}

/* SIDE NAV (mobile) */
.ab-sidenav {
  position: fixed;
  top: 0;
  left: -80%;
  width: 72%;
  max-width: 320px;
  height: 100vh;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  z-index: 90; /* under menu button */
  transition: left 0.2s ease;
  display: flex;
  flex-direction: column;
}
.ab-sidenav.open {
  left: 0;
}
body.is-ar .ab-sidenav {
  left: auto;
  right: -80%;
}
body.is-ar .ab-sidenav.open {
  right: 0;
}
.ab-sidenav-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.ab-sidenav ul {
  list-style: none;
  padding: 10px 0;
  margin: 0;
}
.ab-sidenav a {
  display: block;
  padding: 10px 16px;
  font-weight: 500;
}
.ab-sidenav a:hover {
  background: rgba(231,140,82,0.18);
}

/* OVERLAY (for mobile nav) */
#ab-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 80;
  display: none;
}

/* HERO */
.hero {
  margin-top: 16px;
  padding: 22px 14px 16px;
  text-align: center;
}
.hero-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--ab-shadow);
  padding: 20px 18px 22px;
  background-image: url('assets/img/hero-bg.svg');
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.hero-title {
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.hero-sub {
  color: var(--ab-muted);
  font-size: 0.9rem;
}
.hero-ar {
  font-size: 1.4rem;
  color: #ce762f;
  font-weight: 700;
  margin-top: 6px;
}
.hero-badge {
  background: rgba(231,140,82,0.15);
  color: #c2601a;
  padding: 4px 10px 4px;
  border-radius: 999px;
  display: inline-block;
  font-size: 0.7rem;
  margin-bottom: 8px;
}

/* SLIDER */
.product-slider {
  margin-top: 20px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--ab-shadow);
  overflow: hidden;
  position: relative;
}
.slider-track {
  display: flex;
  gap: 8px;
  padding: 14px 14px 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.slider-item {
  min-width: 120px;
  max-width: 120px;
  background: #fffdfb;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.04);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 12px;
  position: relative; /* for badges */
}
.slider-item img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 14px;
  background: #eee;
}
.slider-item .p-title {
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.2;
}
.slider-item .p-price {
  font-weight: 700;
  color: #d56b21;
  font-size: 0.78rem;
}
.slider-dots {
  text-align: center;
  padding: 4px 0 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d6d6d6;
}
.slider-dot.active {
  background: #e78c52;
}

/* BADGES on slider/cards */
.badge {
  display:inline-block;
  font-size:0.6rem;
  font-weight:600;
  border-radius:999px;
  padding:2px 7px 3px;
  border:1px solid transparent;
}
.badge-new   {background:var(--new-bg);border-color:var(--new-bd);color:var(--new-fg);}
.badge-low   {background:var(--low-bg);border-color:var(--low-bd);color:var(--low-fg);}
.badge-out   {background:var(--out-bg);border-color:var(--out-bd);color:var(--out-fg);}
.badge-coming{background:var(--coming-bg);border-color:var(--coming-bd);color:var(--coming-fg);}

/* SECTIONS */
.section-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 26px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  background: #e78c52;
  border-radius: 999px;
}

/* FOOTER */
footer {
  margin-top: 32px;
  padding: 18px 14px calc(16px + var(--ab-safe));
  text-align: center;
  color: #908076;
  font-size: 0.68rem;
}

/* rtl overrides */
body.is-ar .hero {
  text-align: center;
}

/* DESKTOP */
@media (min-width: 760px) {
  .ab-menu-btn {
    display: none;
  }
  .ab-sidenav {
    display: none;
  }
  .ab-topbar-nav {
    display: flex;
    gap: 16px;
  }
  .ab-topbar-nav a {
    font-weight: 500;
  }
  .hero {
    padding: 28px 0 8px;
  }
  .hero-card {
    width: min(920px, 100%);
    margin: 0 auto;
    text-align: left;
  }
  body.is-ar .hero-card {
    text-align: right;
  }
  .product-slider {
    width: min(920px, 100%);
    margin: 20px auto 0;
  }
}

/* ================================
   MOBILE SAFE AREA & FORM FIXES
   ================================ */
input,
textarea,
select,
button {
  font-size: 16px; /* prevent Safari zoom */
  border-radius: var(--ab-radius);
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.12);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: var(--ab-text);
  font-family: var(--ab-en-font);
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Cards or form containers */
.ab-form,
.form-card {
  background: var(--ab-panel);
  box-shadow: var(--ab-shadow);
  border-radius: var(--ab-radius);
  padding: 16px;
  margin: 12px auto;
  width: min(95%, 420px);
}

/* Fix input focus on iPhone safe area */
@supports (-webkit-touch-callout: none) {
  input,
  textarea,
  select,
  button {
    font-size: 16px !important;
  }
}

/* Handle safe-area insets for bottom buttons */
.footer-safe,
.bottom-fixed {
  padding-bottom: calc(16px + var(--ab-safe));
}

/* Ensure viewport padding on small screens */
@media (max-width: 600px) {
  body {
    padding-left: 10px;
    padding-right: 10px;
  }
  input,
  textarea,
  select,
  button {
    font-size: 16px;
    border-radius: 12px;
  }
}

/* iPhone SAFE-AREA */
@supports (padding: max(0px)) {
  body {
    padding-bottom: max( env(safe-area-inset-bottom), 18px );
    background-color: var(--ab-bg);
  }
  form,
  .ab-form,
  .form-card {
    border-radius: var(--ab-radius);
  }
}