/* =================================================================
   عناية وتوفير | Care and Savings — base styles
   Design tokens, reset, layout and accessibility utilities, shared
   typography and buttons. Loaded first on every page; the component
   and page stylesheets build on these tokens.

   Mobile-first: every rule targets the smallest screen, larger screens
   are layered on with min-width queries. Custom properties can't be
   used inside media queries, so the breakpoint scale lives here:

     481px   large phones                  901px   small laptops
     551px   phablets                      961px
     701px   small tablets                 992px   laptops (type scale and gutters step up)
     769px   tablets — main layout switch  1201px  wide desktops
     801px                                 (a few components use 421px / 561px)
   ================================================================= */

/* ─────────────────────────── Tokens ─────────────────────────── */

:root {
  /* Brand palette */
  --color-brand:        #9D2862;
  --color-brand-dark:   #7E1F4E;
  --color-brand-light:  #F4DDE8;
  --color-brand-accent: #E6628B;
  --color-coral:        #D84544;
  --color-blush:        #FCA5A5;
  --color-rose:         #F0A8C8;

  --color-navy:         #2E2863;
  --color-navy-dark:    #1D1940;
  --color-navy-light:   #E8E6F0;
  --color-navy-muted:   #5A5578;

  --color-neutral-50:   #FAF7F9;
  --color-neutral-100:  #FBEEF2;
  --color-neutral-200:  #EDE9E3;
  --color-neutral-500:  #8F8880;
  --color-white:        #FFFFFF;
  --color-star:         #E8920A;
  --color-star-bright:  #F5C518;

  /* Semantic roles — components use these, not the palette directly */
  --color-text:         var(--color-navy);
  --color-text-soft:    var(--color-navy-muted);
  --color-text-muted:   var(--color-neutral-500);
  --color-heading:      var(--color-navy);
  --color-bg:           var(--color-neutral-50);
  --color-bg-alt:       var(--color-neutral-100);
  --color-surface:      var(--color-white);
  --color-border:       var(--color-navy-light);

  /* Gradients */
  --gradient-brand:      linear-gradient(135deg, var(--color-coral) 0%, var(--color-brand) 100%);
  --gradient-glow:       linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-accent) 100%);
  --gradient-glow-hover: linear-gradient(135deg, var(--color-blush) 0%, var(--color-brand-accent) 100%);

  /* Typography */
  --font-body:    'Plus Jakarta Sans', 'Cairo', sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-quote:   Georgia, 'Times New Roman', serif;

  --font-weight-regular:  400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;
  --font-weight-black:    800;

  /* Layout — gutters and section spacing grow with the viewport (below) */
  --container-max: 1280px;
  --header-height: 9rem;
  --page-gutter:   2.4rem;
  --section-space: 5rem;

  /* Shape */
  --radius-sm:   0.6rem;
  --radius-md:   1.2rem;
  --radius-pill: 999px;

  /* Motion */
  --ease-standard:   cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.22s ease;

  /* Stacking order */
  --z-header:             100;
  --z-floating:           150;
  --z-side-nav-backdrop:  199;
  --z-side-nav:           200;
  --z-drawer:             8000;
  --z-dialog-backdrop:    8000;
  --z-dialog:             8001;
  --z-product-dialog:     9999;
  --z-skip-link:          9999;

  /* Faint butterfly outline tiled behind several sections */
  --pattern-butterfly: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22100%22 height=%2280%22 viewBox=%220 0 100 80%22%3E%3Cpath d=%22M50 42 C36 22 6 14 12 30 C18 44 38 40 50 42%22 stroke=%22rgba(46,40,99,0.04)%22 stroke-width=%220.9%22 fill=%22none%22/%3E%3Cpath d=%22M50 42 C64 22 94 14 88 30 C82 44 62 40 50 42%22 stroke=%22rgba(46,40,99,0.04)%22 stroke-width=%220.9%22 fill=%22none%22/%3E%3Cpath d=%22M50 42 C40 28 22 20 26 32%22 stroke=%22rgba(46,40,99,0.02)%22 stroke-width=%220.6%22 fill=%22none%22/%3E%3Cpath d=%22M50 42 C60 28 78 20 74 32%22 stroke=%22rgba(46,40,99,0.02)%22 stroke-width=%220.6%22 fill=%22none%22/%3E%3Cpath d=%22M50 42 C28 48 8 60 16 72 C22 78 40 58 50 42%22 stroke=%22rgba(46,40,99,0.04)%22 stroke-width=%220.9%22 fill=%22none%22/%3E%3Cpath d=%22M50 42 C72 48 92 60 84 72 C78 78 60 58 50 42%22 stroke=%22rgba(46,40,99,0.04)%22 stroke-width=%220.9%22 fill=%22none%22/%3E%3Cpath d=%22M50 42 C36 52 18 62 22 68%22 stroke=%22rgba(46,40,99,0.02)%22 stroke-width=%220.6%22 fill=%22none%22/%3E%3Cpath d=%22M50 42 C64 52 82 62 78 68%22 stroke=%22rgba(46,40,99,0.02)%22 stroke-width=%220.6%22 fill=%22none%22/%3E%3Cpath d=%22M50 26 Q49 42 50 66%22 stroke=%22rgba(46,40,99,0.04)%22 stroke-width=%221%22 fill=%22none%22/%3E%3Cpath d=%22M50 26 C46 18 40 12 36 8%22 stroke=%22rgba(46,40,99,0.03)%22 stroke-width=%220.7%22 fill=%22none%22/%3E%3Cpath d=%22M50 26 C54 18 60 12 64 8%22 stroke=%22rgba(46,40,99,0.03)%22 stroke-width=%220.7%22 fill=%22none%22/%3E%3Ccircle cx=%2235%22 cy=%227%22 r=%221.2%22 fill=%22rgba(46,40,99,0.04)%22/%3E%3Ccircle cx=%2265%22 cy=%227%22 r=%221.2%22 fill=%22rgba(46,40,99,0.04)%22/%3E%3C/svg%3E");
}

@media (min-width: 769px) {
  :root { --section-space: 6rem; }
}

@media (min-width: 992px) {
  :root { --page-gutter: 4%; --section-space: 8rem; }
}

@media (min-width: 1201px) {
  :root { --page-gutter: 9%; }
}

/* ─────────────────────────── Reset ─────────────────────────── */

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

/* 1rem = 10px at 62.5%; the whole type scale shrinks on smaller screens */
html {
  font-size: 48%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

@media (min-width: 481px) { html { font-size: 52%; } }
@media (min-width: 769px) { html { font-size: 55%; } }
@media (min-width: 992px) { html { font-size: 62.5%; } }

body {
  font-family: var(--font-body);
  font-size: 1.5rem;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

/* Arabic is a joined script: letter-spacing pulls its letters apart in some
   browsers, so tracking only ever applies to Latin text. Latin runs inside
   Arabic pages (brand names) carry lang="en" and keep theirs. */
:lang(ar) { letter-spacing: normal !important; }

/* The hidden attribute always wins over a component's display value */
[hidden] { display: none !important; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
blockquote, cite { font-style: normal; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

:focus-visible {
  outline: 2.5px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) { outline: none; }

::-webkit-scrollbar { width: 0.8rem; }
::-webkit-scrollbar-thumb { background: var(--color-brand); border-radius: 0.4rem; }
::-webkit-scrollbar-track { background: transparent; }

/* ─────────────────────────── Layout utilities ─────────────────────────── */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* Horizontal scroll-snap row on phones; a normal (non-scrolling) box from
   tablets up, where each component lays its items out as a grid. */
.scroll-rail {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.scroll-rail::-webkit-scrollbar { display: none; }

@media (min-width: 769px) {
  .scroll-rail {
    overflow-x: visible;
    scroll-snap-type: none;
    scrollbar-width: auto;
  }
}

/* ─────────────────────────── Accessibility utilities ─────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  inset-inline-start: 1rem;
  z-index: var(--z-skip-link);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-md);
  background: var(--color-brand);
  color: var(--color-white);
  font-size: 1.3rem;
}
.skip-link:focus { top: 1rem; }

/* ─────────────────────────── Scroll reveal ─────────────────────────── */
/* JS adds .reveal--visible when the element scrolls into view. Zero
   specificity (:where) so a component's own transitions and hover lift
   still win once it has been revealed.
   .reveal--tablet-up: items inside a phone scroll rail are shown straight
   away — they sit off to the side, so they'd stay hidden until swiped. */

:where(.reveal) { transition: opacity 0.5s ease, transform 0.5s ease; }

:where(.reveal:not(.reveal--visible, .reveal--tablet-up)) {
  opacity: 0;
  transform: translateY(3rem);
}

@media (min-width: 769px) {
  :where(.reveal--tablet-up:not(.reveal--visible)) {
    opacity: 0;
    transform: translateY(3rem);
  }
}

/* ─────────────────────────── Backdrop ─────────────────────────── */
/* Dimmed layer behind the side menu and the contact dialog */

.backdrop {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.backdrop--visible { opacity: 1; pointer-events: auto; }

.backdrop--side-nav {
  z-index: var(--z-side-nav-backdrop);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity 0.38s ease;
}

.backdrop--dialog {
  z-index: var(--z-dialog-backdrop);
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.15s ease;
}

/* ─────────────────────────── Sections ─────────────────────────── */

.section { padding: var(--section-space) var(--page-gutter); }

.section--alt     { background-color: var(--color-bg-alt); }
.section--surface { background-color: var(--color-surface); }

.section--pattern {
  background-image: var(--pattern-butterfly);
  background-repeat: repeat;
  background-size: 100px 80px;
}

.section__header { text-align: center; margin-bottom: 5rem; }

.section__title {
  font-size: clamp(2.4rem, 3.5vw, 3.5rem);
  font-weight: var(--font-weight-bold);
  color: var(--color-heading);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section__subtitle {
  font-size: 1.5rem;
  color: var(--color-text-soft);
  max-width: 55ch;
  margin-inline: auto;
  line-height: 1.8;
}

/* ─────────────────────────── Eyebrow (small label above a heading) ─────────────────────────── */

.eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  color: var(--color-brand);
}

/* Short accent bar under the label, used in centred section headers */
.eyebrow--accent::after {
  content: '';
  display: block;
  width: 3.6rem;
  height: 0.3rem;
  margin: 0.6rem auto 0;
  border-radius: 2px;
  background: var(--color-brand);
}

/* ─────────────────────────── Buttons ─────────────────────────── */

.button {
  display: inline-block;
  padding: 1rem 3rem;
  border: 0.2rem solid transparent;
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

/* Glowing pink button for dark panels */
.button--glow {
  border: none;
  background: var(--gradient-glow);
  color: var(--color-white);
  font-weight: var(--font-weight-bold);
  box-shadow: 0 6px 28px rgba(157, 40, 98, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.button--glow:hover {
  background: var(--gradient-glow-hover);
  color: var(--color-navy-dark);
  box-shadow: 0 10px 36px rgba(157, 40, 98, 0.6);
  transform: translateY(-2px);
}

.button--outline-light {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.6);
}
.button--outline-light:hover { background: var(--color-white); color: var(--color-heading); }

.button--large { padding: 1.4rem 4.5rem; font-size: 1.6rem; }

/* Round icon-only button */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border: 0.15rem solid var(--color-border);
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-text-soft);
  font-size: 1.6rem;
  transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}
.icon-button:hover {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-white);
}
