/* =========================================================
   الأساسيات: إعادة الضبط، الطباعة، الحاويات، الأيقونات، الأزرار، الحقول
   ========================================================= */

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
  margin: 0;
  background: var(--tile);
  color: var(--navy);
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

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

a { color: inherit; }

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

ul, ol, dl, dd { margin: 0; padding: 0; }
ul[role="list"], ol[role="list"] { list-style: none; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.on-dark :focus-visible { outline-color: var(--gold-light); }

/* العناوين التي يُنقل إليها التركيز برمجياً لا تحتاج إطاراً عند النقر */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

/* ---------- أدوات عامة ---------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section__head { max-width: 42rem; margin-block-end: clamp(2rem, 1.6rem + 2vw, 3rem); }
.section__title { font-size: var(--fs-2xl); }
.section__lead { margin-block-start: 0.75rem; color: var(--slate); font-size: var(--fs-md); line-height: 1.75; }

.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: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-control);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- الأيقونات ---------- */

/* سماكة الخط تُورَّث إلى داخل <use>، فتكون واحدة في كل الأيقونات الخطية */
.icon {
  width: var(--icon-md);
  height: var(--icon-md);
  flex-shrink: 0;
  stroke-width: var(--icon-stroke);
}

/* مربع الأيقونة الموحد: الخدمات، الأقسام، خطوات الحجز */
.icon-badge {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--badge-size);
  height: var(--badge-size);
  background: var(--gold-tint);
  border: 1px solid rgb(201 153 78 / 0.28);
  border-radius: var(--radius-control);
  color: var(--gold-deep);
}
.icon-badge .icon { width: var(--icon-lg); height: var(--icon-lg); }

.icon-badge--sm { width: var(--badge-size-sm); height: var(--badge-size-sm); }
.icon-badge--sm .icon { width: var(--icon-md); height: var(--icon-md); }

.icon-badge--on-dark {
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(233 197 127 / 0.3);
  color: var(--gold-light);
}

/* ---------- الأزرار ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 50px;
  padding: 0.65rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-control);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--gold-light); }

.btn--outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn--outline:hover { background: var(--navy); color: var(--white); }

.btn--outline-light { border-color: rgb(255 255 255 / 0.4); color: var(--white); background: transparent; }
.btn--outline-light:hover { border-color: var(--white); background: rgb(255 255 255 / 0.08); }

.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--navy-soft); }

.btn--ghost { border-color: var(--grout); color: var(--navy); background: var(--white); }
.btn--ghost:hover { border-color: var(--navy); }

.btn--whatsapp { background: var(--whatsapp); color: var(--white); }
.btn--whatsapp:hover { background: var(--whatsapp-hover); }

.btn--small { min-height: 42px; padding: 0.45rem 1.1rem; font-size: var(--fs-sm); }
.btn--small .icon { width: var(--icon-sm); height: var(--icon-sm); }

.btn--block { width: 100%; }

.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- حقول النماذج ---------- */

.field { display: grid; gap: 0.4rem; align-content: start; }

.field__label { font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.field__optional { font-weight: var(--fw-regular); color: var(--slate); }

.field__control {
  width: 100%;
  min-height: 50px;
  padding: 0.65rem 0.9rem;
  background: var(--white);
  border: 1.5px solid var(--grout);
  border-radius: var(--radius-control);
  font-size: var(--fs-base);
  line-height: 1.5;
  transition: border-color 0.15s ease;
}

.field__control:hover { border-color: var(--grout-strong); }
.field__control:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 0; border-color: var(--focus); }

textarea.field__control { min-height: 110px; resize: vertical; }

input[type="tel"].field__control,
input[type="email"].field__control { direction: ltr; text-align: right; }

.field__hint { font-size: var(--fs-sm); color: var(--slate); line-height: 1.6; }

.field__error {
  font-size: var(--fs-sm);
  color: var(--danger);
  line-height: 1.6;
}
.field__error:empty { display: none; }

.field__control[aria-invalid="true"] { border-color: var(--danger); }

.form-grid { display: grid; gap: 1.25rem; }

@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
}

.form-status {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid;
  border-radius: var(--radius-control);
  font-size: var(--fs-sm);
  line-height: 1.75;
}
.form-status--success { border-color: var(--success); background: #eef8f2; color: #134d30; }
.form-status--error { border-color: var(--danger); background: #fdf0ef; color: #7a1a12; }
.form-status a { font-weight: var(--fw-semibold); color: inherit; }
.form-status strong { display: block; }

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