/* ══════════════════════════════════════════════
   FOLHAS — Header / Navbar
   ══════════════════════════════════════════════ */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--side-padding);
  height: 4rem;
  border-bottom: var(--border-width) solid var(--black);
}

/* ── Logo ─────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
}

.logo svg {
  height: 4.25rem;
  width: auto;
}

.logo a {
  display: flex;
  align-items: center;
}

/* ── Navigation ───────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-2xl);
}

.nav-links a {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  letter-spacing: var(--tracking);
  white-space: nowrap;
}

.nav-links a:is(:hover, :focus-visible) {
  color: var(--green);
}

.nav-links a.active {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── Divider ──────────────────────────────────── */
.nav-divider {
  display: none;
  width: 0;
  height: 2.1875rem;
  border-left: var(--border-width) solid var(--black);
}

/* ── Right section (icons + user) ─────────────── */
.nav-right {
  display: none;
  align-items: center;
  gap: var(--space-md);
}

.nav-icon {
  width: var(--icon-lg);
  height: var(--icon-lg);
  color: var(--green);
  display: block;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
}

.nav-user-name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-base);
  font-weight: 500;
}

.nav-user-name .nav-icon {
  flex-shrink: 0;
}

/* ── Logged-in indicator ──────────────────────── */
.nav-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
}

.nav-user-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  white-space: nowrap;
}

.nav-user-link:is(:hover, :focus-visible) {
  color: var(--green);
}

.nav-user-link .nav-icon {
  flex-shrink: 0;
}

/* ── Search icon button ───────────────────────── */
.nav-search {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: var(--icon-touch);
  min-height: var(--icon-touch);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.nav-search svg {
  width: var(--icon-sm);
  height: var(--icon-sm);
  stroke: var(--green);
  fill: none;
  stroke-width: 2.5;
}

/* ── VER FOLHAS Dropdown ──────────────────────── */
.nav-dropdown-trigger {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--black);
  letter-spacing: var(--tracking);
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-dropdown-trigger:is(:hover, :focus-visible) {
  color: var(--green);
}

.nav-dropdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--side-padding);
  background: var(--white);
  border-bottom: var(--border-width) solid var(--black);
}

.nav-dropdown[hidden] {
  display: none;
}

.nav-dropdown a {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  letter-spacing: var(--tracking);
}

.nav-dropdown a:is(:hover, :focus-visible) {
  color: var(--green);
}

/* ── Search Modal ─────────────────────────────── */
.search-modal {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: var(--z-search-modal);
  background: var(--overlay-light);
  align-items: center;
  justify-content: center;
  padding: 0 var(--side-padding);
}

.search-modal[hidden] {
  display: none;
}

.search-modal-content {
  width: 100%;
  max-width: var(--content-width);
}

.search-modal .search-bar {
  border-bottom: var(--border-width) solid var(--green);
  padding: var(--space-md) 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.search-modal .search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 700;
  color: var(--black);
  background: transparent;
  min-width: 0;
  max-width: 100%;
}

.search-modal .search-bar input::placeholder {
  color: var(--green);
  font-family: var(--font-heading);
}

.search-modal .search-bar-icon {
  width: var(--icon-md);
  height: var(--icon-md);
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.search-modal .search-bar-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--green);
  fill: none;
  stroke-width: 2.5;
}

/* ── Hamburger Button (mobile only) ──────────── */
.nav-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--icon-touch);
  min-height: var(--icon-touch);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-hamburger svg {
  width: var(--icon-md);
  height: var(--icon-md);
  stroke: var(--black);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ── Mobile Nav Overlay ──────────────────────── */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--z-mobile-nav);
  background: var(--green);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--side-padding);
  height: 4rem;
  flex-shrink: 0;
}

.mobile-nav-logo img {
  height: 2.25rem;
  width: auto;
}

.mobile-nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--icon-touch);
  min-height: var(--icon-touch);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mobile-nav-close svg {
  width: var(--icon-md);
  height: var(--icon-md);
  stroke: var(--cream);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.mobile-nav-close:focus-visible {
  outline-color: var(--cream);
}

.mobile-nav-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl) var(--side-padding);
}

.mobile-nav-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-xl) 0;
  border-top: var(--border-width-divider) solid var(--overlay-subtle);
}

.mobile-nav-section:first-child {
  border-top: none;
  padding-top: 0;
}

.mobile-nav-search {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.mobile-nav-search:focus-visible {
  outline-color: var(--cream);
}

.mobile-nav-category {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  line-height: 1.6;
}

.mobile-nav-category:hover,
.mobile-nav-category:focus-visible {
  color: var(--white);
}

.mobile-nav-category:focus-visible {
  outline-color: var(--cream);
}

.mobile-nav-link {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  line-height: 1.8;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  color: var(--white);
}

.mobile-nav-link:focus-visible {
  outline-color: var(--cream);
}

.mobile-nav-greeting {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.mobile-nav-social {
  margin-top: auto;
  padding-top: var(--space-2xl);
}

.mobile-nav-social a {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
}

.mobile-nav-social a:focus-visible {
  outline-color: var(--cream);
}

.mobile-nav-social img {
  width: 100%;
  height: 100%;
  fill: var(--cream);
}

/* ══════════════════════════════════════════════
   Header — Responsive
   ══════════════════════════════════════════════ */

/* ── Tablet+ (≥768px) ────────────────────────── */
@media (min-width: 768px) {
  .header {
    height: 5rem;
  }

  .logo img {
    height: 2.75rem;
  }

  .mobile-nav-header {
    height: 5rem;
  }

  .mobile-nav-logo img {
    height: 2.75rem;
  }

  .search-modal .search-bar input {
    font-size: var(--text-6xl);
    max-width: none;
  }

  .search-modal .search-bar-icon {
    width: var(--icon-xl);
    height: var(--icon-xl);
  }
}

/* ── Desktop+ (≥1200px) ─────────────────────── */
@media (min-width: 1200px) {
  .header {
    height: 10.8125rem;
  }

  .logo img {
    height: auto;
  }

  .nav {
    gap: var(--space-2xl);
  }

  .nav-hamburger {
    display: none;
  }

  .nav-links {
    display: flex;
  }

  .nav-divider {
    display: block;
  }

  .nav-right {
    display: flex;
  }

  .nav-search {
    display: flex;
  }

  .nav-dropdown {
    flex-direction: row;
    gap: var(--space-section);
    padding: var(--space-3xl) var(--side-padding);
  }
}

/* ── Compact desktop (1200–1399px) ───────────── */
@media (min-width: 1200px) and (max-width: 1399px) {
  .header {
    padding: 0 var(--space-2xl);
    height: 8.75rem;
  }

  .logo img {
    height: 3.5rem;
  }

  .nav {
    gap: var(--space-lg);
  }

  .nav-links {
    gap: var(--space-lg);
  }

  .nav-right {
    gap: var(--space-sm);
  }
}
