/* Ophicina do Cabelo — overrides responsivos
   Mobile-first overrides usando !important porque o markup base usa estilos inline.
   Não altera visual desktop ≥1024px. */

/* Container raiz pode encolher (já tem maxWidth:1280 + width:100% no JSX). */
html, body { overflow-x: hidden; }

/* ==========================================================================
   Tablet/mobile — abaixo de 1024px começa a empilhar
   ========================================================================== */

@media (max-width: 1023px) {

  /* Header — empilha logo / nav / CTA verticalmente em mobile */
  body > div > header[style*="padding: 20px 48px"],
  body > div > header[style*="padding: '20px 48px'"] {
    flex-wrap: wrap !important;
    padding: 16px 20px !important;
    gap: 12px !important;
  }

  /* Esconde nav links em mobile (sem hamburger por enquanto, CTA bastante) */
  header > nav[style*="gap: 28px"] { display: none !important; }

  /* Footer — stack 1.5fr 1fr 1fr 1fr → 1fr */
  footer[style*="background: var(--ink-900)"] > div[style*="grid"][style*="1.5fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
  footer[style*="background: var(--ink-900)"] {
    padding: 28px 20px !important;
  }
  footer[style*="background: var(--ink-900)"] > div:last-child {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center !important;
  }

  /* HERO unidade (height: 620 + paddings 48px) */
  section[style*="height: 620"] {
    height: clamp(440px, 75vh, 620px) !important;
  }
  /* Hero side label (right: 48 top: 32) */
  section[style*="height: 620"] > div[style*="top: 32px"][style*="right: 48px"],
  section[style*="height: 620"] > div[style*="top: 32"] {
    top: 16px !important;
    right: 16px !important;
    font-size: 9px !important;
  }
  /* Hero content (left: 48 bottom: 48) */
  section[style*="height: 620"] > div[style*="left: 48"][style*="bottom: 48"] {
    left: 20px !important;
    right: 20px !important;
    bottom: 24px !important;
    max-width: none !important;
  }
  /* Hero headline 108 → clamp */
  section[style*="height: 620"] h1[style*="font-size: 108"] {
    font-size: clamp(2.5rem, 11vw, 5rem) !important;
    line-height: 0.95 !important;
  }
  /* Address tag flutuante esconde em mobile */
  section[style*="height: 620"] > div[style*="rgba(26,26,29,0.85)"],
  section[style*="height: 620"] > div[style*="rgba(26, 26, 29, 0.85)"] {
    display: none !important;
  }

  /* INTRO section (110px 1fr 1fr → 1fr) */
  section[style*="grid-template-columns: 110px 1fr 1fr"],
  section[style*="gridTemplateColumns: '110px 1fr 1fr'"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 32px 20px !important;
  }
  /* Esconde label vertical em mobile */
  section[style*="110px"] > div[style*="vertical-rl"] { display: none !important; }
  /* Intro body fontSize 28 → clamp */
  section[style*="110px"] p[style*="font-size: 28"] {
    font-size: clamp(1.25rem, 4vw, 1.625rem) !important;
  }

  /* PORTRAIT section (1.1fr 1fr → 1fr) */
  section[style*="grid-template-columns: 1.1fr 1fr"],
  section[style*="gridTemplateColumns: '1.1fr 1fr'"] {
    grid-template-columns: 1fr !important;
  }
  /* Portrait image height 540 → aspect-ratio em mobile */
  section[style*="1.1fr 1fr"] > div[style*="height: 540"] {
    height: 360px !important;
  }
  /* Portrait info padding */
  section[style*="1.1fr 1fr"] > div[style*="padding: 56px 48px"] {
    padding: 32px 20px !important;
  }
  /* Buttons row stack */
  section[style*="1.1fr 1fr"] > div > div[style*="display: flex"][style*="gap: 10"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* GALLERY (4 cols → 2) */
  section[style*="padding: 48px 48px 56px"] > div[style*="repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  section[style*="padding: 48px 48px 56px"] {
    padding: 32px 20px !important;
  }

  /* Service category — outras categorias (4 cols → 2) */
  section[style*="padding: 48px 48px 64px"] > div[style*="repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }
  section[style*="padding: 48px 48px 64px"] {
    padding: 32px 20px !important;
  }
  /* Service category — CTA bone strip stack */
  section[style*="background: var(--bone)"][style*="space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 28px 20px !important;
  }
  /* Service category — hero altura reduzida */
  section[style*="height: 520"] {
    height: clamp(380px, 70vh, 520px) !important;
  }
  section[style*="height: 520"] h1 {
    font-size: clamp(2.25rem, 10vw, 4.5rem) !important;
  }
  section[style*="height: 520"] > div[style*="left: 48"][style*="bottom: 48"] {
    left: 20px !important;
    right: 20px !important;
    bottom: 24px !important;
  }
  section[style*="height: 520"] > div[style*="top: 32"][style*="right: 48"] {
    top: 16px !important;
    right: 16px !important;
  }

  /* Header dropdown — em mobile, posicionar full-width abaixo do nav (não absolute centralizado) */
  header [data-dropdown] > div[role="menu"] {
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    min-width: 180px !important;
  }

  /* SiteHome — Hero magazine (110px 1fr 380px → 1fr) */
  section[style*="grid-template-columns: 110px 1fr 380px"],
  section[style*="gridTemplateColumns: '110px 1fr 380px'"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 24px 20px 0 !important;
    min-height: auto !important;
  }
  section[style*="110px 1fr 380px"] > div:first-child {
    border-right: 0 !important;
    padding-right: 0 !important;
    flex-direction: row !important;
    justify-content: space-between !important;
  }
  section[style*="110px 1fr 380px"] h1[style*="font-size: 132"] {
    font-size: clamp(2.75rem, 13vw, 6rem) !important;
    line-height: 0.95 !important;
  }
  /* SiteHome — Service index 6 cols */
  section[style*="repeat(6, 1fr)"],
  section[style*="repeat(6"] > div[style*="repeat(6"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }
  /* SiteHome — Manifesto pull-quote 1fr 1.4fr */
  section[style*="grid-template-columns: 1fr 1.4fr"],
  section[style*="gridTemplateColumns: '1fr 1.4fr'"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 32px 20px !important;
  }
  section[style*="1fr 1.4fr"] > div[style*="height: 360"] {
    height: 240px !important;
  }
  section[style*="1fr 1.4fr"] p[style*="font-size: 38"] {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
  }

  /* SiteServices — service tables (160px 1fr → stack) */
  section[style*="padding: 8px 48px 48px"] > div > div[style*="160px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  section[style*="padding: 8px 48px 48px"] > div > div > div[style*="70px 1fr 120px 110px"] {
    grid-template-columns: 60px 1fr !important;
    grid-template-areas: "code name" "time price" !important;
    row-gap: 4px !important;
  }
  section[style*="padding: 8px 48px 48px"] > div > div > div > span:nth-child(1) { grid-area: code; }
  section[style*="padding: 8px 48px 48px"] > div > div > div > span:nth-child(2) { grid-area: name; }
  section[style*="padding: 8px 48px 48px"] > div > div > div > span:nth-child(3) { grid-area: time; padding-left: 60px; }
  section[style*="padding: 8px 48px 48px"] > div > div > div > span:nth-child(4) { grid-area: price; text-align: right !important; }

  /* SiteTeam — grid 3 cols → 1 */
  section > div[style*="repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  /* Team header (1fr 380px) */
  section[style*="grid-template-columns: 1fr 380px"],
  section[style*="gridTemplateColumns: '1fr 380px'"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 24px 20px !important;
  }
  section h1[style*="font-size: 88"] {
    font-size: clamp(2.5rem, 10vw, 4.5rem) !important;
  }

  /* Padding generoso de 48px → 20px em todas as section/header */
  section[style*="padding: 56px 48px"],
  section[style*="padding: 40px 48px"],
  section[style*="padding: 28px 48px"],
  section[style*="padding: 64px 48px"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* ==========================================================================
   Mobile fechado (480px e abaixo) — refinos extras
   ========================================================================== */

@media (max-width: 480px) {
  /* Hero address tag CONFIRMA escondido */
  section[style*="height: 620"] aside,
  section[style*="height: 620"] > div[style*="backdrop-filter"] { display: none !important; }

  /* Botões CTA pill encolhem */
  button[style*="padding: 10px 22px"] {
    padding: 10px 14px !important;
    font-size: 10px !important;
    letter-spacing: 0.14em !important;
  }
}
