/* ═══════════════════════════════════════════════════════════════════════════
   HELENA BRAND — single source of truth for the locked brand direction.
   Loaded by index.html, about.html, contact.html.
   Pairs with js/helena-runtime.js, which injects the header markup.
   Brand archetype: oticahelena_brand_locked
   ─── Palette: firetruck red + terracotta + warm-grey scale (no green)
   ─── Type:    Bebas Neue (display) · Anton (h1/h2 alt) · Inter (body)
   ─── Voice:   aggressive Brazilian retail, owner-as-brand
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --color-brand:        #C1121F;
  --color-brand-dark:   #8a0d16;
  --color-accent:       #c45c2a;
  --color-accent-soft:  #e9b389;
  --color-base:         #faf6f0;
  --color-surface:      #ffffff;
  --color-grey-100:     #f3f0ea;
  --color-grey-300:     #d6d2cb;
  --color-grey-500:     #8a857d;
  --color-grey-700:     #3f3b35;
  --color-grey-900:     #1a1714;

  --font-display:       'Bebas Neue', sans-serif;
  --font-display-alt:   'Anton', sans-serif;
  --font-body:          'Inter', sans-serif;

  --hh-ease:            cubic-bezier(.7, 0, .2, 1);
}

/* ─── Hide the legacy fh5co sidebar wherever this file is loaded ─────── */
#fh5co-aside,
#fh5co-nav-toggle,
#mobile-nav-overlay { display: none !important; }
#fh5co-main { margin-left: 0 !important; }

/* ─── Top header (Woodz-inspired) ────────────────────────────────────── */
/* High-specificity rules so legacy css/style.css can't override on subpages */
body[data-helena-brand="on"] #helena-header {
  position: sticky; top: 0; z-index: 1100;
  background: #ffffff;
  border-bottom: 1px solid var(--color-grey-300);
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2rem;
  font-family: var(--font-body);
  margin: 0;
}
body[data-helena-brand="on"] #helena-header .hh-logo {
  font-family: var(--font-display); font-size: 2rem !important; letter-spacing: .04em;
  color: var(--color-grey-900); text-decoration: none; line-height: 1;
  font-weight: 400;
  margin: 0; padding: 0;
}
body[data-helena-brand="on"] #helena-header #hh-nav { flex: 1; display: flex; justify-content: center; }
body[data-helena-brand="on"] #helena-header .hh-nav-list {
  display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0;
}
body[data-helena-brand="on"] #helena-header .hh-link {
  position: relative; padding: .5rem 0;
  font-family: var(--font-body) !important;
  font-size: 1rem !important; font-weight: 500 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase;
  color: var(--color-grey-900) !important;
  text-decoration: none;
  transition: color .2s ease;
  display: inline-block;
  background: transparent;
  border: 0;
  cursor: pointer;
  line-height: 1;
}
body[data-helena-brand="on"] #helena-header .hh-link::after {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: 0;
  height: 2px; background: var(--color-brand);
  transition: left .25s ease, right .25s ease;
}
body[data-helena-brand="on"] #helena-header .hh-link:hover,
body[data-helena-brand="on"] #helena-header .hh-link[aria-expanded="true"] { color: var(--color-brand) !important; }
body[data-helena-brand="on"] #helena-header .hh-link:hover::after,
body[data-helena-brand="on"] #helena-header .hh-link[aria-expanded="true"]::after { left: 0; right: 0; }
body[data-helena-brand="on"] #helena-header .hh-has-sub > .hh-link::after {
  /* override default dropdown indicator with subtle bottom border */
}
body[data-helena-brand="on"] #helena-header .hh-has-sub > .hh-link {
  padding-right: 1rem;
}
body[data-helena-brand="on"] #helena-header .hh-has-sub > .hh-link::before {
  content: "▾"; margin-left: .35rem; font-size: .65em;
  color: var(--color-accent);
  display: inline-block;
  transition: transform .25s ease;
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
}
body[data-helena-brand="on"] #helena-header .hh-has-sub > .hh-link[aria-expanded="true"]::before {
  transform: translateY(-50%) rotate(180deg);
}
body[data-helena-brand="on"] #helena-header .hh-icons { display: flex; gap: 1rem; align-items: center; }
body[data-helena-brand="on"] #helena-header .hh-icons > a {
  color: var(--color-grey-700); font-size: 1.1rem;
  transition: color .2s ease; text-decoration: none;
}
body[data-helena-brand="on"] #helena-header .hh-icons > a:hover { color: var(--color-accent); }

#hh-menu-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 0; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
}
#hh-menu-toggle span {
  width: 26px; height: 2px;
  background: var(--color-grey-900);
  transition: transform .25s var(--hh-ease), opacity .25s ease;
}
body.menu-open #hh-menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open #hh-menu-toggle span:nth-child(2) { opacity: 0; }
body.menu-open #hh-menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE: kill the horizontal header entirely, keep only a floating burger.
   The original media-query rules above had lower specificity than the base
   `body[data-helena-brand="on"] #helena-header …` selectors, so #hh-nav
   stayed `display:flex` on phones and overflowed the viewport horizontally.
   Below we use the same body[data-…] prefix so specificity wins, and we
   convert the sticky bar into a transparent fixed container whose only
   visible child is the burger button. */
@media (max-width: 1024px) {
  body[data-helena-brand="on"] #helena-header {
    position: fixed;
    top: 0; left: auto; right: 0;
    width: auto;
    background: transparent !important;
    border-bottom: 0 !important;
    padding: 12px !important;
    justify-content: flex-end !important;
  }
  body[data-helena-brand="on"] #helena-header .hh-logo,
  body[data-helena-brand="on"] #helena-header #hh-nav,
  body[data-helena-brand="on"] #helena-header .hh-icons > a {
    display: none !important;
  }
  body[data-helena-brand="on"] #helena-header .hh-icons {
    gap: 0 !important;
  }
  #hh-menu-toggle {
    display: flex !important;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    backdrop-filter: saturate(180%) blur(8px);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  }
  /* Defensive: no element should be able to cause horizontal scroll on mobile */
  html, body { overflow-x: hidden !important; max-width: 100vw; }
}

/* ─── Submenu side panel (slide-from-left BELOW header — fixes hover bounce) ──
   Critical fix: panel starts at top=72px (below header) so it never covers
   the trigger button. This was the root cause of the "menu pula" bug —
   when the panel covered the trigger, mouseenter trigger re-fired on close,
   causing an open/close loop. */
#hh-subpanel {
  position: fixed; top: 72px; left: 0; bottom: 0;
  width: min(440px, 84vw);
  background: var(--color-surface);
  border-right: 1px solid var(--color-grey-300);
  padding: 3rem 2.5rem 2rem;
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform .4s var(--hh-ease);
  box-shadow: 8px 0 32px rgba(0, 0, 0, .08);
  overflow-y: auto;
  visibility: hidden;
}
#hh-subpanel.open { transform: translateX(0); visibility: visible; }
.hh-sub-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  border: 0; background: transparent;
  font-size: 1.6rem; line-height: 1;
  color: var(--color-grey-500); cursor: pointer;
  border-radius: 50%;
  transition: color .2s ease, background-color .2s ease;
}
.hh-sub-close:hover { color: var(--color-brand); background: var(--color-grey-100); }
.hh-sub-eyebrow {
  font-family: var(--font-body); font-size: .75rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--color-accent); margin: 0 0 .25rem;
}
.hh-sub-display {
  font-family: var(--font-display); font-weight: 400;
  font-size: 2.5rem; line-height: 1.05; letter-spacing: .02em;
  color: var(--color-brand);
  margin: 0 0 1.75rem;
}
.hh-sub-list { list-style: none; margin: 0; padding: 0; }
.hh-sub-list a {
  position: relative;
  display: block;
  padding: .9rem .25rem;
  color: var(--color-grey-900); text-decoration: none;
  font-family: var(--font-display-alt); font-weight: 400;
  font-size: 1.4rem; line-height: 1.2;
  text-transform: uppercase; letter-spacing: .02em;
  transition: color .25s ease, padding-left .3s var(--hh-ease);
}
/* Animated underline on hover, no static lines between items */
.hh-sub-list a::after {
  content: ""; position: absolute; left: .25rem; right: 100%; bottom: .4rem;
  height: 1px; background: var(--color-brand);
  transition: right .35s var(--hh-ease);
}
.hh-sub-list a:hover {
  color: var(--color-brand);
  padding-left: 1rem;
}
.hh-sub-list a:hover::after { right: 30%; }
.hh-sub-num { display: none; }

/* Backdrop dim while subpanel or mobile drawer is open */
body.subpanel-open::before,
body.menu-open::before {
  content: ""; position: fixed; inset: 0; z-index: 1150;
  background: rgba(26, 23, 20, .35);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  animation: hh-fade .3s ease both;
}
body.menu-open::before { z-index: 1250; }
@keyframes hh-fade { from { opacity: 0 } to { opacity: 1 } }

/* ─── Mobile full-screen menu (Squarespace-style; matches Serviços panel) ─
   Replaces the previous off-canvas drawer. Covers the whole viewport,
   slides down from the top, and uses the same eyebrow / Bebas display /
   Anton list + animated underline pattern as #hh-subpanel for visual
   continuity with the Serviços submenu. */
#hh-mobile {
  position: fixed; inset: 0;
  width: 100%;
  height: 100vh; height: 100dvh;
  background: var(--color-surface);
  z-index: 1300;
  padding: 4.5rem 1.75rem calc(2rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(-100%);
  transition: transform .45s var(--hh-ease);
  overflow-y: auto;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
#hh-mobile.open { transform: translateY(0); visibility: visible; }
#hh-mobile .hh-logo { display: none; }
.hh-mobile-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  border: 0; background: transparent;
  font-size: 1.8rem; line-height: 1;
  color: var(--color-grey-500); cursor: pointer;
  border-radius: 50%;
  transition: color .2s ease, background-color .2s ease;
}
.hh-mobile-close:hover { color: var(--color-brand); background: var(--color-grey-100); }
.hh-mobile-eyebrow {
  font-family: var(--font-body); font-size: .75rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--color-accent); margin: 0 0 .25rem;
}
.hh-mobile-display {
  font-family: var(--font-display); font-weight: 400;
  font-size: 2.5rem; line-height: 1.05; letter-spacing: .02em;
  color: var(--color-brand);
  margin: 0 0 1.5rem;
}
.hh-mobile-list { list-style: none; margin: 0; padding: 0; }
.hh-mobile-list li { margin: 0; }
.hh-mobile-list a {
  position: relative;
  display: block;
  padding: .9rem .25rem;
  color: var(--color-grey-900); text-decoration: none;
  font-family: var(--font-display-alt); font-weight: 400;
  font-size: 1.6rem; line-height: 1.2;
  text-transform: uppercase; letter-spacing: .02em;
  transition: color .25s ease, padding-left .3s var(--hh-ease);
}
.hh-mobile-list a::after {
  content: ""; position: absolute; left: .25rem; right: 100%; bottom: .4rem;
  height: 1px; background: var(--color-brand);
  transition: right .35s var(--hh-ease);
}
.hh-mobile-list a:hover,
.hh-mobile-list a:focus-visible {
  color: var(--color-brand); padding-left: 1rem;
}
.hh-mobile-list a:hover::after,
.hh-mobile-list a:focus-visible::after { right: 30%; }
.hh-mobile-contact {
  margin-top: auto;
  display: flex; flex-direction: column; gap: .35rem;
  font-family: var(--font-body); font-size: .95rem;
  color: var(--color-grey-700);
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-grey-300);
}
.hh-mobile-contact a { color: inherit; text-decoration: none; }
.hh-mobile-contact a:hover { color: var(--color-brand); }
.hh-mobile-social { display: flex; gap: 1rem; margin-top: .25rem; }
.hh-mobile-social a {
  font-size: 1.4rem; color: var(--color-accent); text-decoration: none;
  transition: color .2s ease;
}
.hh-mobile-social a:hover { color: var(--color-brand); }

/* Full-screen menu is opaque — kill the dim/blur backdrop that the
   side-drawer needed (still kept for the Serviços side-panel). */
body.menu-open::before { display: none; }

/* Body scroll-lock — works on iOS Safari (the previous overflow:hidden approach didn't) */
body.menu-open { overflow: hidden; height: 100vh; touch-action: none; }
body.subpanel-open { overflow: hidden; }

/* ─── Per-page hero (locked brand spec, used by Sobre + Contato) ─────── */
.page-hero {
  display: grid; grid-template-columns: 55% 45%;
  min-height: 60vh;
  background: var(--color-base);
}
.page-hero-photo {
  background-size: cover; background-position: center;
  background-color: var(--color-grey-100);
  min-height: 320px;
}
.page-hero-copy {
  display: flex; flex-direction: column; justify-content: center;
  gap: 1rem; padding: 4rem 3rem;
  background: var(--color-base);
}
.page-hero .eyebrow {
  font-family: var(--font-body); font-size: .75rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--color-accent); margin: 0;
}
.page-hero .hero-display {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(3rem, 6vw, 5rem); line-height: 1; letter-spacing: .02em;
  color: var(--color-brand); margin: 0;
}
.page-hero .hero-subhead {
  font-family: var(--font-display-alt); font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15;
  text-transform: uppercase;
  color: var(--color-grey-900); margin: 0;
}
.page-hero .hero-body {
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.55;
  color: var(--color-grey-700); margin: 0; max-width: 42ch;
}
@media (max-width: 768px) {
  .page-hero { grid-template-columns: 1fr; min-height: 0; }
  .page-hero-photo { height: 45vh; min-height: 280px; order: -1; }
  .page-hero-copy { padding: 2.5rem 1.5rem; }
}

/* ─── NAP contact band (re-usable across pages) ──────────────────────── */
.brand-band {
  background: var(--color-grey-900); color: var(--color-grey-100);
  font-family: var(--font-body); font-size: .875rem;
  padding: 1rem 1.5rem;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1.5rem;
}
.brand-band a { color: inherit; text-decoration: none; }
.brand-band a:hover { color: var(--color-accent-soft); }
.brand-band i { color: var(--color-accent); margin-right: .4rem; }

/* ─── Brand-themed CTA buttons ───────────────────────────────────────── */
.btn-brand-primary, .btn-brand-secondary {
  font-family: var(--font-display); font-size: 1.125rem; letter-spacing: .06em;
  padding: .85rem 1.6rem; border-radius: 999px;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: .5rem;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-brand-primary {
  background: var(--color-brand); color: #fff;
  border: 2px solid var(--color-brand);
}
.btn-brand-primary:hover {
  background: var(--color-brand-dark); border-color: var(--color-brand-dark);
  transform: translateY(-1px);
}
.btn-brand-secondary {
  background: transparent; color: var(--color-accent);
  border: 2px solid var(--color-accent);
}
.btn-brand-secondary:hover { background: var(--color-accent); color: #fff; }

/* ─── Anchor offset for sticky-header scroll ─────────────────────────── */
[id^="exames"], [id^="oculos"], [id^="varilux"], [id^="lentes"], [id^="historias"], [id^="servicos"], [id^="localizacao"], [id^="blog"] {
  scroll-margin-top: 80px;
}

/* ─── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #hh-subpanel, #hh-mobile, .hh-link::after, .hh-sub-list a, .hh-mobile-list a {
    transition: none !important; animation: none !important;
  }
}
