/* HajzyNow design system. Tokens, dark mode, base, layout, components, motion. Mobile-first. */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/ibm-plex-sans-arabic-400-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/ibm-plex-sans-arabic-700-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --primary: #5B3DF5;
  --primary-dark: #3F25C9;
  --coral: #FF5A5F;
  --sunshine: #FFB400;
  --mint: #00C2A8;
  --grad: linear-gradient(135deg, #5B3DF5, #FF5A5F);
  /* Button gradient: darker stops so white text passes AA (7.7:1 and 5.5:1). */
  --grad-btn: linear-gradient(135deg, #4B2FDB, #C8283A);
  --grad-hero: linear-gradient(135deg, #3F25C9 0%, #5B3DF5 45%, #C8283A 100%);

  /* Surfaces and text (light) */
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --surface-2: #EFEDFD;
  --text: #14142B;
  --muted: #5F6283; /* adjusted from #6E7191 (4.43:1 on bg) to 5.52:1 */
  --border: #E4E4F0;
  --border-strong: #CFCFE3;
  --link: #4A2FE0;
  --danger: #B4232F;
  --danger-soft: #FDECEE;
  --success: #0F7A52;
  --success-soft: #E2F5EC;
  --focus: #5B3DF5;
  --chip-on: #4B2FDB;

  /* Categories (fill color and text-safe color) */
  --cat-cafe: #F59E0B;
  --cat-salon: #EC4899;
  --cat-barber: #3B82F6;
  --cat-dental: #14B8A6;
  --cat-clinic: #22C55E;
  --cat-cafe-text: #B45309;
  --cat-salon-text: #BE185D;
  --cat-barber-text: #1D4ED8;
  --cat-dental-text: #0F766E;
  --cat-clinic-text: #15803D;

  /* Type */
  --font: "IBM Plex Sans Arabic", "DM Sans", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --h1: clamp(2rem, 5vw + 1rem, 3.75rem);
  --h2: clamp(1.5rem, 2.5vw + 1rem, 2.5rem);
  --h3: 1.2rem;

  /* Space, shape */
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: 6rem;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 32px;
  --pill: 999px;
  --shadow: 0 1px 2px rgb(20 20 43 / 0.06), 0 10px 28px -12px rgb(20 20 43 / 0.16);
  --shadow-lift: 0 2px 4px rgb(20 20 43 / 0.06), 0 22px 40px -16px rgb(91 61 245 / 0.35);
  --header-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --container: 1180px;
  --gutter: clamp(var(--s4), 4vw, var(--s6));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F1E;
    --surface: #191932;
    --surface-2: #23234A;
    --text: #EDEDF8;
    --muted: #A7AACB;
    --border: #2D2D52;
    --border-strong: #43437A;
    --link: #B0A5FF;
    --danger: #FF8E97;
    --danger-soft: #3B1D28;
    --success: #5FD9A0;
    --success-soft: #153A2B;
    --focus: #B0A5FF;
    --cat-cafe-text: #FBBF24;
    --cat-salon-text: #F472B6;
    --cat-barber-text: #7DA8FF;
    --cat-dental-text: #2DD4BF;
    --cat-clinic-text: #4ADE80;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -12px rgb(0 0 0 / 0.6);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.3), 0 22px 40px -16px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0F1E;
  --surface: #191932;
  --surface-2: #23234A;
  --text: #EDEDF8;
  --muted: #A7AACB;
  --border: #2D2D52;
  --border-strong: #43437A;
  --link: #B0A5FF;
  --danger: #FF8E97;
  --danger-soft: #3B1D28;
  --success: #5FD9A0;
  --success-soft: #153A2B;
  --focus: #B0A5FF;
  --cat-cafe-text: #FBBF24;
  --cat-salon-text: #F472B6;
  --cat-barber-text: #7DA8FF;
  --cat-dental-text: #2DD4BF;
  --cat-clinic-text: #4ADE80;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -12px rgb(0 0 0 / 0.6);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.3), 0 22px 40px -16px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

/* Category helper classes: --cat is the fill color, --cat-text is safe for text. */
.cat-cafe { --cat: var(--cat-cafe); --cat-text: var(--cat-cafe-text); }
.cat-salon { --cat: var(--cat-salon); --cat-text: var(--cat-salon-text); }
.cat-barber { --cat: var(--cat-barber); --cat-text: var(--cat-barber-text); }
.cat-dental { --cat: var(--cat-dental); --cat-text: var(--cat-dental-text); }
.cat-clinic { --cat: var(--cat-clinic); --cat-text: var(--cat-clinic-text); }
[data-cat="cafe"] { --cat: var(--cat-cafe); --cat-text: var(--cat-cafe-text); }
[data-cat="salon"] { --cat: var(--cat-salon); --cat-text: var(--cat-salon-text); }
[data-cat="barber"] { --cat: var(--cat-barber); --cat-text: var(--cat-barber-text); }
[data-cat="dental"] { --cat: var(--cat-dental); --cat-text: var(--cat-dental-text); }
[data-cat="clinic"] { --cat: var(--cat-clinic); --cat-text: var(--cat-clinic-text); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  animation: page-in 0.4s var(--ease) both;
}
html:lang(ar) body { line-height: 1.8; }
html:lang(ar) *, html:lang(ar) *::before, html:lang(ar) *::after { letter-spacing: 0 !important; }
h1, h2, h3 { margin: 0 0 var(--s3); line-height: 1.25; font-weight: 700; }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
p { margin: 0 0 var(--s3); }
a { color: var(--link); }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.skip-link { position: absolute; inset-inline-start: var(--s3); top: -100px; z-index: 100; background: var(--surface); color: var(--text); padding: var(--s2) var(--s4); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.skip-link:focus { top: var(--s3); }

/* ---------- Header and footer ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top, 0px); }
.header-inner { display: flex; align-items: center; gap: var(--s3); min-height: var(--header-h); }
.site-nav { margin-inline-start: auto; }
.nav-list { display: flex; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.nav-link { display: inline-block; padding: var(--s2) var(--s3); border-radius: var(--pill); color: var(--text); text-decoration: none; font-weight: 700; }
.nav-link:hover, .nav-link[aria-current="page"] { background: var(--surface-2); }
@media (max-width: 480px) { .nav-list li:first-child { display: none; } .nav-link { padding-inline: var(--s2); } .header-inner { gap: var(--s2); } }
.lang-switch { display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--s4); border: 1.5px solid var(--border-strong); border-radius: var(--pill); color: var(--text); text-decoration: none; font-weight: 700; transition: background 0.2s, transform 0.15s; }
.lang-switch:hover { background: var(--surface-2); }
.lang-switch:active { transform: scale(0.96); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); text-decoration: none; }
.brand-logo { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.brand-tag { font-size: 0.78rem; color: var(--muted); display: none; }
.site-footer { margin-top: var(--s8); padding-block: var(--s7); background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); }
.footer-grid { display: grid; gap: var(--s3); }
.footer-grid a { color: var(--link); }
.footer-contact p { margin-bottom: var(--s2); }
.site-footer .brand-tag { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0.55rem 1.5rem; border-radius: var(--pill);
  border: 1.5px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.96); }
.btn-primary, .btn-book { background: var(--grad-btn); color: #fff; box-shadow: 0 8px 20px -10px rgb(75 47 219 / 0.7); }
.btn-primary:hover, .btn-book:hover { box-shadow: 0 12px 26px -10px rgb(200 40 58 / 0.6); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-whatsapp { background: #0B6B3A; color: #fff; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 44px; padding: 0.35rem 1.1rem; font-size: var(--text-sm); }
.btn-block { display: flex; width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--s4); }
.field label, .field-label { display: block; font-weight: 700; margin-bottom: var(--s1); }
input, select, textarea { font: inherit; color: var(--text); }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .search-form input {
  width: 100%; min-height: 48px; padding: 0.5rem 0.9rem; background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus, .search-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.field textarea { min-height: 7rem; }
.field-hint, .note { color: var(--muted); font-size: var(--text-sm); }
.field-hint { display: block; margin-top: var(--s1); }
.check { display: flex; align-items: center; gap: var(--s2); font-weight: 400; }
.form-grid { display: grid; gap: var(--s3); }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Hero and sections ---------- */
.hero { position: relative; overflow: hidden; background: var(--grad-hero); color: #fff; padding-block: var(--s8); text-align: center; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.35; pointer-events: none; }
.hero::before { width: 18rem; height: 18rem; background: var(--sunshine); inset-block-start: -6rem; inset-inline-start: -5rem; animation: float 9s ease-in-out infinite; }
.hero::after { width: 16rem; height: 16rem; background: var(--mint); inset-block-end: -6rem; inset-inline-end: -4rem; animation: float 11s ease-in-out infinite reverse; }
.hero .container { position: relative; z-index: 1; max-width: 46rem; }
.hero-title { color: #fff; }
.eyebrow { display: inline-block; padding: 0.2rem 0.9rem; border-radius: var(--pill); background: rgb(255 255 255 / 0.18); color: #fff; font-weight: 700; font-size: var(--text-sm); margin-bottom: var(--s3); }
.lede { font-size: 1.15rem; color: inherit; opacity: 0.95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; margin-top: var(--s5); }
.hero .btn-book { background: #fff; color: var(--primary-dark); box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.5); }
.hero .btn-ghost { color: #fff; border-color: rgb(255 255 255 / 0.7); }
.hero .btn-ghost:hover { background: rgb(255 255 255 / 0.16); }
.section { padding-block: var(--s7); }
.section-head { margin-bottom: var(--s5); }
.section-head h2 { margin: 0; }

/* Branded 404 */
.nf { text-align: center; padding-block: var(--s8); }
.nf-code { font-size: clamp(6rem, 25vw, 12rem); font-weight: 700; line-height: 1; margin: 0 0 var(--s3); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf .hero-actions { margin-top: var(--s5); }

/* ---------- Toast ---------- */
.toast, .banner { transition: opacity 0.4s, transform 0.4s; }
.toast.is-leaving, .banner.is-leaving { opacity: 0; transform: translateY(-8px); }

/* ---------- Motion ---------- */
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(24px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.hero .container, .app-page > .container { animation: rise 0.6s var(--ease) both; }

.skeleton { display: block; min-height: 1em; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; color: transparent; }
.skeleton-card { height: 4.5rem; }
.skeleton-map { height: 26rem; border-radius: var(--radius); }

/* Booking confirmation: circle pops, check mark draws. */
.confirm-mark { display: block; width: 88px; height: 88px; margin: 0 auto var(--s4); animation: pop 0.5s var(--ease) both; }
.confirm-mark circle { fill: var(--success); }
.confirm-mark path { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.5s 0.35s var(--ease) forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .confirm-mark path { stroke-dashoffset: 0; }
  .btn:hover, .btn:active, .card:hover { transform: none; }
}

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .brand-tag { display: block; }
  .hero { padding-block: var(--s9); }
  .footer-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}
