/* Kit base: reset, accessibility helpers, and the shared widgets site.js drives
   (reveal, demo bar, floating WhatsApp, phone action bar, back-to-top, lightbox).
   Each site's styles.css sets the look; the custom properties below are only fallbacks to override. */
:root {
  --c-bg: #ffffff;
  --c-surface: #f6f4f0;
  --c-text: #1c1c1c;
  --c-muted: #5f5f5f;
  --c-accent: #8a6a3d;
  --c-accent-ink: #ffffff;
  --c-wa: #1b7f4c; /* deeper than WhatsApp's #25d366 so white text passes AA contrast */
  --radius: 16px;
  --header-h: 72px;
  --container: 1180px;
  --font-body: system-ui, sans-serif;
  --font-head: var(--font-body);
}

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

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

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  font-family: var(--font-head);
  line-height: 1.25;
  text-wrap: balance;
}

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

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 3px;
}

.container {
  width: min(var(--container), 100% - 40px);
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  top: -60px;
  inset-inline-start: 12px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--c-text);
  color: var(--c-bg);
}

.skip-link:focus {
  top: 12px;
}

/* Phone numbers and other Latin runs inside Arabic text. */
.ltr {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Demo bar ---------- */
.demo-bar {
  position: relative;
  z-index: 60;
  padding: 8px 48px;
  background: var(--demo-bg, var(--c-accent));
  color: var(--demo-ink, var(--c-accent-ink));
  font-size: 0.85rem;
  text-align: center;
}

.demo-bar p {
  margin: 0;
}

.demo-bar__close {
  position: absolute;
  top: 50%;
  inset-inline-end: 10px;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
}

/* ---------- Floating WhatsApp (desktop) ---------- */
.wa-float {
  position: fixed;
  bottom: 22px;
  inset-inline-end: 22px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--c-wa);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease;
}

.wa-float:hover {
  transform: scale(1.06);
}

.wa-float svg {
  width: 30px;
  height: 30px;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  bottom: 22px;
  inset-inline-start: 22px;
  z-index: 44;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--c-text);
  color: var(--c-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.to-top.is-visible {
  opacity: 0.9;
  pointer-events: auto;
}

.to-top svg {
  width: 20px;
  height: 20px;
}

/* ---------- Phone action bar (under 768px) ---------- */
.mobile-bar {
  display: none;
}

@media (max-width: 768px) {
  .wa-float {
    display: none;
  }

  .to-top {
    bottom: 88px;
  }

  .mobile-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--mobile-bar-bg, rgba(20, 20, 20, 0.94));
    backdrop-filter: blur(10px);
  }

  .mobile-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
  }

  .mobile-bar a.is-wa {
    border-color: transparent;
    background: var(--c-wa);
  }

  .mobile-bar svg {
    width: 20px;
    height: 20px;
  }

  body {
    padding-bottom: 76px;
  }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 64px 76px;
  background: rgba(8, 8, 8, 0.93);
}

.lightbox figure {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 0;
}

.lightbox img {
  width: auto;
  max-height: calc(100vh - 170px);
  border-radius: 10px;
}

.lightbox figcaption {
  color: #eee;
  font-size: 0.95rem;
  text-align: center;
}

.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.lightbox button svg {
  width: 22px;
  height: 22px;
}

.lightbox__close {
  top: 16px;
  inset-inline-end: 16px;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  translate: 0 -50%;
}

.lightbox__prev {
  inset-inline-start: 16px;
}

.lightbox__next {
  inset-inline-end: 16px;
}

[dir="rtl"] .lightbox__prev svg,
[dir="rtl"] .lightbox__next svg {
  transform: scaleX(-1);
}

@media (max-width: 600px) {
  .lightbox {
    padding: 64px 12px 90px;
  }

  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: 18px;
    translate: none;
  }
}

/* ---------- Form errors ---------- */
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: #c0392b;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
