/* Sueldo Claro brand shell: quiet, compact, and theme-aware. */
:root {
  --sc-brand-forest: #061a15;
  --sc-brand-mint: #17dea0;
  --sc-brand-soft: #d8eee5;
  --sc-brand-muted: #a9c2b6;
  --sc-shell-light: #edf4f0;
  --sc-shell-light-line: #dce8e1;
  --sc-shell-light-ink: #18352a;
  --sc-shell-light-muted: #62736b;
  --sc-nav-surface: #e5eee8;
}

html[data-theme="dark"] { --sc-nav-surface: #102a20; }

html:root body { background-image: none !important; }

/* Light mode header */
html:root body .topbar,
html:root body .topbar.sc-scrolled {
  position: sticky !important;
  top: var(--sc-market-height, 28px) !important;
  z-index: 40 !important;
  min-height: 60px !important;
  background: rgba(237, 244, 240, .97) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--sc-shell-light-line) !important;
  box-shadow: 0 3px 12px rgba(17, 49, 35, .035) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
}

html:root body .topbar > .wrap {
  min-height: 60px !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 24px !important;
  width: min(1160px, calc(100% - 48px)) !important;
}

html:root body .topbar { margin-top: 0 !important; }

/* One authoritative surface overrides the older page-specific glass rules. */
html:root body .topbar,
html:root body.sc-polish .topbar,
html:root body.sc-polish .topbar.sc-scrolled,
html:root body .topbar .toplinks.sc-nav-open {
  background: var(--sc-nav-surface) !important;
}

html:root body .topbar .brand {
  display: block !important;
  flex: 0 0 158px !important;
  width: 158px !important;
  height: 32px !important;
  padding: 0 !important;
  background: transparent url("/assets/brand/v2/logo-horizontal-claro.svg") left center / contain no-repeat !important;
  color: transparent !important;
  text-decoration: none !important;
}

html:root body .topbar .brand .brand-mark,
html:root body .topbar .brand .brand-word { display: none !important; }

html:root body .topbar .toplinks {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: clamp(16px, 2vw, 26px) !important;
  margin-left: auto !important;
}

html:root body .topbar .toplinks a {
  min-height: 40px;
  display: inline-flex !important;
  align-items: center !important;
  padding: 0 !important;
  background: transparent !important;
  color: #334a40 !important;
  font-size: 13px !important;
  font-weight: 550 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  text-underline-offset: 4px;
  box-shadow: none !important;
  transform: none !important;
}

html:root body .topbar .toplinks a:hover,
html:root body .topbar .toplinks a[aria-current="page"] { color: #087653 !important; }

html:root body .topbar .theme-toggle,
html:root body .topbar .nav-toggle {
  border-color: #d7e4dd !important;
  background: transparent !important;
  color: #38564a !important;
}

html:root body .topbar .nav-toggle span { background: currentColor !important; }

html:root body .topbar .toplinks.sc-nav-open {
  border-color: var(--sc-shell-light-line) !important;
  border-radius: 0 0 10px 10px !important;
  background: #fff !important;
  box-shadow: 0 12px 24px rgba(14, 43, 30, .09) !important;
}

html:root body .topbar .toplinks.sc-nav-open a { color: #334a40 !important; }
html:root body .topbar .toplinks.sc-nav-open a:hover { background: #f1f7f3 !important; }

/* Minimal light footer */
html:root body .footer {
  padding: 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--sc-shell-light-line) !important;
  background: #f7faf8 !important;
  color: var(--sc-shell-light-ink) !important;
}

html:root body .footer > .wrap {
  min-height: 112px !important;
  display: grid !important;
  grid-template-columns: minmax(180px, 1fr) auto !important;
  align-items: center !important;
  gap: 28px !important;
  padding-block: 22px !important;
}

html:root body .footer .footer-brand-block {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 5px !important;
}

html:root body .footer .footer-logo {
  display: block !important;
  width: 146px !important;
  height: 30px !important;
  background: transparent url("/assets/brand/v2/logo-horizontal-claro.svg") left center / contain no-repeat !important;
  text-decoration: none !important;
}

html:root body .footer .footer-logo .footer-brand-word { display: none !important; }

html:root body .footer .footer-tagline {
  color: var(--sc-shell-light-muted) !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
}

html:root body .footer .footer-links {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px 22px !important;
  margin: 0 !important;
}

html:root body .footer .footer-links a {
  min-height: 36px;
  display: inline-flex !important;
  align-items: center !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #52665d !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transform: none !important;
}

html:root body .footer .footer-links a:hover {
  color: #087653 !important;
  text-decoration: underline !important;
  text-underline-offset: 4px;
}

/* Dark mode keeps the forest palette and uses the light wordmark. */
html[data-theme="dark"]:root body .topbar,
html[data-theme="dark"]:root body .topbar.sc-scrolled {
  background: var(--sc-nav-surface) !important;
  border-bottom-color: rgba(23, 222, 160, .2) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
}

html[data-theme="dark"]:root body .topbar .brand,
html[data-theme="dark"]:root body .footer .footer-logo {
  background-image: url("/assets/brand/v2/logo-horizontal-oscuro.svg") !important;
}

html[data-theme="dark"]:root body .topbar .toplinks a { color: var(--sc-brand-soft) !important; }
html[data-theme="dark"]:root body .topbar .toplinks a:hover,
html[data-theme="dark"]:root body .topbar .toplinks a[aria-current="page"] { color: var(--sc-brand-mint) !important; }

html[data-theme="dark"]:root body .topbar .theme-toggle,
html[data-theme="dark"]:root body .topbar .nav-toggle {
  border-color: rgba(216, 238, 229, .24) !important;
  background: transparent !important;
  color: var(--sc-brand-soft) !important;
}

html[data-theme="dark"]:root body .topbar .toplinks.sc-nav-open {
  border-color: rgba(23, 222, 160, .2) !important;
  background: var(--sc-brand-forest) !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .22) !important;
}

html[data-theme="dark"]:root body .topbar .toplinks.sc-nav-open a { color: var(--sc-brand-soft) !important; }
html[data-theme="dark"]:root body .topbar .toplinks.sc-nav-open a:hover { background: rgba(23, 222, 160, .1) !important; }

html[data-theme="dark"]:root body .footer {
  border-top-color: rgba(23, 222, 160, .2) !important;
  background: var(--sc-brand-forest) !important;
  color: var(--sc-brand-soft) !important;
}

html[data-theme="dark"]:root body .footer .footer-tagline { color: var(--sc-brand-muted) !important; }
html[data-theme="dark"]:root body .footer .footer-links a { color: var(--sc-brand-soft) !important; }
html[data-theme="dark"]:root body .footer .footer-links a:hover { color: var(--sc-brand-mint) !important; }

html:root body .topbar :is(a, button):focus-visible,
html:root body .footer a:focus-visible {
  outline: 2px solid #07845d !important;
  outline-offset: 3px !important;
}

html[data-theme="dark"]:root body .topbar :is(a, button):focus-visible,
html[data-theme="dark"]:root body .footer a:focus-visible { outline-color: var(--sc-brand-mint) !important; }

@media (min-width: 901px) { html:root body .topbar .nav-toggle { display: none !important; } }

@media (max-width: 900px) {
  html:root body .topbar .toplinks:not(.sc-nav-open) { display: none !important; }
  html:root body .topbar > .wrap { width: calc(100% - 32px) !important; }
  html:root body .topbar,
  html:root body .topbar > .wrap { min-height: 56px !important; }

  html:root body .topbar > .wrap {
    flex-flow: row nowrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding-block: 4px !important;
  }

  html:root body .topbar .brand {
    flex-basis: 142px !important;
    width: 142px !important;
    height: 30px !important;
  }

  html:root body .topbar .nav-toggle {
    display: grid !important;
    place-items: center !important;
    order: 1 !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    margin-left: auto !important;
  }

  html:root body .topbar .theme-toggle {
    order: 2 !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  html:root body .topbar .toplinks.sc-nav-open {
    top: calc(100% - 1px) !important;
    left: 0 !important;
    right: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 6px !important;
  }

  html:root body .topbar .toplinks.sc-nav-open a {
    min-height: 44px !important;
    justify-content: flex-start !important;
    padding-inline: 12px !important;
  }

  html:root body .footer > .wrap {
    min-height: 0 !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
    justify-items: start !important;
    gap: 12px !important;
    padding-block: 22px !important;
    text-align: left !important;
  }

  html:root body .footer .footer-links {
    justify-content: flex-start !important;
    gap: 2px 18px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:root body .topbar,
  html:root body .topbar *,
  html:root body .footer,
  html:root body .footer * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
