/* ==========================================================================
   base.css - design tokens, reset, typography, shared primitives
   ========================================================================== */

:root {
  /* brand palette */
  --teal:       #16A3AB;
  --teal-dark:  #0E7D84;
  --teal-light: #7FD9DF;
  --ink:        #1E2A2E;
  --muted:      #6B7A80;
  --price:      #E8422E;
  --bg:         #FFFFFF;
  --surface:    #F5F7F8;
  --border:     #E3E8EA;
  --whatsapp:   #25D366;
  --facebook:   #1877F2;

  /* derived */
  --teal-darker: #0A5F65;
  --ink-soft:    #3C4C52;
  --star:        #F5A623;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(30, 42, 46, .06);
  --shadow:    0 2px 8px rgba(30, 42, 46, .08);
  --shadow-lg: 0 8px 24px rgba(30, 42, 46, .14);

  /* geometry */
  --radius:    8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* layout */
  --container: 1280px;
  --gap: 16px;
  --header-h: 116px;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* --- reset ---------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Tajawal, Cairo, system-ui, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  /* Never let a wide child force a sideways scroll. This must be `clip`, not
     `hidden`: `hidden` turns body into a scroll container, which makes the
     sticky header stick to the body box instead of the viewport. */
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; line-height: 1.3; font-weight: 700; }
p  { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--teal); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: 0; padding: 0; }

/* Arabic digits stay Latin so prices read consistently with the EGP suffix */
.num { font-variant-numeric: tabular-nums; }

/* --- focus ---------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}
/* only suppress the ring for mouse users, never for keyboard */
:focus:not(:focus-visible) { outline: none; }

/* --- accessibility helpers ------------------------------------------------ */

.visually-hidden {
  position: absolute !important;
  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;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 200;
  background: var(--teal);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* --- layout primitives ---------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
}

.stack > * + * { margin-block-start: var(--gap); }

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: background .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .12s var(--ease);
  text-align: center;
}
.btn:active { transform: translateY(1px); }

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

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

.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--border); color: var(--ink); }

.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #1DA851; color: #fff; }

.btn-danger { background: var(--price); color: #fff; }
.btn-danger:hover { background: #C9351F; color: #fff; }

.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- form controls -------------------------------------------------------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: #C6D2D6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 163, 171, .15);
  outline: none;
}
.textarea { min-height: 96px; resize: vertical; }

.select {
  /* leave room for the arrow on the left, since the page is RTL */
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B7A80' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 12px;
  padding-inline-start: 12px;
  padding-inline-end: 34px;
}

.field-error {
  display: block;
  margin-top: 5px;
  color: var(--price);
  font-size: 13px;
  font-weight: 600;
  min-height: 1px;
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
  border-color: var(--price);
}
.input.is-invalid:focus, .select.is-invalid:focus, .textarea.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(232, 66, 46, .15);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }

/* --- utility -------------------------------------------------------------- */

.text-muted { color: var(--muted); }
.text-price { color: var(--price); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
