/* =====================================================================
   Operebem institucional · casca
   Cabeçalho, menu de produtos, rodapé, barra do celular, folhas e diálogos.
   ===================================================================== */

/* ---------- Cabeçalho ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  view-transition-name: site-header;
}
.header.is-stuck { border-color: var(--border); background: var(--veil); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }
.header__inner { display: flex; align-items: center; gap: 12px; height: 100%; }
.header__theme { order: 3; }
.header__actions { order: 4; display: flex; align-items: center; gap: 8px; }
.icon--moon { display: none; }
[data-theme="light"] .icon--moon { display: block; }
[data-theme="light"] .icon--sun { display: none; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); }
.brand__mark { height: 26px; }
.brand__name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }

.nav { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav__link { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; transition: color 0.15s ease, background-color 0.15s ease; }
.nav__link:hover, .nav__link[aria-expanded="true"] { color: var(--text); }
.nav__link[aria-current="page"] { background: var(--surface-3); color: var(--text); }
.nav__link .status-dot { margin-right: 5px; box-shadow: none; }
.nav__link .icon { transition: transform 0.2s var(--ease); }
.nav__link[aria-expanded="true"] .icon { transform: rotate(180deg); }
.language-switcher__button { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.language-switcher__button:hover { background: var(--surface-3); color: var(--text); }

.nav__group { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 10px);
  left: -12px;
  width: 560px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s var(--ease), visibility 0s 0.18s;
}
.menu.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
/* Ponte para o ponteiro não fechar o menu no vão entre o botão e o painel. */
.menu::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }
.menu__products { padding: 10px; }
.menu__product { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; }
.menu__product:hover { background: var(--surface-3); }
.menu__product img { width: 40px; height: 40px; }
.menu__product strong { display: block; color: var(--text); font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.menu__product small { color: var(--text-2); font-size: 13px; line-height: 1.4; }
.menu__more { padding: 10px; border-left: 1px solid var(--border); background: var(--surface-2); }
.menu__more a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.menu__more a:hover { background: var(--surface-3); color: var(--text); }
.menu__more .icon { font-size: 17px; }

/* ---------- Rodapé ---------- */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--border); background: var(--bg); font-size: 14px; }
.footer__inner { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; padding-block: 56px 40px; }
.footer__section { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.footer__section--brand { gap: 16px; }
.footer__section--brand p { max-width: 24ch; color: var(--text-2); }
.footer__title { margin-bottom: 8px; color: var(--text-3); font-family: var(--font-text); font-size: 13px; font-weight: 600; }
.footer nav a { display: inline-flex; align-items: center; min-height: 32px; color: var(--text-2); transition: color 0.15s ease; }
.footer nav a:hover { color: var(--text); }
.footer__social { display: flex; gap: 4px; margin-left: -10px; }
.footer__social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--text-2); font-size: 18px; }
.footer__social a:hover { background: var(--surface-3); color: var(--text); }
.footer__bottom { display: flex; justify-content: space-between; gap: 32px; padding-block: 20px 28px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }
.footer__bottom p:first-child { max-width: 76ch; }
.footer__bottom p:last-child { flex: none; }

/* ---------- WhatsApp flutuante (computador) ---------- */
.support-whatsapp-float { position: fixed; right: 24px; bottom: 24px; z-index: 30; display: flex; align-items: center; height: 56px; border-radius: 28px; background: linear-gradient(180deg, #2fe274, #1fbd5a); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 14px 34px -12px rgba(31, 189, 90, 0.7); transition: transform 0.2s var(--ease), box-shadow 0.2s ease; }
.support-whatsapp-float .icon { width: 30px; height: 30px; margin: 13px; filter: drop-shadow(0 1px 1px rgba(0, 60, 24, 0.25)); }
/* O nome aparece quando alguém chega perto; parado, é só o símbolo. */
.support-whatsapp-float__label { display: grid; max-width: 0; overflow: hidden; color: #04210f; font-size: 15px; font-weight: 600; white-space: nowrap; opacity: 0; transition: max-width 0.3s var(--ease), opacity 0.2s ease, padding 0.3s var(--ease); }
.support-whatsapp-float:is(:hover, :focus-visible) { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 18px 40px -12px rgba(31, 189, 90, 0.85); }
.support-whatsapp-float:is(:hover, :focus-visible) .support-whatsapp-float__label { max-width: 140px; padding-left: 20px; opacity: 1; }
.support-whatsapp-float:focus-visible { outline-offset: 4px; border-radius: 28px; }

/* ---------- Barra de abas (celular) ---------- */
.tabbar { display: none; }

/* ---------- Folhas e diálogos ---------- */
dialog { color: inherit; }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
body.has-dialog { overflow: hidden; }

.sheet { display: none; }
.sheet[open] { display: grid; align-content: start; gap: 16px; }
.sheet, .modal { border: 1px solid var(--border-strong); background: var(--surface); }
.sheet__grip { width: 36px; height: 4px; margin: 0 auto -8px; border-radius: 2px; background: var(--border-strong); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; }
.sheet__head h2 { font-size: 20px; font-weight: 600; }
.sheet__products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet__products a { display: grid; justify-items: center; gap: 2px; padding: 12px 4px; border-radius: 14px; text-align: center; }
.sheet__products a:active { background: var(--surface-3); }
.sheet__products img { width: 56px; height: 56px; margin-bottom: 6px; }
.sheet__products strong { color: var(--text); font-size: 15px; font-weight: 600; }
.sheet__products small { color: var(--text-2); font-size: 13px; }
.sheet .status-pill { width: 100%; min-height: 52px; }
.sheet__list li + li { border-top: 1px solid var(--border); }
.sheet__list a { display: flex; align-items: center; gap: 14px; min-height: 52px; color: var(--text); font-size: 15.5px; font-weight: 500; }
.sheet__list .icon { color: var(--text-2); font-size: 20px; }
.sheet__list a > :nth-child(2) { margin-right: auto; }
.sheet__list a > .icon:last-child:not(:first-child) { font-size: 16px; color: var(--text-3); }
.sheet__list small { color: var(--text-2); font-size: 13.5px; }

.modal { position: fixed; inset: 0; width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 28px; border-radius: 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal[open] { animation: rise 0.28s var(--ease); }
.modal .sheet__grip { display: none; }

@media (max-width: 899px) {
  .header__inner { display: grid; grid-template-columns: 1fr auto 1fr; }
  .header__theme { order: 0; justify-self: start; margin-left: -10px; }
  .header__actions { justify-self: end; margin-right: -12px; }
  .header__register, .nav { display: none; }
  .header__login { border-color: transparent; color: var(--text); font-size: 15px; }
  .brand__mark { height: 22px; }

  .support-whatsapp-float { display: none !important; }

  .footer__inner { grid-template-columns: auto auto; justify-content: space-evenly; gap: 28px 32px; padding-block: 44px 32px; }
  .footer__section:nth-child(3) { grid-row: span 2; }
  .footer__section--products { display: none; } /* já estão na folha Produtos da barra */
  .footer__section--brand { grid-column: 1 / -1; align-items: center; gap: 0; padding-bottom: 28px; border-bottom: 1px solid var(--border); text-align: center; }
  .footer__section--brand .status-pill { margin-block: 20px 16px; }
  .footer__section--brand p { max-width: none; }
  .footer__social { gap: 12px; margin-left: 0; }
  .footer__social a { width: 44px; height: 44px; font-size: 20px; }
  .footer nav a { min-height: 40px; }
  .footer__bottom { flex-direction: column; gap: 12px; text-align: center; padding-block: 20px; }
  .footer__bottom p:first-child { margin-inline: auto; }
  .footer__bottom p:last-child { flex: initial; }

  .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: var(--tabbar-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--border);
    background: var(--veil);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    view-transition-name: site-tabbar;
  }
  .tabbar__item { display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--text-2); font-size: 11.5px; font-weight: 500; line-height: 1; }
  .tabbar__item .icon { font-size: 21px; }
  .tabbar__item[aria-current="page"] { color: var(--brand); }
  .tabbar__item:focus-visible { outline-offset: -4px; }

  .sheet, .modal {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: min(86dvh, 720px);
    margin: 0;
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sheet[open], .modal[open] { animation: sheet-in 0.3s var(--ease); }
  .modal .sheet__grip { display: block; margin-bottom: 8px; }
}
