/* ==========================================================================
   FONTS — self-hosted Tajawal (no fonts.googleapis.com)
   Files: assets/fonts/tajawal/*.woff2
   Weights match what the design actually uses: 400 body, 500 medium,
   700 bold, 800 extrabold. `font-display: swap` so text paints immediately
   in the fallback and re-renders when Tajawal arrives (no invisible text).
   The path is relative to this file, so it resolves the same whether the
   file sits in the design bundle or under the app's asset folder — keep
   design.css and the fonts/ folder as siblings when moving them.
   ========================================================================== */

/* The -v2 files are Tajawal with its hhea and typo ascent/descent set equal to its Windows (win) values. As shipped,
   Windows and phones read different numbers, so text sat about 0.2em higher on Android, iOS and macOS. */
@font-face{
  font-family:"Tajawal";
  src:url("../fonts/tajawal/Tajawal-Regular-v2.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Tajawal";
  src:url("../fonts/tajawal/Tajawal-Medium-v2.woff2") format("woff2");
  font-weight:500; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Tajawal";
  src:url("../fonts/tajawal/Tajawal-Bold-v2.woff2") format("woff2");
  font-weight:700; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Tajawal";
  src:url("../fonts/tajawal/Tajawal-ExtraBold-v2.woff2") format("woff2");
  font-weight:800; font-style:normal; font-display:swap;
}

/* ==========================================================================
   DESIGN TOKENS — Brand palette, radii, shadows, spacing, type scale
   File: assets/css/design.css
   Refactor target: assets/css/design.css (root of the design system)
   ========================================================================== */

:root{
  /* Brand */
  --color-primary:        #022F40;  /* petrol teal — main brand */
  --color-primary-700:    #063F52;
  --color-accent:         #E95A2C;  /* brand orange — highlights, active, badges */
  --color-cta:            #D24A1C;  /* deeper orange — buttons w/ white text (AA safe) */
  --color-cta-700:        #B23C14;

  /* Surfaces & text */
  --color-bg:             #F4F5F5;  /* page background (brand grey family) */
  --color-surface:        #FFFFFF;  /* cards, panels */
  --color-surface-2:      #F1F2F2;  /* recessed fields */
  --color-text-primary:   #16262E;  /* body text (dark teal-ink) */
  --color-text-secondary: #586468;  /* muted labels, captions */
  --color-border:         #E6E8E9;  /* dividers */

  /* Semantic */
  --color-deal:           #E23B3B;  /* discount badges */
  --color-gold:           #F0A63A;  /* rating stars */
  --color-good:           #1F8A6B;  /* success / available */
  --color-danger-light:   #fbddda;
  --color-danger-solid:   #fc3c2e;

  /* Shape */
  --radius-card:          18px;
  --radius-sm:            12px;
  --radius-pill:          999px;
  --shadow-card:          0 6px 20px rgba(2,47,64,.08);
  --shadow-card-hover:    0 14px 32px rgba(2,47,64,.14);
  --shadow-pop:           0 18px 44px rgba(2,47,64,.20);

  /* Type scale */
  --fs-hero:   2rem;      /* 32px */
  --fs-h1:     1.6rem;    /* 26px */
  --fs-h2:     1.3rem;    /* 21px */
  --fs-h3:     1.06rem;   /* 17px */
  --fs-body:   1.01rem;   /* 15px */
  --fs-sm:     0.90rem;   /* 14px */
  --fs-xs:     0.82rem;   /* 13px */

  --header-h:  68px;
}

/* Dark mode tokens (viewer preference) */
@media (prefers-color-scheme:dark){
  :root{
    --color-bg:#02171F; --color-surface:#062B39; --color-surface-2:#0A3341;
    --color-text-primary:#EAF1F3; --color-text-secondary:#93A7AE; --color-border:#123B49;
    --color-primary:#0A5A72; --color-accent:#F26B3C; --color-cta:#E85E2C; --color-cta-700:#C64A1C;
    --shadow-card:0 6px 20px rgba(0,0,0,.4); --shadow-card-hover:0 14px 32px rgba(0,0,0,.5);
  }
}

/* Explicit theme overrides (win over the media query when set on <html>) */
:root[data-theme="light"]{
  --color-bg:#F4F5F5; --color-surface:#FFFFFF; --color-surface-2:#F1F2F2;
  --color-text-primary:#16262E; --color-text-secondary:#535f63; --color-border:#E6E8E9;
  --color-primary:#022F40; --color-primary-700:#063F52; --color-accent:#E95A2C; --color-cta:#D24A1C; --color-cta-700:#B23C14;
  --color-deal:#E23B3B; --color-gold:#F0A63A; --color-good:#1F8A6B;
  --shadow-card:0 6px 20px rgba(2,47,64,.08); --shadow-card-hover:0 14px 32px rgba(2,47,64,.14);
}
:root[data-theme="dark"]{
  --color-bg:#02171F; --color-surface:#062B39; --color-surface-2:#0A3341;
  --color-text-primary:#EAF1F3; --color-text-secondary:#93A7AE; --color-border:#123B49;
  --color-primary:#0A5A72; --color-accent:#F26B3C; --color-cta:#E85E2C; --color-cta-700:#C64A1C;
  --color-deal:#E23B3B; --color-gold:#F0A63A; --color-good:#1F8A6B;
  --shadow-card:0 6px 20px rgba(0,0,0,.4); --shadow-card-hover:0 14px 32px rgba(0,0,0,.5);
}

/* ==========================================================================
   BASE — Document defaults, box-sizing, body, links, focus
   File: assets/css/design.css
   Refactor target: assets/css/design.css
   ========================================================================== */

*,*::before,*::after{ box-sizing:border-box; }

html{ scroll-behavior:smooth; overflow-x:clip; }
body{ overflow-x:clip; }

body{
  margin:0;
  font-family:"Tajawal", -apple-system, system-ui, "Segoe UI", Tahoma, sans-serif;
  font-size:var(--fs-body);
  line-height:1.6;
  color:var(--color-text-primary);
  background:var(--color-bg);
  -webkit-font-smoothing:antialiased;
}

img{ max-width:100%; display:block; }

a{ color:inherit; text-decoration:none; }

/* Directional icons mirror in RTL */
html[dir="rtl"] .icon-directional{ transform:scaleX(-1); }

/* Body scroll lock when a sheet/modal is open.
   overflow:clip prevents scroll without creating a BFC, so position:sticky
   keeps working. Fallback to hidden for browsers that don't support clip. */
body.no-scroll{ overflow:hidden; }
@supports (overflow:clip){ body.no-scroll{ overflow:clip; } }

@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto; }
  *{ transition:none !important; animation:none !important; }
}

/* ==========================================================================
   TYPOGRAPHY — Headings, section titles, muted text, prices
   File: assets/css/design.css
   Refactor target: assets/css/design.css
   ========================================================================== */

h1,h2,h3,h4{ margin:0 0 .4em; font-weight:700; line-height:1.25; text-wrap:balance; color:var(--color-text-primary); }
h1{ font-size:var(--fs-h1); }
h2{ font-size:var(--fs-h2); }
h3{ font-size:var(--fs-h3); }

.text-muted-2{ color:var(--color-text-secondary); }
.eyebrow{ font-size:var(--fs-xs); letter-spacing:.12em; text-transform:uppercase; color:var(--color-text-secondary); font-weight:700; }

.section-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin:6px 0 14px; }
.section-head h2{ margin:0; }
.section-head .see-all{ color:var(--color-cta); font-weight:700; font-size:var(--fs-sm); white-space:nowrap; }

.price{ font-weight:800; color:var(--color-text-primary); }
.price small{ font-weight:600; color:var(--color-text-secondary); font-size:var(--fs-xs); }
.price .strike{ color:var(--color-text-secondary); font-size:var(--fs-sm); text-decoration:line-through; font-weight:600; }

/* ==========================================================================
   BUTTONS — Primary CTA, teal, ghost, pill, icon buttons
   File: assets/css/design.css
   Refactor target: assets/css/design.css
   ========================================================================== */

.btn-cta{
  --bs-btn-focus-box-shadow:none;
  background:var(--color-cta); color:#fff; border:0; font-weight:700;
  border-radius:var(--radius-sm); padding:12px 22px; cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-cta:hover{ background:var(--color-cta-700); color:#fff; }
.btn-cta:active{ transform:translateY(1px); }

.btn-teal{
  background:var(--color-primary); color:#fff; border:0; font-weight:700;
  border-radius:var(--radius-sm); padding:12px 22px; cursor:pointer; transition:.2s ease;
}
.btn-teal:hover{ background:var(--color-primary-700); color:#fff; }

.btn-ghost{
  background:var(--color-surface); color:var(--color-text-primary);
  border:1.5px solid var(--color-border); font-weight:700;
  border-radius:var(--radius-sm); padding:11px 18px; cursor:pointer; transition:.2s ease;
}
.btn-ghost:hover{ border-color:var(--color-accent); color:var(--color-accent); }

.btn-ghost-bordered{
  background:var(--color-surface); color:var(--color-cta);
  border:1.5px solid var(--color-cta); font-weight:700;
  border-radius:var(--radius-sm); padding:11px 18px; cursor:pointer; transition:.2s ease;
}
.btn-ghost-bordered:hover{ color:var(--color-surface); background: var(--color-cta); }

/* ── Button loading state ─────────────────────────────────────────────────
   Usage: add class "btn-loading" to any button that has:
     <span class="btn-label">متابعة</span>
     <span class="btn-spinner"><span class="spinner-border spinner-border-sm"></span></span>
   The spinner hides by default; .btn-loading shows it + hides label.

   .is-loading is the same treatment under a generic name — http.js's Http.get/post
   toggles this on whatever loader element a caller passes, which isn't always a
   button, so the class name itself stays element-agnostic. A button with the
   .btn-label/.btn-spinner markup gets the identical spinner either way; a future
   non-button loading state is free to give .is-loading its own rules elsewhere
   without colliding with button-specific markup requirements.                  */
.btn-spinner { display: none; }
.btn-loading,
.is-loading {
  position: relative;
  pointer-events: none;
  cursor: not-allowed;
}
.btn-loading .btn-label,
.is-loading .btn-label { opacity: 0; }
.btn-loading .btn-spinner,
.is-loading .btn-spinner {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}

.icon-btn{
  width:42px; height:42px; border:0; border-radius:var(--radius-sm);
  background:var(--color-surface-2); color:var(--color-text-primary);
  display:grid; place-items:center; cursor:pointer; font-size:1.05rem; transition:.2s ease;
}
.icon-btn.round{ border-radius:50%; }
.icon-btn:hover{ background:var(--color-border); }

/* ==========================================================================
   UTILITIES — Helpers not covered by Bootstrap or a component
   File: assets/css/design.css
   Refactor target: assets/css/design.css (utilities section)
   ========================================================================== */

.container-app{ max-width:1200px; margin-inline:auto; padding-inline:16px; }
.hide-scroll{ scrollbar-width:none; -ms-overflow-style:none; }
.hide-scroll::-webkit-scrollbar{ display:none; }
.rounded-card{ border-radius:var(--radius-card); }
.chip-pill{
  display:inline-flex; align-items:center; gap:7px; padding:9px 15px; border-radius:var(--radius-sm);
  background:var(--color-surface-2); border:1px solid var(--color-border);
  color:var(--color-text-primary); font-size:var(--fs-sm); font-weight:700; cursor:pointer; white-space:nowrap;
}
.chip-pill.active{ background:var(--color-accent); border-color:transparent; color:#fff; }
.badge-deal{
  background:var(--color-deal); color:#fff; font-size:var(--fs-xs); font-weight:800;
  padding:3px 8px; border-radius:8px;
}
.badge-instant{
  display:inline-flex; align-items:center; gap:5px; background:rgba(2,47,64,.9); color:#fff;
  font-size:var(--fs-xs); font-weight:700; padding:4px 9px; border-radius:8px;
}
.rating-inline{ display:inline-flex; align-items:center; gap:5px; font-weight:700; }
.rating-inline .fa-star{ color:var(--color-gold); }
.rating-inline .count{ color:var(--color-text-secondary); font-weight:600; font-size:var(--fs-sm); }
.bg-accent { background: var(--color-cta); border-color: var(--color-cta); color: #fff}
.bg-accent-hover:hover { background: var(--color-accent); color: #fff; }
.bg-accent-hover:hover > * { color: #fff; }