/*
 * Layout v2 — header e footer das páginas PHP alinhados visualmente
 * com a versão Next.js (home v2).
 *
 * Origem: next/components/frontend/layout/{header,footer}/styles.scss
 *         + components/frontend/components/{profile-dropdown,cart-count-btn,
 *           header-mega-dropdown}/styles.scss
 * Mantenha sincronizado quando o Next mudar.
 */

/* SF Pro Display — fonte local do Next, replicada aqui pras páginas PHP. */
@font-face {
  font-family: 'SF Pro Display';
  src: url('/fonts/SFPRODISPLAYREGULAR.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('/fonts/SFPRODISPLAYMEDIUM.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  /* 600 não existe normal nos OTFs; usamos o Bold (700) como fonte. */
  font-family: 'SF Pro Display';
  src: url('/fonts/SFPRODISPLAYBOLD.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('/fonts/SFPRODISPLAYBOLD.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.layout-v2-body {
  --font-sf-pro: 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===========================================================================
 * Header v2 — shell visual (logo + altura + blur + nav + lado direito).
 * Mega dropdown CSS-only: hover/focus-within abre painel com cards.
 * =========================================================================== */

.header-v2 {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(217, 217, 234, 0.5);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-family: 'SF Pro Display', system-ui, -apple-system, sans-serif;
}

.header-v2__inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  overflow: visible;
}

@media (min-width: 992px) {
  .header-v2__inner {
    height: 83px;
    padding: 0 32px;
  }
}

.header-v2__logo {
  display: inline-flex;
  align-items: center;
  width: 128px;
}

.header-v2__logo img {
  display: block;
  width: auto;
  height: 32px;
}

@media (min-width: 992px) {
  .header-v2__logo {
    width: 158px;
  }
  .header-v2__logo img {
    height: 41px;
  }
}

.header-v2__right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1 1 0%;
  min-height: 0;
  justify-content: flex-end;
  overflow: visible;
}

@media (min-width: 992px) {
  .header-v2__right {
    justify-content: space-evenly;
    gap: 8px;
  }
}

.header-v2__nav {
  display: none;
}

@media (min-width: 992px) {
  .header-v2__nav {
    display: flex;
    align-items: center;
    gap: 4px;
  }
}

/* Trigger e dropdown dos 4 grupos institucionais. Mesmo styling do Next
 * (.header-mega__trigger) pro botão; painel abre no hover via CSS puro,
 * sem JS. Versão simplificada — lista de links com descrição, em vez dos
 * cards com imagem/gradient que o Next mostra. */
.header-v2__nav-group {
  position: relative;
  display: inline-block;
}

.header-v2__nav-trigger,
.header-v2__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 10px;
  color: #000;
  font-family: 'SF Pro Display', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 160ms ease;
}

@media (min-width: 1200px) {
  .header-v2__nav-trigger,
  .header-v2__nav-link {
    font-size: 16px;
  }
}

.header-v2__nav-trigger:hover,
.header-v2__nav-trigger:focus-visible,
.header-v2__nav-group:hover .header-v2__nav-trigger,
.header-v2__nav-link:hover,
.header-v2__nav-link.is-open {
  background: rgba(255, 255, 255, 0.55);
  color: #000;
  text-decoration: none;
  outline: none;
}

.header-v2__nav-trigger i.fa-chevron-down,
.header-v2__nav-link i.fa-chevron-down {
  font-size: 10px;
  margin-left: 2px;
  opacity: 0.75;
  transition: transform 200ms ease;
}

.header-v2__nav-group:hover .header-v2__nav-trigger i.fa-chevron-down {
  transform: rotate(180deg);
}

/* Painel do dropdown — abre no hover do grupo. */
.header-v2__nav-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-radius: 16px;
  padding: 10px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.12),
    0 8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 220ms;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Ponte invisível entre trigger e painel — atravessar com mouse não fecha. */
.header-v2__nav-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.header-v2__nav-group:hover .header-v2__nav-menu,
.header-v2__nav-group:focus-within .header-v2__nav-menu {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition: opacity 220ms ease, transform 220ms ease, visibility 0s;
}

.header-v2__nav-menu-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #181818;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.header-v2__nav-menu-item:hover,
.header-v2__nav-menu-item:focus-visible {
  background: rgba(0, 0, 0, 0.04);
  color: #181818;
  text-decoration: none;
  outline: none;
}

.header-v2__nav-menu-item-label {
  font-family: 'SF Pro Display', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.header-v2__nav-menu-item-desc {
  font-family: 'SF Pro Display', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.35;
}

/* Variante standalone — usado pra "Foco Challenge" e outros links sem painel. */
.header-v2__nav-trigger--standalone {
  text-decoration: none;
}
.header-v2__nav-trigger--standalone i.fa-chevron-down {
  display: none;
}

.header-v2__right-actions {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Cart pill (40x40 #f5f5f5, badge amarelo). Espelha .cart-btn do Next. */
.header-v2__cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 24px;
  background: #f5f5f5;
  color: #000;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  box-shadow:
    0 6.9px 6.9px -2.7px rgba(0, 0, 0, 0.07),
    0 3.6px 3.6px -2px rgba(0, 0, 0, 0.07),
    0 1.8px 1.8px -1.3px rgba(0, 0, 0, 0.08),
    inset 0 1px 1px 0 rgba(255, 255, 255, 1);
  transition: background-color 200ms ease, color 200ms ease;
}

.header-v2__cart-btn:hover {
  background: #000;
  color: #fff;
  text-decoration: none;
}

.header-v2__cart-btn i {
  font-size: 16px;
}

.header-v2__cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #feee01;
  color: #000;
  font-family: 'SF Pro Display', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* Pill "Entrar" (deslogado) — espelha .pd-login do Next. */
.header-v2__login-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 16px;
  border-radius: 16px;
  background: #f5f5f5;
  color: #000;
  font-family: 'SF Pro Display', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  box-shadow:
    0 6.9px 6.9px -2.7px rgba(0, 0, 0, 0.07),
    0 3.6px 3.6px -2px rgba(0, 0, 0, 0.07),
    inset 0 1px 1px 0 rgba(255, 255, 255, 1);
  transition: background-color 200ms ease, color 200ms ease;
}

.header-v2__login-btn:hover {
  background: #000;
  color: #fff;
  text-decoration: none;
}

.header-v2__login-btn i {
  font-size: 14px;
}

/* Pill "Olá, Nome" (logado) — espelha .pd-user__pill + avatar do Next. */
.header-v2__user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 4px 12px 4px 4px;
  border-radius: 24px;
  background: #f5f5f5;
  color: #000;
  cursor: pointer;
  text-decoration: none;
  border: 0;
  box-shadow:
    0 6.9px 6.9px -2.7px rgba(0, 0, 0, 0.07),
    0 3.6px 3.6px -2px rgba(0, 0, 0, 0.07),
    inset 0 1px 1px 0 rgba(255, 255, 255, 1);
  transition: background-color 200ms ease, color 200ms ease;
}

.header-v2__user-pill:hover,
.header-v2__user-wrap.is-open .header-v2__user-pill {
  background: #000;
  color: #fff;
  text-decoration: none;
}

.header-v2__user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'SF Pro Display', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow:
    0 1.6px 1.6px -1.2px rgba(0, 0, 0, 0.10),
    inset 0 0.9px 0.9px 0 rgba(255, 255, 255, 1);
}

.header-v2__user-greeting {
  font-family: 'SF Pro Display', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-v2__user-chevron {
  font-size: 10px;
  line-height: 1;
  margin-left: 2px;
  transition: transform 200ms ease;
}

.header-v2__user-wrap {
  position: relative;
  display: inline-block;
}

.header-v2__user-wrap.is-open .header-v2__user-chevron {
  transform: rotate(180deg);
}

/* Dropdown preto do user. Espelha .pd-menu do Next. */
.header-v2__user-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  min-width: 162px;
  background: #000;
  color: #fff;
  border-radius: 24px;
  padding: 12px 0;
  box-shadow: 0 18px 18px -2px rgba(0, 0, 0, 0.18);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 220ms;
  visibility: hidden;
}

.header-v2__user-menu::before {
  /* Ponte invisível pra travessia do mouse entre o pill e o menu. */
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.header-v2__user-wrap:hover .header-v2__user-menu,
.header-v2__user-wrap.is-open .header-v2__user-menu {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition: opacity 220ms ease, transform 220ms ease, visibility 0s;
}

.header-v2__user-menu-item {
  display: block;
  margin: 0 8px;
  padding: 8px 12px;
  border-radius: 12px;
  color: #fff;
  font-family: 'SF Pro Display', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease;
}

.header-v2__user-menu-item:hover {
  background: #454545;
  color: #fff;
  text-decoration: none;
}

.header-v2__user-menu-divider {
  height: 1px;
  margin: 6px 16px;
  background: rgba(255, 255, 255, 0.12);
}

.header-v2__lang {
  display: none;
}

@media (min-width: 992px) {
  .header-v2__lang {
    display: inline-flex;
    gap: 6px;
    align-items: center;
  }
}

.header-v2__lang a {
  display: inline-flex;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0.8;
  transition: opacity 150ms ease;
}

.header-v2__lang a:hover {
  opacity: 1;
}

.header-v2__lang img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-v2__hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  color: #181818;
  border: none;
  cursor: pointer;
}

@media (min-width: 992px) {
  .header-v2__hamburger {
    display: none;
  }
}

.header-v2__hamburger i {
  font-size: 18px;
}

/* Push pra compensar header fixed (legacy main.php tinha o header não-fixed; o v2 é fixed). */
.layout-v2-body {
  padding-top: 70px;
}

@media (min-width: 992px) {
  .layout-v2-body {
    padding-top: 83px;
  }
}

/* Desabilita o footer do legacy quando estamos em layout v2 */
.layout-v2-body .footer-wrapper.bg-foco-dark-100,
.layout-v2-body .footer-wrapper-social {
  display: none;
}

/* ===========================================================================
 * Footer v2 — replicação completa
 * =========================================================================== */

.footer-v2 {
  font-family: var(--font-sf-pro, 'SF Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  width: 100%;
  overflow: hidden;
}

.footer-v2__upper {
  position: relative;
  background: rgba(250, 250, 252, 0.7);
  -webkit-backdrop-filter: blur(60px);
  backdrop-filter: blur(60px);
  border-radius: 30px 30px 0 0;
  padding: 55px 24px 40px;
  color: #000;
}

@media (min-width: 992px) {
  .footer-v2__upper {
    padding: 55px 60px 96px 60px;
  }
}

.footer-v2__upper-inner {
  max-width: calc(1170px + 32px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
}

.footer-v2__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 36px;
  flex: 1 1 auto;
}

@media (min-width: 768px) {
  .footer-v2__columns {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 36px;
  }
}

.footer-v2__column {
  min-width: 0;
}

.footer-v2__col-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 20px;
  color: #000;
  margin: 0 0 18px;
}

.footer-v2__col-accent {
  display: inline-block;
  width: 2px;
  height: 20px;
  background: linear-gradient(180deg, #FEEE01 0%, #FBBF24 100%);
  border-radius: 2px;
}

.footer-v2__col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-v2__col-list a {
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  color: rgba(0, 0, 0, 0.7);
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-v2__col-list a:hover {
  color: rgba(0, 0, 0, 1);
  text-decoration: none;
}

.footer-v2__contact {
  flex: 0 0 auto;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-v2__phone {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.footer-v2__phone i {
  color: #0a0a0a;
}

.footer-v2__hours-label {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  margin: 8px 0 0;
  line-height: 20px;
}

.footer-v2__hours {
  font-size: 13px;
  font-weight: 400;
  color: #000;
  margin: 0;
  line-height: 18px;
}

.footer-v2__policies {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.footer-v2__policies a {
  font-size: 16px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.7);
  text-decoration: none;
}

.footer-v2__policies a:hover {
  color: #000;
  text-decoration: none;
}

.footer-v2__lower {
  background: linear-gradient(180deg, #2A2A2A 0%, #1F1F1F 100%);
  color: #fff;
  padding: 24px 24px 32px;
}

@media (min-width: 992px) {
  .footer-v2__lower {
    padding: 45px 80px 32px;
  }
}

.footer-v2__lower-inner {
  max-width: calc(1170px + 32px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.footer-v2__logo img {
  display: block;
  filter: brightness(0) invert(1);
  height: 46px;
  width: auto;
}

.footer-v2__social-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

@media (min-width: 992px) {
  .footer-v2__social-wrap {
    align-items: flex-end;
  }
}

.footer-v2__social-title {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  margin: 0;
}

.footer-v2__social-title span {
  font-weight: 600;
}

.footer-v2__social-icons {
  display: flex;
  gap: 10px;
}

.footer-v2__social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.footer-v2__social-btn:hover {
  background: linear-gradient(135deg, #FBBF24, #FEEE01);
  color: #000;
  text-decoration: none;
}

.footer-v2__copyright {
  max-width: calc(1170px + 32px);
  margin: 32px auto 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 18px;
}

.footer-v2__copyright span {
  color: rgba(255, 255, 255, 0.8);
}
