/* ============================================================
   LAYOUT.CSS — Structural layout: header, footer, grid, sections
   ============================================================ */

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

section { position: relative; }
.section-pad { padding-block: var(--sp-7); }
.section-pad-sm { padding-block: var(--sp-6); }

.grid { display: grid; gap: var(--sp-3); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.center { align-items: center; justify-content: center; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

/* ---------------- HEADER ---------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 200;
  display: flex;
  align-items: center;
  background: rgba(247, 247, 245, 0.0);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              backdrop-filter var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.site-header.is-scrolled {
  background: rgba(247, 247, 245, 0.78);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--c-line);
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--c-ink);
  white-space: nowrap;
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(155deg, var(--c-depth), var(--c-ink));
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand small { display: block; font-family: var(--f-body); font-weight: 500; font-size: 0.7rem; color: var(--c-steel); letter-spacing: 0.02em; }

.main-nav { display: flex; align-items: center; gap: var(--sp-4); }
.main-nav ul { display: flex; gap: var(--sp-3); }
.main-nav a {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--c-ink-soft);
  padding: 8px 2px;
  position: relative;
}
.main-nav a::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--c-signal);
  transition: right var(--dur-base) var(--ease-out);
}
.main-nav a:hover::after, .main-nav a.active::after { right: 0; }
.main-nav a.active { color: var(--c-ink); }

.header-cta { display: flex; align-items: center; gap: var(--sp-2); }

/* Visually-hidden checkbox that drives the mobile menu with pure CSS.
   Stays focusable/operable via keyboard (not display:none), so the
   menu works even if JavaScript never runs. */
.nav-check-input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  align-items: center; justify-content: center;
  background: var(--c-mist);
  cursor: pointer;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--c-ink);
  transition: all var(--dur-fast) var(--ease-out);
}
.nav-toggle::before { transform: translateY(-6px); }
.nav-toggle::after { transform: translateY(6px); }

/* Open state driven by the checkbox (works with zero JS).
   .is-open class selectors are kept too so JS-based enhancements
   (if present) continue to work identically. */
#nav-check:checked ~ .site-header .nav-toggle span,
.nav-toggle.is-open span { background: transparent; }
#nav-check:checked ~ .site-header .nav-toggle::before,
.nav-toggle.is-open::before { transform: rotate(45deg); }
#nav-check:checked ~ .site-header .nav-toggle::after,
.nav-toggle.is-open::after { transform: rotate(-45deg); }

/* Prevent background scroll while the drawer is open, where supported */
body:has(#nav-check:checked) { overflow: hidden; }

/* Mobile drawer */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 190;
  background: var(--c-paper);
  display: flex; flex-direction: column;
  padding: calc(var(--header-h) + var(--sp-3)) var(--sp-3) var(--sp-5);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-in-out);
}
/* Checkbox-driven (works without JS); .is-open kept for JS parity */
#nav-check:checked ~ .mobile-drawer,
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer__close {
  position: absolute; top: var(--sp-3); right: var(--sp-3);
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-mist); color: var(--c-ink); cursor: pointer;
}
.mobile-drawer ul { display: flex; flex-direction: column; gap: var(--sp-1); }
.mobile-drawer a { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.mobile-drawer .theme-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px;
  border-radius: var(--r-full);
  background: var(--c-mist);
  color: var(--c-ink);
  font-weight: 700; font-size: 0.96rem;
}
.mobile-drawer .theme-toggle svg { width: 19px; height: 19px; }

/* ---------------- FOOTER ---------------- */
.site-footer {
  background: var(--c-ink);
  color: #C9D2D8;
  padding-block: var(--sp-6) var(--sp-3);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1.1fr;
  gap: var(--sp-4);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-col h5 {
  font-family: var(--f-display);
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: var(--sp-2);
  letter-spacing: 0.01em;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a, .footer-col p { color: #A9B4BB; font-size: 0.92rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: var(--sp-3);
  font-size: 0.85rem;
  color: #7E8B93;
  flex-wrap: wrap; gap: var(--sp-2);
}
.footer-bottom .legal-links { display: flex; gap: var(--sp-3); }

/* ---------------- STICKY MOBILE ACTION BAR ---------------- */
.mobile-action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 180;
  display: none;
  gap: 1px;
  background: var(--c-line);
  box-shadow: 0 -8px 24px rgba(16,24,32,0.12);
}
.mobile-action-bar a {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 0;
  font-weight: 700; font-size: 0.95rem;
  background: var(--c-paper-raised);
}
.mobile-action-bar a.call { background: var(--c-signal); color: #fff; }
.mobile-action-bar a.whatsapp { background: #1E8E5A; color: #fff; }

/* ---------------- BREADCRUMB ---------------- */
.breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--c-steel-soft);
  padding-top: calc(var(--header-h) + var(--sp-3));
}
.breadcrumb a { color: var(--c-steel); font-weight: 600; }
.breadcrumb a:hover { color: var(--c-signal); }
.breadcrumb span[aria-current] { color: var(--c-ink); font-weight: 600; }
