/* =========================================================================
   MASSAED Factory Landing Page — Design System
   Brand source: Brand_Manual_Massaed.pdf (v1.0)
   Primary: Massaed Maroon  Pantone 7630 CP  #53140C
   Secondary: Gray          Pantone P179-14C #414042
   Secondary: Gold          Pantone P15-6C   #D3A24F
   Font: Cairo (Google Fonts) — approved for English & Arabic, digital
   ========================================================================= */

:root {
  /* ---- Brand colours (from approved brand manual) ---- */
  --maroon-900: #3c0e09;
  --maroon-800: #53140c;   /* MASSAED Maroon — primary */
  --maroon-700: #6b1a10;
  --maroon-600: #832014;
  --maroon-100: #f4e3e0;
  --maroon-050: #faf1ef;

  --gray-900: #212122;
  --gray-800: #2c2c2e;
  --gray-700: #414042;     /* Secondary Gray */
  --gray-500: #6f6e70;
  --gray-300: #a8a7a9;
  --gray-200: #d8d7d8;
  --gray-100: #eeeded;
  --gray-050: #f7f6f6;

  --gold-500: #d3a24f;     /* Secondary Gold */
  --gold-600: #b8873a;
  --gold-700: #8a6526;     /* Darker gold for small text on light backgrounds (WCAG AA) */
  --gold-100: #f6ecd9;

  --white: #ffffff;
  --success: #1f7a4d;
  --error: #b3261e;

  /* ---- Semantic tokens ---- */
  --color-bg: var(--white);
  --color-bg-alt: var(--gray-050);
  --color-bg-dark: var(--maroon-900);
  --color-text: var(--gray-900);
  --color-text-muted: var(--gray-500);
  --color-text-inverse: var(--white);
  --color-brand: var(--maroon-800);
  --color-brand-strong: var(--maroon-900);
  --color-accent: var(--gold-500);
  --color-border: var(--gray-200);
  --color-focus: #1a73e8;

  /* ---- Type ---- */
  --font-base: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
  --fs-h1: clamp(2.1rem, 1.5rem + 2.6vw, 3.6rem);
  --fs-h2: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --fs-lead: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --lh-tight: 1.15;
  --lh-normal: 1.6;

  /* ---- Layout ---- */
  --container: 1240px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6rem;

  --shadow-sm: 0 2px 8px rgba(33, 15, 10, 0.08);
  --shadow-md: 0 8px 24px rgba(33, 15, 10, 0.12);
  --shadow-lg: 0 16px 48px rgba(33, 15, 10, 0.18);

  --header-h: 76px;
  --transition: 200ms ease;
}

/* ---------------------------------------------------------------------- */
/* Reset & base                                                           */
/* ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@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; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-weight: 700; line-height: var(--lh-tight); margin: 0 0 var(--space-2); color: var(--color-brand-strong); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--space-2); color: var(--color-text); }
a { color: var(--color-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-inline-start: 1.2rem; }
button { font-family: inherit; cursor: pointer; }

/* Visible focus states — accessibility requirement */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
[hidden] { display: none !important; }

/* Hidden off the top edge (not the side) so it never widens the page in RTL */
.skip-link {
  position: absolute; inset-inline-start: 0; top: 0; transform: translateY(-120%);
  background: var(--color-brand); color: var(--white);
  padding: 0.75rem 1.25rem; z-index: 1000; border-end-end-radius: 8px;
}
.skip-link:focus { transform: none; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--space-3); }
.section { padding-block: var(--space-6); }
.section--alt { background: var(--color-bg-alt); }
.section--dark { background: var(--color-brand-strong); color: var(--color-text-inverse); }
.section--dark h2, .section--dark h3, .section--dark p { color: var(--color-text-inverse); }
.section-head { max-width: 760px; margin-block-end: var(--space-4); }
.eyebrow {
  display: inline-block; font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold-700); margin-block-end: var(--space-1);
}
.section--dark .eyebrow, .visit-cta .eyebrow { color: var(--gold-500); }
.lead { font-size: var(--fs-lead); color: var(--color-text-muted); }
.section--dark .lead { color: var(--gray-200); }

.tbc {
  display: inline-block;
  padding: 0.05em 0.5em;
  border: 1.5px dashed var(--gold-600);
  border-radius: 5px;
  background: var(--gold-100);
  color: var(--maroon-800);
  font-size: 0.85em;
  font-weight: 600;
}

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

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.85rem 1.6rem; border-radius: 999px; font-weight: 700; font-size: 0.98rem;
  border: 2px solid transparent; transition: transform var(--transition), background var(--transition), box-shadow var(--transition), color var(--transition);
  text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--color-brand); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--maroon-700); box-shadow: var(--shadow-md); }
.btn-secondary { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.65); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-outline { background: transparent; color: var(--color-brand); border-color: var(--color-brand); }
.btn-outline:hover { background: var(--maroon-050); }
.btn-gold { background: var(--color-accent); color: var(--maroon-900); }
.btn-gold:hover { background: var(--gold-600); color: var(--white); }
.btn-whatsapp { background: #25D366; color: #06210f; }
.btn-whatsapp:hover { background: #1ebe5a; }
.btn-block { width: 100%; white-space: normal; text-align: center; }
@media (max-width: 480px) { .btn { white-space: normal; text-align: center; } }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.88rem; }
.btn svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* Header                                                                  */
/* ---------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 500; background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-block-end: 1px solid var(--color-border);
  height: var(--header-h);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: var(--space-3); }
.brand { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.brand img { height: 40px; width: auto; }
@media (max-width: 420px) { .brand img { height: 32px; } }
.brand__name { font-weight: 700; font-size: 1.05rem; color: var(--color-brand-strong); }

.main-nav { display: flex; align-items: center; gap: var(--space-4); }
.main-nav__list { list-style: none; display: flex; gap: var(--space-3); margin: 0; padding: 0; }
.main-nav__list a { color: var(--gray-800); font-weight: 600; font-size: 0.95rem; padding: 0.4rem 0.1rem; position: relative; }
.main-nav__list a:hover { color: var(--color-brand); text-decoration: none; }
.main-nav__list a::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--color-accent); transition: width var(--transition);
}
.main-nav__list a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.lang-switch {
  display: inline-flex; border: 1.5px solid var(--color-border); border-radius: 999px; overflow: hidden; font-weight: 700; font-size: 0.85rem;
}
.lang-switch a, .lang-switch span { padding: 0.4rem 0.75rem; color: var(--gray-700); }
.lang-switch [aria-current="true"] { background: var(--color-brand); color: var(--white); }
.lang-switch a:hover { text-decoration: none; background: var(--maroon-050); }

.nav-toggle {
  display: none; background: none; border: none; padding: 0.4rem; color: var(--color-brand-strong);
}
.nav-toggle svg { width: 28px; height: 28px; }

@media (max-width: 960px) {
  .main-nav__list { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions .btn-primary.header-cta { display: none; }
}

.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0 0; background: var(--white); z-index: 490;
  display: none; overflow-y: auto; padding: var(--space-4) var(--space-3);
}
.mobile-nav.is-open { display: block; }
.mobile-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-nav__list a { display: block; padding: 0.9rem 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--gray-900); border-block-end: 1px solid var(--color-border); }
.mobile-nav__cta { margin-block-start: var(--space-4); display: flex; flex-direction: column; gap: 0.75rem; }

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
.hero {
  position: relative; color: var(--white); overflow: hidden;
  min-height: min(88vh, 780px); display: flex; align-items: flex-end;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(33,14,10,0.55) 0%, rgba(33,14,10,0.35) 35%, rgba(28,10,7,0.92) 100%);
}
.hero__content { position: relative; z-index: 2; padding-block: var(--space-7) var(--space-5); width: 100%; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.5em; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35); padding: 0.4rem 0.9rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.03em; margin-block-end: var(--space-3);
}
.hero__eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
/* The headline names the products (interiors, door frames, shaft cladding), so it is longer:
   a slightly smaller scale plus balanced wrapping keeps it to tidy lines on phones and desktop */
.hero h1 {
  color: var(--white); max-width: 22ch; margin-block-end: var(--space-2);
  font-size: clamp(2rem, 1.35rem + 2.3vw, 3.25rem); text-wrap: balance;
}
.hero__lead { max-width: 56ch; font-size: var(--fs-lead); color: var(--gray-100); margin-block-end: var(--space-4); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-block-end: var(--space-4); }
.hero__credibility {
  display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.95rem; font-weight: 600; color: var(--gray-100);
  border-inline-start: 3px solid var(--color-accent); padding-inline-start: 0.9rem;
}

/* ---------------------------------------------------------------------- */
/* Trust strip                                                             */
/* ---------------------------------------------------------------------- */
.trust-strip { background: var(--maroon-900); color: var(--white); padding-block: var(--space-4); }
.trust-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3);
  text-align: center;
}
.trust-grid__item { padding-inline: 0.5rem; }
.trust-grid__value { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 800; color: var(--color-accent); display: block; }
.trust-grid__label { font-size: 0.88rem; color: var(--gray-200); }
.trust-grid__item + .trust-grid__item { border-inline-start: 1px solid rgba(255,255,255,0.15); }
@media (max-width: 720px) { .trust-grid__item + .trust-grid__item { border-inline-start: none; } }
/* Text values (e.g. Arabic «مصنع رأس الخيمة») can wrap to two lines while the numbers beside them don't.
   Value and label share row tracks across each grid row, so labels in a row always start at the same height. */
.trust-grid__value { text-wrap: balance; }
@supports (grid-template-rows: subgrid) {
  .trust-grid__item { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
  .trust-grid__value { align-self: end; }
  .trust-grid__label { line-height: calc(var(--fs-body) * var(--lh-normal)); } /* same leading as before it became a grid item */
}

/* ---------------------------------------------------------------------- */
/* Cards: capabilities / products / certs                                  */
/* ---------------------------------------------------------------------- */
.grid { display: grid; gap: var(--space-3); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-3); transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  height: 100%; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--maroon-100); }
.card__icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--maroon-050);
  display: flex; align-items: center; justify-content: center; margin-block-end: var(--space-2); flex-shrink: 0;
}
.card__icon svg { width: 28px; height: 28px; color: var(--color-brand); }
.card h3 { font-size: 1.15rem; margin-block-end: 0.4rem; }
.card p { color: var(--color-text-muted); font-size: 0.95rem; flex-grow: 1; }
.card__link { font-weight: 700; font-size: 0.9rem; margin-block-start: 0.75rem; display: inline-flex; align-items: center; gap: 0.3em; }

.product-card { overflow: hidden; padding: 0; }
.product-card__media { aspect-ratio: 4/3; overflow: hidden; background: var(--gray-100); }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.product-card:hover .product-card__media img { transform: scale(1.05); }
.product-card__body { padding: var(--space-3); }
.product-card__benefits { list-style: none; padding: 0; margin: 0.6rem 0 0.9rem; font-size: 0.9rem; color: var(--color-text-muted); }
.product-card__benefits li { padding-inline-start: 1.4em; position: relative; margin-block-end: 0.35em; }
.product-card__benefits li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0.5em; width: 8px; height: 8px;
  border-radius: 50%; background: var(--color-accent);
}

/* ---------------------------------------------------------------------- */
/* Factory overview / split sections                                       */
/* ---------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: var(--space-4); } }
.split--reverse .split__media { order: 2; }
@media (max-width: 860px) { .split--reverse .split__media { order: 0; } }
.split__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }
.split__list { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: 0.9rem; }
.split__list li { display: flex; gap: 0.75rem; align-items: flex-start; }
.split__list .check {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--maroon-050);
  color: var(--color-brand); display: flex; align-items: center; justify-content: center; margin-block-start: 0.1em;
}
.split__list .check svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------------- */
/* Process timeline                                                        */
/* ---------------------------------------------------------------------- */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4) var(--space-3); counter-reset: step; position: relative; }
@media (max-width: 980px) { .timeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .timeline { grid-template-columns: 1fr; } }
.timeline__step { position: relative; padding-block-start: var(--space-2); }
.timeline__num {
  counter-increment: step; width: 42px; height: 42px; border-radius: 50%; background: var(--color-brand);
  color: var(--white); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-block-end: 0.9rem;
}
.timeline__num::before { content: counter(step); }
.timeline__step h3 { font-size: 1rem; margin-block-end: 0.3rem; }
.timeline__step p { font-size: 0.88rem; color: var(--color-text-muted); margin: 0; }

/* ---------------------------------------------------------------------- */
/* Quality / certificates                                                   */
/* ---------------------------------------------------------------------- */
.cert-card { text-align: center; align-items: center; }
.cert-card__badge {
  width: 64px; height: 64px; border-radius: 50%; background: var(--maroon-050); color: var(--color-brand);
  display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-2);
}
.cert-card__badge svg { width: 32px; height: 32px; }

/* ---------------------------------------------------------------------- */
/* Customization                                                           */
/* ---------------------------------------------------------------------- */
.swatch-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-block: 0.75rem; }
.swatch {
  width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 0 0 1.5px var(--color-border);
  cursor: pointer; flex-shrink: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--color-brand); }
.custom-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block-end: var(--space-3); }
.custom-tab {
  padding: 0.55rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--color-border); background: var(--white);
  font-weight: 700; font-size: 0.9rem; color: var(--gray-700);
}
.custom-tab[aria-selected="true"] { background: var(--color-brand); border-color: var(--color-brand); color: var(--white); }

/* ---------------------------------------------------------------------- */
/* Gallery + lightbox                                                       */
/* ---------------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery__item {
  position: relative; border: none; padding: 0; background: none; border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 1/1; display: block; width: 100%;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 350ms ease; }
.gallery__item:hover img { transform: scale(1.08); }
.gallery__item::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(20,8,6,0.75) 100%);
  opacity: 0; transition: opacity var(--transition);
}
.gallery__item:hover::after { opacity: 1; }
.gallery__caption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 0.6rem 0.7rem; color: var(--white); font-size: 0.78rem;
  font-weight: 600; opacity: 0; transform: translateY(6px); transition: var(--transition); text-align: start; z-index: 2;
}
.gallery__item:hover .gallery__caption, .gallery__item:focus-visible .gallery__caption { opacity: 1; transform: translateY(0); }
.gallery__item.gallery__video::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,0.9) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2353140C"><path d="M8 5v14l11-7z"/></svg>') center/22px no-repeat;
  z-index: 3;
}

.lightbox {
  position: fixed; inset: 0; z-index: 900; background: rgba(15,6,4,0.94); display: none;
  align-items: center; justify-content: center; padding: var(--space-3);
}
.lightbox.is-open { display: flex; }
.lightbox__frame { max-width: min(1100px, 92vw); max-height: 84vh; text-align: center; }
.lightbox__frame img { max-height: 78vh; width: auto; margin-inline: auto; border-radius: var(--radius-sm); }
.lightbox__caption { color: var(--gray-100); margin-block-start: 0.8rem; font-size: 0.95rem; }
.lightbox__close, .lightbox__prev, .lightbox__next {
  position: absolute; background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.4); color: var(--white);
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.lightbox__close:hover, .lightbox__prev:hover, .lightbox__next:hover { background: rgba(255,255,255,0.22); }
.lightbox__close { top: var(--space-3); inset-inline-end: var(--space-3); }
.lightbox__prev { inset-inline-start: var(--space-3); top: 50%; transform: translateY(-50%); }
.lightbox__next { inset-inline-end: var(--space-3); top: 50%; transform: translateY(-50%); }
[dir="rtl"] .lightbox__prev svg, [dir="rtl"] .lightbox__next svg { transform: scaleX(-1); }

/* ---------------------------------------------------------------------- */
/* Projects filter                                                         */
/* ---------------------------------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-block-end: var(--space-4); }
.filter-chip {
  padding: 0.5rem 1.05rem; border-radius: 999px; border: 1.5px solid var(--color-border); background: var(--white);
  font-weight: 700; font-size: 0.88rem; color: var(--gray-700);
}
.filter-chip[aria-pressed="true"] { background: var(--color-brand); border-color: var(--color-brand); color: var(--white); }
.project-card__tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--color-brand); background: var(--maroon-050); padding: 0.25rem 0.6rem; border-radius: 999px; margin-block-end: 0.6rem;
}

/* ---------------------------------------------------------------------- */
/* Why Massaed                                                             */
/* ---------------------------------------------------------------------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
@media (max-width: 860px) { .why-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .why-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------- */
/* Factory visit CTA                                                       */
/* ---------------------------------------------------------------------- */
.visit-cta {
  background: linear-gradient(120deg, var(--maroon-900) 0%, var(--maroon-800) 100%);
  color: var(--white); border-radius: var(--radius-lg); padding: var(--space-5);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-4); align-items: center;
}
.visit-cta h2 { color: var(--white); }
.visit-cta p, .visit-cta li { color: var(--gray-100); }
.visit-cta--dark { background: linear-gradient(120deg, var(--gray-900) 0%, var(--gray-800) 100%); grid-template-columns: 1.4fr auto; }
@media (max-width: 860px) { .visit-cta, .visit-cta--dark { grid-template-columns: 1fr; padding: var(--space-4) var(--space-3); } }
.visit-cta ul { list-style: none; padding: 0; margin: var(--space-2) 0; display: grid; gap: 0.6rem; }
.visit-cta ul li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; }
.visit-cta__map { border-radius: var(--radius-md); overflow: hidden; border: 1px solid rgba(255,255,255,0.2); }
.visit-cta__map iframe { width: 100%; height: 260px; border: 0; display: block; }

/* ---------------------------------------------------------------------- */
/* Lead form                                                                */
/* ---------------------------------------------------------------------- */
.form-card {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--space-4); border: 1px solid var(--color-border);
}
@media (max-width: 560px) { .form-card { padding: var(--space-3) var(--space-2); border-radius: var(--radius-md); } }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); margin-block-end: var(--space-3); }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field input:not([type="checkbox"]), .field select, .field textarea { width: 100%; min-width: 0; }
.hp-field { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 0.9rem; color: var(--gray-800); }
.field .req { color: var(--color-brand); }
.field input, .field select, .field textarea {
  padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); border: 1.5px solid var(--color-border);
  font-family: inherit; font-size: 0.95rem; background: var(--white); color: var(--gray-900);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--color-brand); box-shadow: 0 0 0 3px var(--maroon-100); outline: none;
}
.field textarea { resize: vertical; min-height: 110px; }
.field-hint { font-size: 0.8rem; color: var(--color-text-muted); }
.field-error { font-size: 0.82rem; color: var(--error); display: none; font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error); }
.field.has-error .field-error { display: block; }
/* Mobile / email group: one of the two is required — the shared note carries the error */
.field.contact-missing input { border-color: var(--error); }
.form-note {
  font-size: 0.88rem; color: var(--color-text-muted);
  margin: 0 0 calc(var(--space-1) - var(--space-3)); /* sits close to the two fields it describes */
}
.form-note .req { color: var(--color-brand); }
.form-note.is-error { color: var(--error); font-weight: 600; }
.form-note.is-error .req { color: inherit; }
.field--file { border: 1.5px dashed var(--color-border); border-radius: var(--radius-sm); padding: var(--space-2); text-align: center; }
.checkbox-row { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.88rem; color: var(--color-text-muted); }
.checkbox-row input { margin-block-start: 0.25em; flex-shrink: 0; }
.field--consent { margin-block: var(--space-2) var(--space-3); }

/* Design attached from the 3D cabin configurator (shown by main.js) */
.design-attached, .visit-note {
  background: var(--maroon-050); border: 1.5px solid var(--maroon-100); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3); margin-block-end: var(--space-3);
}
.design-attached__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.35rem var(--space-2); }
.design-attached__title { color: var(--color-brand-strong); }
/* Padding widens the tap target to ~40px; the matching negative margin keeps the layout unchanged */
.design-attached__edit { font-weight: 700; font-size: var(--fs-small); padding-block: 0.6rem; margin-block: -0.6rem; }
.design-attached__list { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.design-attached__list li {
  background: var(--white); border: 1px solid var(--color-border); border-radius: 1.1rem; /* stays rounded if a long finish name wraps */
  padding: 0.25rem 0.7rem; font-size: 0.85rem; line-height: 1.4;
  min-width: 0; max-width: 100%; overflow-wrap: anywhere; /* a very long finish name wraps instead of widening the page */
}
/* "Factory visit request" note, added above the fields by main.js on a visit intent */
.visit-note { margin-block-start: 0; padding: 0.75rem var(--space-2); font-weight: 600; font-size: 0.9rem; color: var(--color-brand-strong); }
.design-attached__label { color: var(--color-text-muted); margin-inline-end: 0.15rem; } /* plus the space text node added by main.js */

/* Optional project details, collapsed by default */
details.form-more {
  border-block: 1px solid var(--color-border); padding-block: var(--space-2); margin-block-end: var(--space-3);
}
details.form-more > summary {
  display: flex; align-items: center; gap: 0.6rem; /* full-width row = large tap target on phones */
  padding-block: 0.75rem; margin-block: -0.75rem; /* ~49px tall to tap, same visual position (inside the details padding) */
  cursor: pointer; font-weight: 700; color: var(--color-brand); list-style: none; border-radius: 4px;
}
details.form-more > summary::-webkit-details-marker { display: none; }
details.form-more > summary::marker { content: ""; }
/* Plus sign in a ring that turns into a minus when open — symmetric, so it needs no RTL flip */
details.form-more > summary::before {
  content: ""; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--color-border);
  background:
    linear-gradient(currentColor, currentColor) center / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 10px no-repeat;
  transition: transform var(--transition), background-size var(--transition);
}
details.form-more[open] > summary::before {
  transform: rotate(180deg);
  background-size: 10px 2px, 2px 0;
}
details.form-more > summary:hover { color: var(--maroon-700); }
details.form-more > summary:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 0; }
details.form-more > .form-grid { margin-block: var(--space-3) 0; }

.form-fallback { margin-block-start: var(--space-2); display: flex; flex-wrap: wrap; gap: 0.6rem; }
.form-status { display: none; padding: 1rem 1.1rem; border-radius: var(--radius-sm); margin-block-end: var(--space-3); font-weight: 600; }
.form-status.is-success { display: block; background: #eaf6ef; color: var(--success); border: 1px solid #bfe4cf; }
.form-status.is-error { display: block; background: #fbeceb; color: var(--error); border: 1px solid #f0c6c3; }

/* ---------------------------------------------------------------------- */
/* FAQ accordion                                                           */
/* ---------------------------------------------------------------------- */
.accordion { border-block-start: 1px solid var(--color-border); max-width: 900px; }
.accordion-item { border-block-end: 1px solid var(--color-border); }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: none; border: none; padding: 1.2rem 0.25rem; text-align: start; font-weight: 700; font-size: 1.02rem; color: var(--gray-900);
}
.accordion-trigger .plus { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--color-border); position: relative; }
.accordion-trigger .plus::before, .accordion-trigger .plus::after {
  content: ""; position: absolute; background: var(--color-brand); top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.accordion-trigger .plus::before { width: 12px; height: 2px; }
.accordion-trigger .plus::after { width: 2px; height: 12px; transition: transform var(--transition); }
.accordion-trigger[aria-expanded="true"] .plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.accordion-panel { display: none; padding: 0 0.25rem 1.3rem; color: var(--color-text-muted); max-width: 70ch; }
.accordion-panel.is-open { display: block; }

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */
.site-footer { background: var(--gray-900); color: var(--gray-200); padding-block: var(--space-6) calc(var(--space-5) + 70px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-4); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h3 { color: var(--white); font-size: 1rem; margin-block-end: 0.9rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; font-size: 0.9rem; }
.footer-grid a { color: var(--gray-300); }
.footer-grid a:hover { color: var(--white); }
.footer-logo img { height: 40px; width: auto; margin-block-end: 0.9rem; }
.footer-grid li { color: var(--gray-300); }
.footer-social { display: flex; gap: 0.6rem; margin-block-start: 1rem; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}
.footer-social svg { width: 18px; height: 18px; }
.footer-bottom {
  border-block-start: 1px solid rgba(255,255,255,0.12); margin-block-start: var(--space-5); padding-block-start: var(--space-3);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: 0.82rem; color: var(--gray-300);
}
.footer-bottom a { color: var(--gray-300); }
.site-footer--compact { padding-block: var(--space-2) var(--space-4); }
.site-footer--compact .footer-bottom { border: 0; margin: 0; }

/* Legal / long-form text pages */
.legal { max-width: 820px; }
.legal h2 { font-size: 1.35rem; margin-block: var(--space-4) var(--space-1); }
.legal ul { display: grid; gap: 0.5rem; }
.legal code { font-size: 0.9em; background: var(--gray-100); padding: 0.1em 0.35em; border-radius: 4px; }

/* ---------------------------------------------------------------------- */
/* Mobile sticky CTA bar                                                    */
/* ---------------------------------------------------------------------- */
/* Three differentiated actions: Request a Quote (primary, wider, maroon), WhatsApp, Factory Visit */
.sticky-cta {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 480; background: var(--white);
  border-block-start: 1px solid var(--color-border); box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  display: none; grid-template-columns: 1.4fr 1fr 1fr;
  padding-block-end: env(safe-area-inset-bottom, 0px);
}
.sticky-cta a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  min-height: 56px; min-width: 0; padding: 0.5rem 0.3rem;
  font-size: 0.72rem; font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: break-word;
  color: var(--gray-800); text-decoration: none;
}
.sticky-cta a svg { width: 20px; height: 20px; flex-shrink: 0; }
.sticky-cta a.sticky-cta__quote { background: var(--color-brand); color: var(--white); font-size: 0.8rem; font-weight: 700; }
.sticky-cta a.sticky-cta__quote:active { background: var(--maroon-700); }
/* Darker green label for contrast on white (~5:1); the icon keeps the WhatsApp brand green */
.sticky-cta a.sticky-cta__whatsapp { color: #15803d; }
.sticky-cta a.sticky-cta__whatsapp svg { color: #25d366; }
.sticky-cta a.sticky-cta__visit { color: var(--gray-800); }
@media (max-width: 720px) {
  .sticky-cta { display: grid; }
  body { padding-block-end: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------------------------------------------------------------------- */
/* Utilities                                                                */
/* ---------------------------------------------------------------------- */
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
[data-animate] { opacity: 0; transform: translateY(16px); transition: opacity 550ms ease, transform 550ms ease; }
[data-animate].in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-animate] { opacity: 1; transform: none; } }

.badge-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700;
  padding: 0.4rem 0.8rem; border-radius: 999px; background: var(--gray-100); color: var(--gray-700);
}

.breadcrumbs { font-size: 0.85rem; color: var(--gray-500); padding-block: var(--space-2); }
.breadcrumbs a { color: var(--gray-500); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-inline-start: 0.4rem; color: var(--gray-300); }
[dir="rtl"] .breadcrumbs li:not(:last-child)::after { content: "\\"; }
