/* ============================================================================
   Affinity Clinics — core stylesheet
   Single codebase for RTL (Arabic) + LTR (English) using CSS Logical Properties.
   Brand: Gold/Brown #AD8041 · Black #0C0D0D · Beige #EDC0A2 · Blue #9AE5D7.
   Display/body: Montserrat (LTR) / CAREEM (RTL, with graceful fallbacks).
   ========================================================================== */

/* ---- Fonts -------------------------------------------------------------- */
/* Licensed brand fonts are loaded locally when present (drop the files into
   /public/assets/fonts/ — see README). Until then we fall back to close web
   equivalents (Montserrat for Latin, Cairo for Arabic) loaded in the layout. */
@font-face {
  font-family: "CAREEM";
  src: url("/assets/fonts/Careem-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "CAREEM";
  src: url("/assets/fonts/Careem-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---- Design tokens ------------------------------------------------------ */
:root {
  --gold:        #AD8041;
  --gold-soft:   #C29A5E;
  --gold-tint:   #F3E9DA;
  --black:       #0C0D0D;
  --beige:       #EDC0A2;
  --blue:        #9AE5D7;
  --gray:        #BCBCBC;

  --paper:       #FBFAF8;
  --paper-2:     #F4F0EA;
  --ink:         #1A1717;
  --ink-soft:    #5B5550;
  --line:        #E7DFD4;
  --line-strong: #D8CCBC;

  --font-latin:  "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "CAREEM", "Cairo", "Tajawal", system-ui, sans-serif;

  --maxw: 1200px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --radius: 4px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(12,13,13,.06), 0 8px 30px rgba(12,13,13,.06);
  --shadow-gold: 0 10px 40px rgba(173,128,65,.22);

  --step--1: clamp(.82rem, .78rem + .2vw, .9rem);
  --step-0:  clamp(1rem, .96rem + .2vw, 1.08rem);
  --step-1:  clamp(1.2rem, 1.1rem + .5vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4:  clamp(2.6rem, 2rem + 3.4vw, 4.6rem);
}

/* Default to Latin; flip to Arabic font on RTL documents. */
html { font-family: var(--font-latin); }
html[dir="rtl"] { font-family: var(--font-arabic); }
html[dir="rtl"] body { letter-spacing: 0; }

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
img, picture, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }

/* Numbers should always render LTR even inside Arabic (Bidi safety). */
.ltr-nums, .phone, time, .price { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .phone { display: inline-block; }

/* ---- Layout helpers ----------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.5rem, 7vw, 7rem); }
.section--tint { background: var(--paper-2); }
.section--dark { background: var(--black); color: #F1ECE4; }
.eyebrow {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--gold);
  font-weight: 600;
}
html[dir="rtl"] .eyebrow { letter-spacing: .04em; }
.section-head { max-width: 56ch; margin-block-end: clamp(2rem, 4vw, 3.25rem); }
.section-head h2 { font-size: var(--step-3); margin-block: .4rem .6rem; }
.section-head p { color: var(--ink-soft); font-size: var(--step-1); }
.lead { font-size: var(--step-1); color: var(--ink-soft); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  --bg: var(--gold); --fg: #fff;
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--bg); color: var(--fg);
  padding-block: .85rem; padding-inline: 1.6rem;
  border: 1px solid var(--bg); border-radius: 999px;
  font-weight: 600; font-size: var(--step-0); cursor: pointer;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { box-shadow: var(--shadow-gold); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); box-shadow: none; }
.btn--on-dark { --bg: transparent; --fg: #fff; border-color: rgba(255,255,255,.35); }
.btn--on-dark:hover { background: #fff; color: var(--black); border-color:#fff; }
.btn--block { width: 100%; justify-content: center; }
.btn--lg { padding-block: 1rem; padding-inline: 2rem; }

/* ---- Header / Nav ------------------------------------------------------- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 50;
  background: rgba(251,250,248,.86);
  backdrop-filter: saturate(140%) blur(12px);
  border-block-end: 1px solid var(--line);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.site-header.is-scrolled {
  border-block-end-color: transparent;
  box-shadow: 0 1px 2px rgba(12,13,13,.04), 0 12px 30px -18px rgba(12,13,13,.25);
}
.nav {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 76px;
}
/* Brand-book rule: logo aligns to the start of the text direction.
   RTL → start is the right; LTR → start is the left. Logical props do this. */
.brand { display: inline-flex; align-items: center; gap: .7rem; margin-inline-end: auto; }
.brand__mark {
  inline-size: 40px; block-size: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, var(--gold-soft), var(--gold));
  color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: .02em;
  box-shadow: var(--shadow-gold);
}
.brand__name { font-weight: 700; font-size: 1.18rem; letter-spacing: .01em; }
.brand__name small { display: block; font-size: .62rem; font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
html[dir="rtl"] .brand__name small { letter-spacing: .04em; }

.nav__links { display: flex; align-items: center; gap: 1.35rem; }
.nav__links a { font-size: var(--step--1); font-weight: 500; color: var(--ink-soft);
  padding-block: .3rem; position: relative; }
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--gold); }
.nav__links a::after {
  content: ""; position: absolute; inset-block-end: -2px; inset-inline-start: 0;
  inline-size: 0; block-size: 2px; background: var(--gold); transition: inline-size .2s ease;
}
.nav__links a:hover::after, .nav__links a.is-active::after { inline-size: 100%; }
.nav__links-actions.mobile-only-action { display: none; }

.nav__actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line-strong); background: transparent;
  border-radius: 999px; padding: .4rem .85rem; font-size: var(--step--1);
  font-weight: 600; cursor: pointer; color: var(--ink-soft);
  transition: border-color .15s ease, color .15s ease;
}
.lang-toggle:hover { border-color: var(--gold); color: var(--gold); }
.lang-toggle .ic { font-size: 1.05em; opacity: .75; }

.nav__divider {
  inline-size: 1px; block-size: 24px; background: var(--line-strong);
  margin-inline: .15rem;
}

.nav__icon-btn {
  display: inline-grid; place-items: center;
  inline-size: 40px; block-size: 40px; border-radius: 50%;
  border: 1px solid var(--line-strong); color: var(--ink-soft);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.nav__icon-btn .ic { font-size: 1.15rem; }
.nav__icon-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-tint); }

.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav__toggle span { display: block; inline-size: 24px; block-size: 2px; background: var(--ink);
  margin-block: 5px; transition: .25s; }

/* ---- Hero --------------------------------------------------------------- */
.hero { position: relative; background: var(--black); color: #F4EFE7; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 85% -10%, rgba(173,128,65,.45), transparent 60%),
    radial-gradient(50% 60% at 0% 110%, rgba(154,229,215,.12), transparent 55%);
  pointer-events: none;
}
.hero__inner {
  position: relative; display: grid; gap: clamp(2rem,5vw,4rem);
  grid-template-columns: 1.1fr .9fr; align-items: center;
  padding-block: clamp(4rem, 9vw, 8rem);
}
.hero__title { font-size: var(--step-4); letter-spacing: -.02em; }
.hero__title .accent {
  background: linear-gradient(90deg, var(--gold-soft), var(--beige));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { margin-block: 1.4rem 2rem; max-width: 46ch; color: #CFC7BC; font-size: var(--step-1); }
.hero__cta { display: flex; flex-wrap: wrap; gap: .9rem; }
.hero__aside {
  position: relative; aspect-ratio: 4/5; border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(173,128,65,.25), rgba(12,13,13,.1)),
    var(--paper-2);
  border: 1px solid rgba(255,255,255,.12);
  display: grid; place-items: center; overflow: hidden;
}
.hero__seal {
  inline-size: min(58%, 230px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.4); display: grid; place-items: center;
  text-align: center; color: #F4EFE7;
}
.hero__seal b { font-size: 3rem; color: var(--gold-soft); display: block; }
.hero__seal span { font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; }
html[dir="rtl"] .hero__seal span { letter-spacing: .05em; }
.hero__stats { display: flex; gap: 2rem; margin-block-start: 2.5rem; }
.hero__stats div b { font-size: var(--step-2); color: #fff; display: block; }
.hero__stats div span { font-size: var(--step--1); color: #B7AFA4; }

/* ---- Cards / grids ------------------------------------------------------ */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow-gold); }
.card__media { aspect-ratio: 3/2; background: var(--paper-2); position: relative; }
.card__media--mono { background: linear-gradient(135deg, var(--gold-tint), var(--paper-2)); }
.card__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__cat { font-size: var(--step--1); color: var(--gold); font-weight: 600; letter-spacing: .04em; }
.card__title { font-size: var(--step-1); }
.card__text { color: var(--ink-soft); font-size: var(--step--1); flex: 1; }
.card__price { font-weight: 700; color: var(--ink); }
.card__foot { margin-block-start: .6rem; }
.card__link { color: var(--gold); font-weight: 600; font-size: var(--step--1); display: inline-flex; gap: .35rem; }
.card__link::after { content: "→"; transition: transform .2s ease; }
html[dir="rtl"] .card__link::after { content: "←"; }
.card:hover .card__link::after { transform: translateX(3px); }
html[dir="rtl"] .card:hover .card__link::after { transform: translateX(-3px); }

/* ---- Reviews (Facebook Page Plugin embed) ------------------------------- */
.fb-mark {
  display: inline-grid; place-items: center;
  inline-size: 1.4em; block-size: 1.4em; border-radius: 50%;
  background: #1877F2; color: #fff; font-weight: 700; font-family: Georgia, serif; font-style: italic;
  font-size: .95em; flex: none;
}
.google-mark {
  display: inline-grid; place-items: center;
  inline-size: 1.4em; block-size: 1.4em; border-radius: 50%;
  background: #4285F4; color: #fff; font-weight: 700; font-family: Georgia, serif;
  font-size: .95em; flex: none;
}
.google-rating-badge { gap: .4rem; }
.fb-reviews-embed {
  margin-block-start: clamp(1.8rem, 4vw, 2.6rem);
  display: flex; justify-content: center; overflow-x: auto;
}
.fb-reviews-embed .fb-page,
.fb-reviews-embed span,
.fb-reviews-embed iframe { max-width: 100%; }

/* ---- Before / After slider (signature element) ------------------------- */
.ba { display: grid; gap: 1.5rem; }
.ba-slider {
  position: relative; inline-size: 100%; aspect-ratio: 3/2;
  border-radius: var(--radius-lg); overflow: hidden; user-select: none;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  touch-action: pan-y;
}
.ba-slider img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.ba-slider .ba-after { clip-path: inset(0 0 0 var(--pos, 50%)); }
html[dir="rtl"] .ba-slider .ba-after { clip-path: inset(0 var(--pos, 50%) 0 0); }
.ba-seam {
  position: absolute; inset-block: 0; inset-inline-start: var(--pos, 50%);
  inline-size: 2px; background: var(--gold); transform: translateX(-1px);
}
.ba-handle {
  position: absolute; inset-block-start: 50%; inset-inline-start: var(--pos, 50%);
  transform: translate(-50%, -50%);
  inline-size: 46px; block-size: 46px; border-radius: 50%;
  background: var(--gold); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-gold); cursor: ew-resize; font-size: .9rem;
}
.ba-handle::before { content: "⇆"; }
.ba-tag {
  position: absolute; inset-block-end: .8rem; padding: .25rem .7rem; border-radius: 999px;
  font-size: var(--step--1); font-weight: 600; background: rgba(12,13,13,.7); color: #fff;
  backdrop-filter: blur(4px);
}
.ba-tag--before { inset-inline-start: .8rem; }
.ba-tag--after  { inset-inline-end: .8rem; background: var(--gold); }
.ba-range { position: absolute; inset: 0; inline-size: 100%; opacity: 0; cursor: ew-resize; }

/* ---- CTA band ----------------------------------------------------------- */
.cta-band {
  background: linear-gradient(120deg, var(--black), #211c16 70%, var(--gold) 220%);
  color: #fff; border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem); display: flex; flex-wrap: wrap; gap: 1.5rem;
  align-items: center; justify-content: space-between;
}
.cta-band h2 { font-size: var(--step-2); }
.cta-band p { color: #CFC7BC; }

/* ---- Forms -------------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  inline-size: 100%; padding: .8rem .9rem; background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-block-size: 120px; resize: vertical; }
.field--invalid label { color: #c0392b; }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: #c0392b; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(173,128,65,.18);
}
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.check { display: flex; align-items: center; gap: .6rem; }
.check input { inline-size: 18px; block-size: 18px; }

.auth-wrap { display: grid; place-items: center; min-block-size: calc(100dvh - 76px); padding-block: 3rem; }
.auth-card {
  inline-size: min(440px, 100%); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1.6rem, 4vw, 2.5rem); box-shadow: var(--shadow);
}
.auth-card h1 { font-size: var(--step-2); margin-block-end: .3rem; }
.auth-card .muted { color: var(--ink-soft); margin-block-end: 1.5rem; font-size: var(--step--1); }
.divider { display: flex; align-items: center; gap: 1rem; color: var(--ink-soft);
  font-size: var(--step--1); margin-block: 1.3rem; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.oauth { display: grid; gap: .7rem; }
.oauth .btn { justify-content: center; }
.swap-line { text-align: center; margin-block-start: 1.3rem; font-size: var(--step--1); color: var(--ink-soft); }
.swap-line a { color: var(--gold); font-weight: 600; }

/* ---- Flash / alerts ----------------------------------------------------- */
.alert { padding: .9rem 1.1rem; border-radius: var(--radius); font-size: var(--step--1);
  border-inline-start: 3px solid var(--gold); background: var(--gold-tint); color: #5a4422; }
.alert--ok { border-color: #2e7d52; background: #e9f5ee; color: #1f5638; }
.alert--err { border-color: #c0392b; background: #fbeceb; color: #7d241b; }

/* ---- Tables (admin) ----------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background:#fff; }
table.data { inline-size: 100%; border-collapse: collapse; font-size: var(--step--1); }
table.data th, table.data td { padding: .85rem 1rem; text-align: start; border-block-end: 1px solid var(--line); }
table.data th { background: var(--paper-2); font-weight: 600; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }
table.data tr:last-child td { border-block-end: 0; }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge--on { background: #e9f5ee; color: #1f5638; }
.badge--off { background: #f1eee9; color: var(--ink-soft); }

/* ---- Page header -------------------------------------------------------- */
.page-hero { background: var(--black); color: #F4EFE7; padding-block: clamp(3rem,6vw,5rem); }
.page-hero h1 { font-size: var(--step-3); }
.page-hero p { color: #CFC7BC; margin-block-start: .5rem; max-width: 60ch; }
.crumb { font-size: var(--step--1); color: var(--gold); letter-spacing: .04em; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { background: var(--black); color: #C7BFB4; padding-block: clamp(3rem,5vw,4.5rem) 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.1fr; gap: 2.5rem; }
.site-footer h4 { color: #fff; font-size: var(--step-0); margin-block-end: .9rem; letter-spacing: .02em; }
.site-footer a:hover { color: var(--gold-soft); }
.footer-links { display: grid; gap: .5rem; font-size: var(--step--1); }
.footer-contact { font-size: var(--step--1); display: grid; gap: .5rem; }
.footer-bottom { margin-block-start: 2.5rem; padding-block-start: 1.5rem; border-block-start: 1px solid rgba(255,255,255,.1);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: var(--step--1); color: #8d847a; }

/* ---- Detail prose ------------------------------------------------------- */
.prose { max-width: 70ch; }
.prose p { margin-block: 1rem; }
.detail-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: clamp(1.5rem,4vw,3rem); align-items: start; }
.side-card { background:#fff; border:1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem; position: sticky; inset-block-start: 96px; box-shadow: var(--shadow); }

/* ---- Utilities ---------------------------------------------------------- */
.stack > * + * { margin-block-start: 1rem; }
.center { text-align: center; }
.mt-2 { margin-block-start: 2rem; } .mt-1 { margin-block-start: 1rem; }
.muted { color: var(--ink-soft); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__aside { display: none; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav__links, .nav__actions .desktop-only { display: none; }
  .nav__toggle { display: block; }
  /* Mobile: brand centers (brand-book allowance for confined spaces). */
  .nav { justify-content: space-between; }
  .nav.is-open .nav__links {
    display: flex; flex-direction: column; align-items: flex-start;
    position: absolute; inset-inline: 0; inset-block-start: 76px;
    background: var(--paper); border-block: 1px solid var(--line);
    padding: 1rem var(--gutter); gap: .9rem;
  }
  /* Login/Account, "Add to Contacts" and Book are icon/desktop-only buttons in
     .nav__actions and never appear once that row collapses — so the flyout
     carries its own copies (see .nav__links-actions in nav.php) instead. */
  .nav__links-actions.mobile-only-action {
    display: flex; flex-direction: column; align-items: stretch; gap: .7rem;
    inline-size: 100%; margin-block-start: .4rem; padding-block-start: .9rem;
    border-block-start: 1px solid var(--line);
  }
  .nav__links-actions.mobile-only-action a { font-size: var(--step--1); font-weight: 500; }
  .grid--3, .grid--4, .grid--2, .field--row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}

/* ---- A11y --------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.skip-link { position: absolute; inset-inline-start: -999px; }
.skip-link:focus { inset-inline-start: 1rem; inset-block-start: 1rem; z-index: 200;
  background: #fff; padding: .6rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Honeypot field for public forms — invisible to sighted users, left in the
   tab/DOM flow so basic bots that fill every input still trip it. */
.hp-field { position: absolute; inset-inline-start: -9999px; inline-size: 1px; block-size: 1px; overflow: hidden; }

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

/* ---- Icon system --------------------------------------------------------- */
/* Self-hosted line icons (see icon() in app/Core/helpers.php) — no external
   icon font/CDN, since this app ships as a manual zip to shared hosting. */
.ic { inline-size: 1.15em; block-size: 1.15em; display: inline-block; vertical-align: -.22em; flex-shrink: 0; }

.icon-badge {
  inline-size: 44px; block-size: 44px; border-radius: var(--radius-lg);
  display: grid; place-items: center; flex-shrink: 0;
}
.icon-badge .ic { inline-size: 22px; block-size: 22px; vertical-align: 0; }
.icon-badge--sm { inline-size: 34px; block-size: 34px; border-radius: var(--radius); }
.icon-badge--sm .ic { inline-size: 17px; block-size: 17px; }
.icon-badge--lg { inline-size: 54px; block-size: 54px; }
.icon-badge--lg .ic { inline-size: 26px; block-size: 26px; }

.tone-primary { background: var(--gold-tint); color: var(--gold); }
.tone-dark    { background: rgba(12,13,13,.07); color: var(--ink); }
.tone-info    { background: rgba(154,229,215,.3); color: #196a5b; }
.tone-success { background: #e9f5ee; color: #1f5638; }
.tone-warning { background: #fdf1e2; color: #9a6a1f; }
.tone-danger  { background: #fbeceb; color: #7d241b; }

/* ---- Quick-access tile grid (portal dashboards) -------------------------- */
/* Shared by admin/employee/supplier/dental-lab dashboards + the account page
   so every portal's "quick access" grid looks and behaves identically. */
.quick-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .9rem; margin-block-end: 2rem; }
.quick-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.2rem .8rem; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.quick-tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-gold); }
.quick-tile__icon { inline-size: 44px; block-size: 44px; border-radius: var(--radius-lg); display: grid; place-items: center;
  background: var(--gold-tint); color: var(--gold); }
.quick-tile__icon .ic { inline-size: 22px; block-size: 22px; }
.quick-tile__label { font-size: .82rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
.quick-tile__badge { position: absolute; inset-block-start: .5rem; inset-inline-end: .5rem; background: #c0392b; color: #fff;
  font-size: .68rem; font-weight: 700; border-radius: 999px; min-inline-size: 1.2rem; block-size: 1.2rem; padding: 0 .3rem;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(192,57,43,.4); }

/* ---- Phone country-code picker ------------------------------------------ */
.phone-field { display:flex; gap:.5rem; align-items:stretch; }
.phone-field .phone-country-select { flex:0 0 auto; max-inline-size:9rem; }
.phone-field input[name="phone"] { flex:1 1 auto; min-inline-size:0; }

/* ---- AI chat widget (public site + staff dashboard) --------------------- */
/* Stacked above the WhatsApp float button (1.4rem + 58px + gap) so the two never overlap. */
.ai-chat { position: fixed; inset-block-end: 5.6rem; inset-inline-end: 1.4rem; z-index: 90; }
.ai-chat__bubble {
  inline-size: 58px; block-size: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--gold); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-gold); font-size: 1.4rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ai-chat__bubble:hover { transform: translateY(-2px) scale(1.04); }
.ai-chat__bubble .ic { inline-size: 26px; block-size: 26px; }

.ai-chat__panel {
  position: absolute; inset-block-end: calc(58px + .8rem); inset-inline-end: 0;
  inline-size: min(360px, 88vw); block-size: min(480px, 70vh);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px -20px rgba(12,13,13,.35);
  display: flex; flex-direction: column; overflow: hidden;
}
/* Must win over the plain class rule above, or the [hidden] attribute the JS toggles
   (open/close) has no visual effect and the panel stays permanently visible. */
.ai-chat__panel[hidden] { display: none; }
.ai-chat__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.1rem; background: var(--black); color: #F4EFE7; font-weight: 700; font-size: .92rem;
}
.ai-chat__close { background: none; border: none; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.ai-chat__messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; background: var(--paper); }
.ai-chat__msg { max-inline-size: 82%; padding: .55rem .8rem; border-radius: var(--radius); font-size: .86rem; line-height: 1.5; white-space: pre-wrap; }
.ai-chat__msg--assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.ai-chat__msg--user { align-self: flex-end; background: var(--gold); color: #fff; }
.ai-chat__msg--typing { opacity: .6; }
.ai-chat__form { display: flex; gap: .5rem; padding: .7rem; border-block-start: 1px solid var(--line); background: #fff; }
.ai-chat__input { flex: 1; min-inline-size: 0; border: 1px solid var(--line-strong); border-radius: 999px; padding: .55rem 1rem; font-size: .86rem; }
.ai-chat__send {
  inline-size: 38px; block-size: 38px; border-radius: 50%; border: none; cursor: pointer; flex: none;
  background: var(--gold); color: #fff; display: grid; place-items: center; font-size: .95rem;
}
html[dir="rtl"] .ai-chat__send { transform: scaleX(-1); }

@media (max-width: 480px) {
  .ai-chat { inset-block-end: 5.2rem; inset-inline-end: 1rem; }
  .ai-chat__panel { inline-size: 92vw; block-size: 70vh; }
}

/* ---- Floating WhatsApp click-to-chat button -------------------------- */
.wa-float {
  position: fixed; inset-block-end: 1.4rem; inset-inline-end: 1.4rem; z-index: 89;
  inline-size: 58px; block-size: 58px; border-radius: 50%;
  background: #25D366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 30px -8px rgba(37,211,102,.6);
  transition: transform .18s ease;
}
.wa-float:hover { transform: translateY(-2px) scale(1.04); }
.wa-float .ic { inline-size: 28px; block-size: 28px; }
@media (max-width: 480px) {
  .wa-float { inset-block-end: 1rem; inset-inline-end: 1rem; inline-size: 52px; block-size: 52px; }
}

/* ---- Offer urgency badge -------------------------------------------- */
.offer-urgency {
  display: inline-block; margin-block-start: .35rem; padding: .25rem .7rem;
  background: #c0392b; color: #fff; font-size: .76rem; font-weight: 700;
  border-radius: 999px; animation: offer-pulse 1.8s ease-in-out infinite;
}
@keyframes offer-pulse { 0%,100% { opacity: 1; } 50% { opacity: .72; } }

/* ---- FAQ accordion (native <details>, no JS needed) ---------------------- */
.faq-list { display: flex; flex-direction: column; gap: .8rem; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.3rem; }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--gold); flex: none; transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item__answer { margin-block-start: .8rem; color: var(--ink-soft); font-size: .92rem; line-height: 1.7; }

/* ---- Instagram "follow us" grid ------------------------------------------ */
.ig-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem; margin-block-start: 1.8rem; }
.ig-grid__item { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; display: block; }
.ig-grid__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.ig-grid__item:hover img { transform: scale(1.06); }
@media (max-width: 900px) { .ig-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .ig-grid { grid-template-columns: repeat(2, 1fr); } }
