/* =====================================================
   Vigor – iStyle-style theme (Orange edition)
   ملف واحد بيحل محل: الـ CSS القديم + istyle-theme القديم.
   امسح القديمين وحمّل ده بس بعد الخطوط في الـ <head>.
   ===================================================== */

/* ---------- 0. Safety ---------- */
html, body { max-width: 100%; overflow-x: clip; margin: 0; padding: 0; }
#navbar, .header, .nav, .trust-bar { max-width: 100vw; }

/* ---------- 1. Tokens ---------- */
:root {
  --primary: #E1793A;
  --primary-dark: #C8621F;
  --primary-tint: #FDECE1;
  --text: #111111;
  --text-soft: #6e6e73;
  --muted: #8a8a8e;
  --soft: #f0f0f2;
  --bg-soft: #f5f5f7;
  --line: #e5e5e7;
  --container: 1160px;
  --font-latin: 'Plus Jakarta Sans', sans-serif;
  --font-arabic: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
}

html, body { font-family: var(--font-latin); color: var(--text); -webkit-font-smoothing: antialiased; }
html[lang^="ar"] body, html[dir="rtl"] body { font-family: var(--font-arabic); }
button, input, textarea, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@keyframes popIn {
  from { opacity: 0; transform: scale(.97) translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 2. Top banner ---------- */
#navbar { position: relative; background: #fff; }
.sticky-navigation-shell { position: relative; }
.sticky-navigation { background: #fff; }
.sticky-navigation.is-fixed { position: fixed; top: 0; right: 0; left: 0; z-index: 1000; }
.top-banner {
  background: var(--primary); color: #fff; height: 36px; padding: 0 16px;
  display: flex; align-items: center; justify-content: center;
}
.top-banner-text { font-size: 12px; font-weight: 700; }

/* ---------- 3. Header ---------- */
.header {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 32px;
  max-width: var(--container); margin: 0 auto; padding: 12px 24px 8px; border: 0;
}
.logo-area { display: flex; align-items: center; flex-shrink: 0; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 28px; font-weight: 800; letter-spacing: -1px; font-style: italic; color: var(--text); }
.logo span { color: var(--text); }
.brand-mark { display: block; width: 108px; height: auto; object-fit: contain; flex: none; }
.mobile-menu-toggle, .mobile-search-toggle { display: none; }

.search-bar { flex: 1; max-width: 400px; margin: 0 auto; }
.search-wrap {
  display: flex; align-items: center; gap: 14px;
  background: var(--soft); border-radius: 999px; padding: 12px 18px; color: var(--text-soft);
}
.search-wrap svg { flex: none; }
.search-wrap input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: 0;
  font-size: 15px; color: var(--text);
}
.search-wrap input::placeholder { color: var(--text-soft); }
.search-wrap:focus-within { box-shadow: 0 0 0 2px rgba(225,121,58,.35); }

.header-icons { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.header-icons svg { cursor: pointer; }
.account-wrap, .cart-wrap, .lang-switch-btn {
  position: relative; display: flex; align-items: center; cursor: pointer; color: var(--text); text-decoration: none;
}
.lang-switch-btn:hover, .account-wrap:hover, .cart-wrap:hover { color: var(--primary); }
.cart-badge {
  position: absolute; top: -8px; inset-inline-end: -10px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 4. Nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px max(0px, calc((100% - var(--container)) / 2)); border-bottom: 1px solid var(--line);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a { font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; transition: color .15s; }
.nav a:hover { color: var(--primary); }
.nav-category { position: relative; flex: 0 0 auto; }
.nav-category-trigger {
  display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 15px; font-weight: 700; white-space: nowrap; cursor: pointer;
  transition: color .15s;
}
.nav-category-trigger:hover, .nav-category.is-open .nav-category-trigger { color: var(--primary); }
.nav-category-trigger svg { width: 10px; height: 7px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform .15s; }
.nav-category.is-open .nav-category-trigger svg { transform: rotate(180deg); }
.nav-category-menu {
  position: fixed; z-index: 1100; width: 260px; max-height: min(70vh, 480px); overflow-y: auto; padding: 8px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.14);
}
.nav-category-menu[hidden] { display: none; }
.nav-category-menu a {
  display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 14px;
  font-weight: 500; text-decoration: none; white-space: normal;
}
.nav-category-menu a:hover { background: var(--bg-soft); color: var(--primary); }
.nav-category-menu .nav-category-all { margin-bottom: 5px; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; font-weight: 700; }
.nav-divider { width: 1px; height: 18px; background: #d2d2d7; flex-shrink: 0; }

/* ---------- 5. Trust bar ---------- */
.trust-bar { background: #fff; overflow: hidden; height: 40px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.trust-track { display: flex; direction: ltr; width: max-content; white-space: nowrap; will-change: transform; }
.trust-set { display: flex; align-items: center; flex-shrink: 0; }
.trust-item { font-size: 12.5px; font-weight: 500; color: var(--text); padding: 0 22px; flex-shrink: 0; }
.trust-sep { color: #777; flex-shrink: 0; }

/* ---------- 6. Buttons (hover زي iStyle: لون أغمق + underline) ---------- */
.btn {
  display: block; width: 100%; box-sizing: border-box; min-height: 50px; padding: 13px 18px; margin-top: 0;
  border-radius: 999px; border: 2px solid transparent; font-size: 15px; font-weight: 600;
  text-align: center; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { text-decoration: underline; text-underline-offset: 3px; }

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

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

/* ---------- 7. Dropdowns (shared) ---------- */
#cartDropdown, #accountDropdown {
  display: none; position: fixed; z-index: 1200;
  box-sizing: border-box; max-width: calc(100vw - 16px); max-height: 80vh; overflow-y: auto;
  background: #fff; padding: 24px; border: 1px solid #d2d2d7; border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,.14); animation: popIn .18s ease;
}
#cartDropdown { width: 404px; }
#accountDropdown { width: 320px; }

/* ---------- 7a. Authentication modal ---------- */
html.auth-modal-open, body.auth-modal-open { overflow: hidden; }
.auth-modal { display: none; position: fixed; inset: 0; z-index: 3000; place-items: center; padding: 20px; }
.auth-modal.is-open { display: grid; }
.auth-modal-backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  background: rgba(0,0,0,.42); backdrop-filter: blur(8px); cursor: default;
}
.auth-modal-dialog {
  position: relative; z-index: 1; width: min(540px, calc(100vw - 40px)); max-height: min(92vh, 820px);
  overflow-y: auto; padding: 28px 32px 32px; border: 1px solid #f0f0f2; border-radius: 24px;
  box-sizing: border-box; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.22); animation: popIn .22s ease;
}
.auth-modal-dialog, .auth-modal-dialog * { box-sizing: border-box; }
.auth-modal-close {
  position: absolute; top: 16px; inset-inline-end: 16px; display: grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg-soft);
  color: var(--text-soft); font-size: 25px; line-height: 1; cursor: pointer;
}
.auth-modal-close:hover { color: var(--text); background: var(--primary-tint); }
.auth-modal-header { display: flex; justify-content: center; padding: 4px 0 14px; }
.auth-modal-logo .brand-mark { width: 108px; }
.auth-modal-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 14px; background: var(--bg-soft); }
.auth-modal-tab {
  flex: 1; min-height: 42px; border: 0; border-radius: 11px; background: transparent;
  color: var(--text-soft); font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s ease;
}
.auth-modal-tab:hover { color: var(--text); }
.auth-modal-tab.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 5px rgba(0,0,0,.09); }
.auth-modal-view[hidden] { display: none; }
.auth-modal-intro { margin: 0 0 12px; text-align: center; }
.auth-modal-intro h2 { margin: 0; font-size: 21px; font-weight: 800; }
.auth-modal-intro p { margin: 5px 0 0; color: var(--text-soft); font-size: 13px; line-height: 1.55; }
.auth-modal-form { display: flex; flex-direction: column; gap: 12px; }
.auth-modal-name-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.auth-modal-grid-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-modal-field { min-width: 0; }
.auth-modal-field > label, .auth-modal-label-row > label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.auth-modal-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.auth-modal-label-row > a { color: var(--primary); font-size: 12px; font-weight: 700; text-decoration: none; }
.auth-modal-label-row > a:hover { text-decoration: underline; }
.auth-modal-field input:not([type="checkbox"]) {
  display: block; width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid transparent;
  border-radius: 12px; outline: 0; background: var(--bg-soft); color: var(--text); font: inherit; font-size: 14px;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.auth-modal-password-wrap { position: relative; }
.auth-modal-password-wrap input { padding-inline-end: 46px !important; }
.auth-modal-password-toggle {
  position: absolute; inset-inline-end: 8px; top: 50%; display: grid; width: 32px; height: 32px;
  place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-soft); cursor: pointer; transform: translateY(-50%);
}
.auth-modal-password-toggle:hover { background: rgba(0,0,0,.05); color: var(--text); }
.auth-modal-password-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.auth-modal-password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-modal-field input:not([type="checkbox"]):focus { border-color: rgba(225,121,58,.55); background: #fff; box-shadow: 0 0 0 3px rgba(225,121,58,.12); }
.auth-modal-field.has-error input:not([type="checkbox"]) { border-color: #c0392b; }
.auth-modal-error { margin: 5px 0 0; color: #a13d2e; font-size: 12px; line-height: 1.45; }
.auth-modal-alert { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #fff3f0; color: #a13d2e; font-size: 13px; }
.auth-modal-alert[hidden] { display: none; }
.auth-modal-submit:disabled { cursor: wait; opacity: .7; transform: none; }
.auth-modal-toast {
  position: fixed; z-index: 3100; inset-inline-end: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px));
  padding: 14px 18px; border-radius: 12px; background: #1f7a4d; color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.auth-modal-remember, .auth-modal-terms { display: flex; align-items: flex-start; gap: 8px; color: var(--text-soft); font-size: 12px; line-height: 1.6; }
.auth-modal-remember input, .auth-modal-terms input { flex: none; margin: 3px 0 0; accent-color: var(--primary); }
.auth-modal-terms a { color: var(--primary-dark); }
.auth-modal-terms-wrap { margin-top: -2px; }
.auth-modal-submit {
  width: 100%; min-height: 48px; padding: 12px 18px; border: 0; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .2s;
}
.auth-modal-submit:hover { background: var(--primary-dark); transform: translateY(-1px); }
.auth-modal-submit:active { transform: none; }

.dropdown-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dropdown-title { font-size: 18px; font-weight: 600; }
.dropdown-close-btn { background: none; border: 0; padding: 2px 6px; font-size: 20px; line-height: 1; color: var(--text); cursor: pointer; }
.dropdown-close-btn:hover { color: var(--primary); }

/* ---------- 8. Cart dropdown ---------- */
.cart-item { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.cart-item-img { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.cart-item-variant { margin: 0 0 4px; font-size: 12px; line-height: 1.7; color: #333; white-space: pre-line; } /* يدعم \n بين الـ Color/Model/Capacity */
.cart-item-price { margin: 0; font-size: 13px; color: var(--text); }
.cart-empty { text-align: center; color: var(--text-soft); padding: 28px 0; margin: 0; }

.cart-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.cart-continue { text-align: center; margin: 2px 0 0; }
.cart-continue a { font-size: 14px; color: var(--primary); text-decoration: none; }
.cart-continue a:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 9. Account dropdown ---------- */
.dropdown-guest-body { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.guest-avatar, .account-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--primary-tint); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.guest-welcome-title { margin: 0; font-size: 17px; font-weight: 700; }
.guest-welcome-sub { margin: 0 0 6px; max-width: 240px; font-size: 13px; line-height: 1.5; color: var(--text-soft); }
.guest-signup-link { margin: 2px 0 0; font-size: 13px; color: var(--text-soft); }
.guest-signup-link a { color: var(--primary); font-weight: 600; text-decoration: none; }
.guest-signup-link a:hover { color: var(--primary-dark); text-decoration: underline; }

.account-user { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.account-greeting { margin: 0; font-size: 12px; color: var(--muted); }
.account-name { margin: 2px 0 0; font-size: 15px; font-weight: 700; }
.account-menu { margin-bottom: 14px; }
.account-menu-link {
  display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-top: 1px solid var(--line);
  color: var(--text); font-size: 14px; text-decoration: none; transition: color .15s;
}
.account-menu-link:hover { color: var(--primary); }

/* ---------- 10. Hero (كلام لوحده + صورة لوحدها) ---------- */
.hero { position: relative; background: #fff; border-bottom: 1px solid var(--line); }
.hero-slide { display: none; }
.hero-slide.active { display: block; animation: heroFade .6s ease; }
@keyframes heroFade { from { opacity: 0; } to { opacity: 1; } }

.hero-inner {
  max-width: var(--container); min-height: 350px; margin: 0 auto; padding: 0 24px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 48px;
}
.hero-text { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.hero-badge { padding: 6px 16px; border-radius: 4px; background: var(--primary); color: #fff; font-size: 22px; font-weight: 800; }
.hero-title { max-width: 440px; margin: 0; font-size: 34px; font-weight: 800; line-height: 1.2; letter-spacing: -.5px; }
.hero-sub { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.7; white-space: pre-line; }
.hero-btn {
  margin-top: 6px; padding: 10px 30px; border: 1.5px solid var(--text); border-radius: 999px;
  color: var(--text); font-size: 16px; font-weight: 500; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s; width: fit-content;
}
/* .hero-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; } */

.hero-media { flex: 1 1 0; display: flex; justify-content: center; }
.hero-media img { display: block; width: 100%; max-width: 566px; height: 270px; object-fit: cover; border-radius: 12px; }

/* سلايد داكن (خلفية سودا ونص أبيض) */
.hero-slide.is-dark { color: #fff; }
.hero-slide.is-dark .hero-title, .hero-slide.is-dark .hero-sub { color: #fff; }
.hero-slide.is-dark .hero-btn { border-color: #fff; color: #fff; }
/* .hero-slide.is-dark .hero-btn:hover { background: var(--primary); border-color: var(--primary); } */
.hero-title { white-space: pre-line; }

/* النقط: pill أبيض على الخط السفلي للـ hero */
.hero-dots {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%);
  display: flex; align-items: center; gap: 18px; padding: 15px 24px;
  background: #fff; border-radius: 999px; box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 5;
}
.hero-dots .dot {
  width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%;
  background: #d2d2d7; cursor: pointer; transition: background .2s;
}
.hero-dots .dot:hover { background: #a1a1a6; }
.hero-dots .dot.active { background: var(--text); }

/* ---------- 11. Sections ---------- */
.section-divider { display: none; }

/* Categories */
.products-section { max-width: var(--container); margin: 0 auto; padding: 48px 24px 24px; }
.products-section h2 { margin: 0 0 28px; font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.products-scroll-wrap { position: relative; }
.products-row { display: flex; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding-bottom: 4px; }
.products-row::-webkit-scrollbar { display: none; }
.product-cat {
  display: flex; flex-direction: column; align-items: center; flex: none; width: 160px;
  padding: 8px 12px; text-align: center; text-decoration: none; color: var(--text);
}
.product-cat img { width: 96px; height: 88px; object-fit: contain; margin-bottom: 12px; transition: transform .2s; }
.product-cat:hover img { transform: translateY(-3px); }
.product-cat-name { margin-bottom: 2px; font-size: 16px; font-weight: 600; }
.product-cat-price {
  max-width: 150px; font-size: 13px; line-height: 1.4; color: var(--text-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.products-scroll-wrap .scroll-arrow {
  position: absolute; top: 0; bottom: 4px; width: 40px; z-index: 2; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s;
}
.products-scroll-wrap .scroll-arrow.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.products-scroll-wrap .scroll-arrow.right { inset-inline-end: 0; border-inline-start: 1px solid var(--line); }
.products-scroll-wrap .scroll-arrow.left  { inset-inline-start: 0; border-inline-end: 1px solid var(--line); }
.products-scroll-wrap .arrow-icon { font-size: 22px; line-height: 1; color: var(--text-soft); }
.products-scroll-wrap .scroll-arrow:hover .arrow-icon { color: var(--primary); }
html[dir="rtl"] .products-scroll-wrap .arrow-icon { display: inline-block; transform: scaleX(-1); }

/* Featured deals */
.new-section { margin-top: 32px; padding: 56px 24px 56px; border-top: 1px solid var(--line); }
.new-section > h2, .new-section > .new-cards-wrap { max-width: var(--container); margin-inline: auto; }
.new-section h2 { margin-bottom: 0;  font-size: 40px; font-weight: 700; letter-spacing: -.5px; }
.new-cards-wrap { position: relative; padding: 0 56px; }
.new-cards { display: flex; gap: 16px; overflow-x: auto; padding: 4px 0 12px; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; }
.new-cards::-webkit-scrollbar { display: none; }
.new-card {
  flex: 0 0 calc((100% - 48px) / 4); min-width: 0; box-sizing: border-box; padding: 12px 14px 16px;
  display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line);
  border-radius: 12px; text-align: center; scroll-snap-align: start;
}
.new-card-link { display: flex; flex: 1; flex-direction: column; width: 100%; color: inherit; text-decoration: none; }
.new-card-img { height: 210px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; }
.new-card-img img { width: 100%; max-width: 220px; max-height: 190px; object-fit: contain; }
.new-card-body { display: flex; flex: 1; flex-direction: column; width: 100%; padding: 0; }
.new-card-badges { display: flex; justify-content: center; gap: 5px; min-height: 18px; margin-bottom: 4px; }
.new-card-badge { font-size: 10px; font-weight: 800; line-height: 1.5; text-transform: uppercase; }
.new-card-badge.is-sale { color: #d4472c; }
.new-card-badge.is-stock { color: #247044; }
.new-card-badge.is-unavailable { color: #777; }
.new-card-name { min-height: 40px; font-size: 14px; font-weight: 700; }
.new-card-link:hover .new-card-name { color: var(--primary); }
.new-card-price { display: flex; justify-content: center; gap: 6px; margin: 7px 0 14px; font-size: 14px; font-weight: 700; }
.new-card-old-price { color: var(--text-soft); font-size: 12px; font-weight: 500; text-decoration: line-through; }
.new-card .add-to-cart-btn { min-height: 40px; margin-top: auto; padding: 9px 20px; font-size: 12px; }
.new-card .add-to-cart-btn:disabled { border-color: #c9c9c9; background: #c9c9c9; color: #fff; cursor: not-allowed; }

.add-to-cart-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; align-self: center;
  padding: 14px 34px; border: 2px solid var(--primary); border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.add-to-cart-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.add-to-cart-btn.is-loading { pointer-events: none; opacity: .85; }
.add-to-cart-btn .spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite;
}
.add-to-cart-btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.new-cards-wrap .scroll-arrow {
  position: absolute; top: 130px; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border-radius: 50%; background: var(--primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s, background .15s;
}
.new-cards-wrap .scroll-arrow.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.new-cards-wrap .scroll-arrow:hover { background: var(--primary-dark); }
.new-cards-wrap .scroll-arrow.right { inset-inline-end: 0; }
.new-cards-wrap .scroll-arrow.left  { inset-inline-start: 0; }
.new-cards-wrap .arrow-icon { font-size: 28px; line-height: 1; color: #fff; }
html[dir="rtl"] .new-cards-wrap .arrow-icon { display: inline-block; transform: scaleX(-1); }

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

/* ---------- 13. Tablet ---------- */
@media (max-width: 992px) {
  .header { padding: 18px 20px 12px; gap: 16px; }
  .header-icons { gap: 16px; }
  .search-bar { max-width: 320px; }
  .nav { justify-content: flex-start; gap: 32px; padding: 14px 20px; }
  .products-section { padding-top: 40px; }
  #site-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
}

/* ---------- 14. Mobile ---------- */
@media (max-width: 768px) {
  .header { flex-wrap: nowrap; gap: 12px; padding: 12px 16px; }
  .mobile-menu-toggle {
    display: flex; width: 32px; height: 32px; padding: 7px 5px; flex: none;
    flex-direction: column; justify-content: center; gap: 4px;
    border: 0; border-radius: 4px; background: transparent; color: var(--text); cursor: pointer;
  }
  .mobile-menu-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
  .mobile-menu-toggle.is-open span:first-child { transform: translateY(6px) rotate(45deg); }
  .mobile-menu-toggle.is-open span:nth-child(2) { opacity: 0; }
  .mobile-menu-toggle.is-open span:last-child { transform: translateY(-6px) rotate(-45deg); }
  .logo-area { order: 1; min-width: 0; }
  .logo .brand-mark { width: 82px; }
  .header-icons { order: 2; margin-inline-start: auto; gap: 12px; }
  .mobile-search-toggle {
    display: flex; width: 28px; height: 32px; padding: 3px; flex: none;
    align-items: center; justify-content: center;
    border: 0; background: transparent; color: inherit; cursor: pointer;
  }
  .search-bar { display: none; }
  .header.mobile-search-open .search-bar {
    display: block; position: absolute; z-index: 30; inset-inline: 12px; top: calc(100% - 2px);
    max-width: none; padding: 8px; border: 1px solid var(--line); background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
  }
  .header.mobile-search-open .search-wrap { padding: 10px 12px; }
  .nav { display: none; gap: 0; padding: 8px 16px; border-bottom: 1px solid var(--line); }
  .nav.is-open { display: flex; flex-direction: column; align-items: stretch; }
  .nav > a, .nav-category-trigger { width: 100%; min-height: 44px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: start; }
  .nav-category-trigger { justify-content: space-between; }
  .nav-category-menu {
    position: static; width: auto; max-height: none; overflow: visible; padding: 4px 8px 8px;
    border: 0; border-radius: 0; background: var(--bg-soft); box-shadow: none;
  }
  .nav-category-menu a { padding: 10px 12px; }
  .nav-category-menu .nav-category-all { border-bottom-color: var(--line); }
  .nav-divider { display: none; }
  .nav > a, .nav-category-trigger { font-size: 14px; }
  .trust-item { font-size: 12px; padding: 0 14px; }

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

  .hero-inner { flex-direction: column; min-height: 0; gap: 20px; padding: 28px 16px 40px; }
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 16px; }
  .hero-media { width: 100%; }
  .hero-media img { height: 200px; max-width: 100%; }
  .hero-dots { gap: 12px; padding: 11px 16px; }
  .hero-dots .dot { width: 8px; height: 8px; }

  .products-section { padding: 48px 16px 16px; }
  .products-section h2, .new-section h2 { font-size: 26px; }
  .new-section { padding: 40px 16px; }
  .new-cards-wrap { padding: 0 4px; }
  .new-card { flex-basis: calc((100% - 12px) / 2); }
  .new-card-img { height: 170px; }
  .new-card-img img { max-height: 155px; }
  .new-cards-wrap .scroll-arrow { display: none; }

  #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-inline: auto; }
  #site-footer .footer-links { align-items: center; }
  #site-footer .footer-social, #site-footer .footer-bottom-links { justify-content: center; }
  #site-footer .footer-bottom { flex-direction: column; text-align: center; gap: 10px; }
}

/* ---------- 15. Small mobile ---------- */
@media (max-width: 480px) {
  .header { gap: 8px; padding: 10px 12px; }
  .logo .brand-mark { width: 74px; }
  .header-icons { gap: 9px; }
  .header-icons svg { width: 19px; height: 19px; }
  .search-wrap { padding: 9px 16px; }
  .search-wrap input { font-size: 14px; }
  .nav > a, .nav-category-trigger { font-size: 13px; }
  .hero-title { font-size: 22px; }
  .hero-badge { font-size: 18px; }
  .hero-media img { height: 170px; }
  #accountDropdown, #cartDropdown { width: calc(100vw - 16px); }
  .auth-modal { padding: 10px; }
  .auth-modal-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 22px 18px 24px; border-radius: 20px; }
  .auth-modal-header { padding-bottom: 16px; }
  .auth-modal-tabs { margin-bottom: 18px; }
  .auth-modal-name-row, .auth-modal-grid-row { grid-template-columns: 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide.active, #cartDropdown, #accountDropdown { animation: none; }
  * { scroll-behavior: auto !important; }
}
