/* ======================================================
   0. SAFETY (prevent horizontal overflow)
====================================================== */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

#navbar, .header, .nav, .trust-bar {
  max-width: 100vw;
}

/* ======================================================
   1. VARIABLES (اختياري لكن بيسهل التعديل لاحقًا)
====================================================== */
:root {
  --primary: #E1793A;
  --primary-dark: #c8621f;
  --text-dark: #1d1d1f;
  --text-soft: #6e6e73;
  --text-muted: #8a8a8e;
  --border-color: #e0e0e0;
  --bg-soft: #f5f5f7;
}

/* ======================================================
   2. TOP BANNER
====================================================== */
.top-banner {
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 32px;
}
.top-banner button {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
}
.top-banner-text { font-size: 13px; }

/* ======================================================
   3. HEADER
====================================================== */
#navbar { position: relative; }

.header {
  display: flex;
  align-items: center;
  padding: 10px 32px;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  left: 50px;
}
.logo {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-dark);
  font-style: italic;
}
.logo span { color: var(--primary); }

.search-bar {
  flex: 1;
  max-width: 440px;
  margin: 0 auto;
}
.search-bar input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border-radius: 24px;
  border: none;
  background: var(--bg-soft);
  font-size: 14px;
  outline: none;
  color: var(--text-soft);
}
.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  position: relative;
  right: 50px;
}
.header-icons svg { color: var(--text-dark); cursor: pointer; }

.account-wrap { cursor: pointer; display: flex; align-items: center; }
.cart-wrap { position: relative; cursor: pointer; }
.cart-badge {
  position: absolute;
  top: -5px; right: -6px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 9px;
  width: 15px; height: 15px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.lang-switch-btn {
  color: var(--text-dark);
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}
.lang-switch-btn:hover { color: var(--primary); }

/* ======================================================
   4. NAV LINKS
====================================================== */
.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-size: 13.5px;
  padding: 12px 16px;
  display: block;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav a:hover { color: var(--primary); }
.nav-divider { width: 1px; height: 16px; background: #d2d2d7; flex-shrink: 0; }

/* ======================================================
   5. TRUST BAR
====================================================== */
.trust-bar {
  background: var(--bg-soft);
  overflow: hidden;
  height: 34px;
  display: flex;
  align-items: center;
}
.trust-track {
  display: flex;
  direction: ltr;           /* keep item order fixed regardless of page language */
  width: max-content;
  white-space: nowrap;
  will-change: transform;
}
.trust-set {
  display: flex;
  flex-shrink: 0;
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-dark);
  padding: 0 20px;
  flex-shrink: 0;
}
.trust-sep { color: #c0c0c5; padding: 0 4px; flex-shrink: 0; }
/* Motion is driven entirely by JS (requestAnimationFrame), not CSS
   @keyframes — this avoids the browser jumping to the animation's end
   keyframe on load when direction is reversed for RTL, which was
   pushing the whole strip off-screen instantly. */
@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ======================================================
   6. SHARED BUTTONS
====================================================== */
.btn {
  display: block;
  padding: 11px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(225, 121, 58, 0.28);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(225, 121, 58, 0.38);
}

.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-half { width: 60%; align-self: center; }

/* ======================================================
   7. GENERIC HOVER / FOCUS
====================================================== */
a { transition: color 0.15s, opacity 0.15s; }
a:hover { color: var(--primary); }

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"] {
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(225, 121, 58, 0.25);
}

/* ======================================================
   8. DROPDOWN SHARED PARTS
====================================================== */
.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
}
.dropdown-title { font-size: 15px; font-weight: 700; }
.dropdown-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #999;
  line-height: 1;
  padding: 2px 6px;
}
.dropdown-close-btn:hover { color: var(--primary); }

.dropdown-guest-body {
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

/* ======================================================
   9. ACCOUNT DROPDOWN
====================================================== */
#accountDropdown {
  display: none;
  position: fixed;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 40px rgba(0,0,0,0.14);
  z-index: 9999;
  overflow: hidden;
  animation: popIn 0.2s ease;
}

/* --- Guest (not logged in) state --- */
.guest-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fdece1;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 2px;
}
.guest-welcome-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}
.guest-welcome-sub {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0 0 6px;
  max-width: 230px;
}
.dropdown-guest-body .btn-primary {
  width: 100%;
  margin-top: 4px;
}
.guest-signup-link {
  font-size: 13px;
  color: var(--text-soft);
  margin: 2px 0 0;
}
.guest-signup-link a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.guest-signup-link a:hover { text-decoration: underline; }

.account-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f0f0f0;
}
.account-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fdece1;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.account-greeting { margin: 0; font-size: 11px; color: var(--text-muted); }
.account-name { margin: 2px 0 0; font-size: 15px; font-weight: 700; color: var(--text-dark); }

.account-menu { padding: 10px 12px; }
.account-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--text-dark);
  font-size: 14px;
  text-decoration: none;
}
.account-menu-link svg { color: var(--text-soft); transition: color 0.15s; }
.account-menu-link:hover { background: var(--primary); color: #fff; }
.account-menu-link:hover svg { color: #fff; }

.account-footer {
  padding: 14px 20px 20px;
  border-top: 1px solid #f0f0f0;
  margin-top: 4px;
}
.account-footer .btn { width: 100%; }

/* ======================================================
   10. CART DROPDOWN
====================================================== */
#cartDropdown {
  display: none;
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 40px rgba(0,0,0,0.14);
  z-index: 9999;
  overflow: hidden;
  animation: popIn 0.2s ease;
}

.cart-item { display: flex; gap: 14px; padding: 16px 20px; align-items: center; }
.cart-item-img-wrap {
  width: 90px; height: 110px;
  border-radius: 12px;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.cart-item-img { width: 70px; height: 90px; object-fit: contain; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-weight: 700; font-size: 14px; margin: 0 0 5px; color: var(--text-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-item-prices { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.cart-item-original { font-size: 12px; color: var(--text-muted); text-decoration: line-through; }
.cart-item-discount { font-size: 12px; color: #c0392b; font-weight: 700; }
.cart-item-price { font-size: 17px; font-weight: 800; color: var(--text-dark); margin: 2px 0; }
.cart-item-monthly { font-size: 11px; color: var(--text-soft); margin: 0 0 6px; }
.cart-item-delivery { font-size: 12px; color: #c8501a; margin: 0; font-weight: 600; }

.cart-actions {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cart-continue { text-align: center; margin: 2px 0 0; }
.cart-continue a { font-size: 13px; color: var(--primary); text-decoration: none; }
.cart-continue a:hover { text-decoration: underline; }

/* ======================================================
   11. FOOTER
====================================================== */
#site-footer {
  background: var(--bg-soft);
  color: var(--text-dark);
  padding: 48px 40px 24px;
  border-top: 1px solid var(--border-color);
}
#site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}
#site-footer .footer-col h4 {
  font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--text-dark);
}
#site-footer .footer-brand .nav-logo {
  display: inline-block;
  font-size: 26px; font-weight: 800; letter-spacing: -1px;
  color: var(--text-dark); text-decoration: none; font-style: italic;
  margin-bottom: 10px; transition: color 0.2s;
}
#site-footer .footer-brand p {
  font-size: 13px; line-height: 1.6; color: var(--text-soft); margin-bottom: 16px; max-width: 240px;
}
#site-footer .footer-links { display: flex; flex-direction: column; gap: 10px; }
#site-footer .footer-links a { color: #4a4a4e; text-decoration: none; font-size: 13.5px; transition: color 0.2s; }
#site-footer .footer-social { display: flex; gap: 14px; margin-top: 4px; }
#site-footer .footer-social a { color: #4a4a4e; display: inline-flex; transition: color 0.2s; }
#site-footer .footer-social a svg { transition: stroke 0.2s; }
#site-footer .footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  font-size: 12.5px; color: var(--text-soft);
}
#site-footer .footer-bottom-links { display: flex; gap: 20px; flex-wrap: wrap; }
#site-footer .footer-bottom-links a { color: var(--text-soft); text-decoration: none; font-size: 12.5px; transition: color 0.2s; }
#site-footer a:hover,
#site-footer .footer-social a:hover { color: var(--primary); }
#site-footer .footer-social a:hover svg { stroke: var(--primary); }

/* ======================================================
   12. RTL OVERRIDES (Desktop only — width > 992px)
====================================================== */
@media (min-width: 993px) {
  [dir="rtl"] .logo-area { left: auto; right: 50px; }
  [dir="rtl"] .header-icons { right: auto; left: 50px; }
}

[dir="rtl"] .search-wrap svg { left: auto; right: 10px; }
[dir="rtl"] .search-bar input { padding: 8px 34px 8px 14px; }
[dir="rtl"] .cart-badge { right: auto; left: -6px; }

/* ======================================================
   13. RESPONSIVE — TABLET (≤ 992px)
====================================================== */
@media (max-width: 992px) {
  .header { padding: 10px 20px; gap: 12px; }

  .logo-area { left: 0; right: auto; }
  [dir="rtl"] .logo-area { right: 0; left: auto; }

  .header-icons { right: 0; left: auto; gap: 14px; }
  [dir="rtl"] .header-icons { left: 0; right: auto; }

  .search-bar { max-width: 320px; }

  .nav { padding: 0 20px; justify-content: flex-start; }

  #site-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }
}

/* ======================================================
   14. RESPONSIVE — MOBILE (≤ 768px)
====================================================== */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    padding: 10px 16px;
    row-gap: 10px;
  }

  .logo-area {
    order: 1;
    left: 0;
    right: auto;
    position: static;
  }
  [dir="rtl"] .logo-area {
    right: 0;
    left: auto;
  }

  .header-icons {
    order: 2;
    right: 0;
    left: auto;
    position: static;
    gap: 14px;
    margin-inline-start: auto;
  }
  [dir="rtl"] .header-icons {
    left: 0;
    right: auto;
    margin-inline-start: auto;
  }

  .search-bar {
    order: 3;
    flex-basis: 100%;
    max-width: 100%;
    margin: 0;
  }

  .logo { font-size: 24px; }

  .nav { padding: 0 16px; }
  .nav a { padding: 10px 12px; font-size: 13px; }

  .trust-item { font-size: 11.5px; padding: 0 14px; }

  #accountDropdown,
  #cartDropdown {
    width: calc(100vw - 24px);
    max-width: 380px;
  }

  .cart-item { padding: 14px 16px; }
  .dropdown-header,
  .dropdown-guest-body,
  .account-user,
  .account-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  #site-footer {
    padding: 36px 20px 20px;
  }

  #site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }

  #site-footer .footer-brand p {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  #site-footer .footer-links {
    align-items: center;
  }

  #site-footer .footer-social {
    justify-content: center;
  }

  #site-footer .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  #site-footer .footer-bottom-links {
    justify-content: center;
  }
}

/* ======================================================
   15. RESPONSIVE — SMALL MOBILE (≤ 480px)
====================================================== */
@media (max-width: 480px) {
  .logo { font-size: 21px; }

  .header-icons { gap: 10px; }
  .header-icons svg,
  .lang-switch-btn svg { width: 18px; height: 18px; }

  .search-bar input { font-size: 13px; padding: 7px 12px 7px 30px; }
  [dir="rtl"] .search-bar input { padding: 7px 30px 7px 12px; }

  .nav a { padding: 9px 10px; font-size: 12.5px; }

  #accountDropdown,
  #cartDropdown {
    width: calc(100vw - 16px);
  }

  .cart-item-img-wrap { width: 70px; height: 90px; }
  .cart-item-img { width: 55px; height: 70px; }

  .cart-actions .btn-half { width: 85%; }

  .account-avatar { width: 38px; height: 38px; }
  .account-name { font-size: 14px; }
}




/* hero */

 .hero {
    position: relative; overflow: hidden; background: #fff;
    padding-bottom: 16px; /* room for the dots pill to straddle the image's edge without being clipped or covered by the next section */
  }
  .hero-slide {
    display: none;
    align-items: center; justify-content: space-between;
    padding: 32px 60px 20px 60px; min-height: 360px; background: #fff;
    animation: fadeSlide 0.6s ease;
  }
  .hero-slide.active { display: flex; }
  .hero-slide.hero-slide-full {
    padding: 0; min-height: 0;
  }
  .hero-full-img {
    width: 100%; height: 450px; object-fit: cover; display: block;
  }
  @keyframes fadeSlide {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  .hero-content { flex: 0 0 auto; max-width: 380px; }
  .hero-title {
    font-size: 48px; font-weight: 800; line-height: 1.05;
    color: #E1793A; font-style: italic; letter-spacing: -1px;
    margin-bottom: 4px; position: relative; display: inline-block;
  }
  .sparkle { display: inline-block; color: #F2B88C; position: absolute; }
  .sparkle-1 { font-size: 18px; top: -8px; right: -22px; }
  .sparkle-2 { font-size: 10px; top: 2px; right: -36px; }
  .sparkle-3 { font-size: 8px; top: -14px; right: -12px; }
  .hero-subtitle { font-size: 20px; font-weight: 600; color: #1d1d1f; margin: 10px 0 8px; }
  .hero-subtitle strong { color: #E1793A; font-size: 22px; }
  .pay-options { display: flex; align-items: center; margin: 8px 0 16px; }
  .pay-opt { text-align: left; padding: 0 16px; font-size: 13px; color: #1d1d1f; line-height: 1.5; }
  .pay-opt:first-child { padding-left: 0; border-right: 1.5px solid #d2d2d7; padding-right: 16px; }
  .pay-brand { font-size: 16px; font-weight: 800; display: block; }
  .tabby { color: #1d1d1f; }
  .visa { letter-spacing: 2px; }
  .btn-shop {
    display: inline-block; padding: 10px 30px;
    border: 1.5px solid #1d1d1f; border-radius: 30px;
    color: #1d1d1f; font-size: 15px; cursor: pointer; background: none;
    font-weight: 500; transition: all 0.2s;
  }
  .btn-shop:hover { background: #1d1d1f; color: white; }
  .hero-image { flex: 1; display: flex; align-items: center; justify-content: flex-end; }
  .hero-real-img { width: 520px; height: 300px; object-fit: contain; }

  /* Dots: floating pill sitting exactly ON the boundary between the
     image and the white space below it — half overlapping the image,
     half spilling into the white area (bottom: 0 + translateY(50%)
     shifts it down by exactly half its own height). */
  .hero-dots {
    position: absolute;
    left: 50%;
    bottom: 16px; /* matches .hero's padding-bottom = sits right at the image's bottom edge */
    transform: translate(-50%, 50%); /* shift down by half its own height so it straddles the edge */
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 5;
  }
  .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #c7c7cc; cursor: pointer;
    border: none; padding: 0;
    transition: background 0.2s, transform 0.2s;
  }
  .dot:hover { background: #8e8e93; }
  .dot.active { background: #1d1d1f; transform: scale(1.15); }

  .section-divider { border: none; border-top: 1px solid #e0e0e0; margin: 32px 32px 0; }

  /* ======================================================
     RESPONSIVE
  ====================================================== */
  @media (max-width: 992px) {
    .hero-slide { padding: 28px 32px 18px; }
    .hero-title { font-size: 38px; }
    .hero-real-img { width: 380px; height: 220px; }
    .hero-full-img { height: 360px; }
  }

  @media (max-width: 768px) {
    .hero-slide {
      flex-direction: column;
      text-align: center;
      padding: 24px 20px 16px;
      min-height: 0;
      gap: 16px;
    }
    .hero-content { max-width: 100%; }
    .hero-title { font-size: 30px; }
    .sparkle-1 { right: -18px; }
    .sparkle-2 { right: -30px; }
    .sparkle-3 { right: -10px; }
    .hero-subtitle { font-size: 16px; }
    .hero-subtitle strong { font-size: 18px; }
    .pay-options { justify-content: center; }
    .hero-image { justify-content: center; }
    .hero-real-img { width: 260px; height: 160px; }
    .hero-full-img { height: 220px; }
    .hero-dots { padding: 7px 12px; gap: 7px; }
    .dot { width: 6px; height: 6px; }
  }

  @media (max-width: 480px) {
    .hero-title { font-size: 24px; }
    .hero-subtitle { font-size: 14px; }
    .hero-subtitle strong { font-size: 16px; }
    .pay-options { flex-direction: column; gap: 10px; }
    .pay-opt:first-child { border-right: none; padding-right: 0; }
    .btn-shop { padding: 9px 24px; font-size: 14px; }
    .hero-real-img { width: 200px; height: 130px; }
    .hero-full-img { height: 170px; }
  }