/* ==========================================================================
   Higienova — site-wide custom CSS
   Only what Tailwind cannot do inline: scroll-reveal, mobile menu,
   header-on-scroll, form states, focus rings, skip link.
   ========================================================================== */

:root {
  --color-primary: #0E5E6F;
  --color-primary-dark: #083D49;
  --color-primary-light: #1A7B8E;
  --color-accent: #7BC950;
  --color-ink: #0B1220;
  --color-muted: #5A6B7B;
  --color-soft: #F4F7F9;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Skip to content — visually hidden until focused */
.skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  z-index: 200;
  font-weight: 600;
  transition: top 0.18s ease-out;
}
.skip-link:focus {
  top: 8px;
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Stronger focus rings for keyboard users */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Header on scroll ---------- */
.site-header {
  transition: background-color 250ms ease-out,
              box-shadow 250ms ease-out,
              border-color 250ms ease-out;
}
.site-header.is-scrolled {
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04),
              0 1px 3px rgba(11, 18, 32, 0.06);
  border-color: rgba(11, 18, 32, 0.06);
}
.site-header.is-scrolled .nav-link {
  color: var(--color-ink);
}
.site-header.is-scrolled .brand-mark {
  color: var(--color-primary);
}

/* Header variant for non-home pages — always solid */
.site-header.is-solid {
  background-color: #ffffff;
  border-bottom: 1px solid rgba(11, 18, 32, 0.06);
}

/* ---------- Mobile menu (off-canvas slide from right) ---------- */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.mobile-menu.is-open {
  transform: translateX(0);
}
.mobile-menu-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease-out;
}
.mobile-menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
body.menu-open {
  overflow: hidden;
}

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal][data-reveal-delay="1"] { transition-delay: 60ms; }
[data-reveal][data-reveal-delay="2"] { transition-delay: 120ms; }
[data-reveal][data-reveal-delay="3"] { transition-delay: 180ms; }
[data-reveal][data-reveal-delay="4"] { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal],
  .site-header,
  .mobile-menu {
    transition: none !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Form ---------- */
.form-field input,
.form-field select,
.form-field textarea {
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(14, 94, 111, 0.14);
}
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: #dc2626;
  background-color: #fff5f5;
}
.form-field .error-msg {
  display: none;
  color: #dc2626;
  font-size: 0.8125rem;
  margin-top: 6px;
}
.form-field.has-error .error-msg {
  display: block;
}

/* ---------- Misc utilities ---------- */
.text-balance { text-wrap: balance; }
.text-pretty  { text-wrap: pretty; }

/* Sector card image hover zoom */
.sector-card img {
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.sector-card:hover img {
  transform: scale(1.05);
}

/* Subtle accent underline animation on inline links */
.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 220ms ease-out;
  text-decoration: none;
}
.link-underline:hover,
.link-underline:focus {
  background-size: 100% 1.5px;
}

/* Step circles connector line (servicos.html) */
.step-circle {
  position: relative;
  z-index: 1;
}
.step-row::before {
  content: "";
  position: absolute;
  top: 32px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: rgba(14, 94, 111, 0.18);
  z-index: 0;
}
@media (max-width: 767px) {
  .step-row::before { display: none; }
}

/* Print: hide non-essential chrome */
@media print {
  .site-header, .mobile-menu, .mobile-menu-backdrop, footer { display: none; }
}

/* ---------- Products mega-dropdown ---------- */
.products-dropdown {
  position: relative;
}
.products-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 180ms ease-out;
  z-index: 60;
  width: min(960px, calc(100vw - 48px));
}
.products-panel.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.products-trigger[aria-expanded="true"] .products-chev {
  transform: rotate(180deg);
}
.products-chev {
  transition: transform 180ms ease-out;
}

/* Mobile products <details> chev */
details[data-mobile-products] > summary {
  list-style: none;
}
details[data-mobile-products] > summary::-webkit-details-marker {
  display: none;
}
details[data-mobile-products][open] > summary svg.mobile-products-chev {
  transform: rotate(180deg);
}
.mobile-products-chev {
  transition: transform 180ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .products-panel,
  .products-chev,
  .mobile-products-chev {
    transition: none !important;
  }
}

/* ---------- Active nav indicator (aria-current="page") ---------- */
header nav a[aria-current="page"] {
  position: relative;
}
header nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  pointer-events: none;
}
/* On homepage (transparent header), keep the active link readable */
.site-header.is-scrolled nav a[aria-current="page"],
.site-header.is-solid nav a[aria-current="page"] {
  color: var(--color-primary) !important;
}
/* Hover/focus should still feel responsive on the active link */
header nav a[aria-current="page"]:hover,
header nav a[aria-current="page"]:focus-visible {
  color: var(--color-primary-dark);
}

/* ==========================================================================
   Cookie consent banner + preferences modal
   ========================================================================== */
#cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: #ffffff;
  border-top: 1px solid rgba(11, 18, 32, 0.08);
  box-shadow: 0 -8px 24px rgba(11, 18, 32, 0.10);
  transform: translateY(12px);
  opacity: 0;
  transition: transform 200ms ease-out, opacity 200ms ease-out;
}
#cookie-banner.is-open {
  transform: translateY(0);
  opacity: 1;
}
#cookie-banner[hidden] { display: none; }

#cookie-banner .cb-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 768px) {
  #cookie-banner .cb-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 48px;
  }
}
#cookie-banner .cb-text { flex: 1; min-width: 0; }
#cookie-banner .cb-text h3 {
  margin: 0 0 4px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-ink);
}
#cookie-banner .cb-text p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
}
#cookie-banner .cb-text a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
#cookie-banner .cb-text a:hover { color: var(--color-primary-dark); }
#cookie-banner .cb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
@media (max-width: 767px) {
  #cookie-banner .cb-actions .cb-btn { flex: 1 1 auto; min-height: 44px; }
}

.cb-btn {
  appearance: none;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.cb-btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}
.cb-btn-primary:hover { background: var(--color-primary-dark); }
.cb-btn-ghost {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid rgba(11, 18, 32, 0.18);
}
.cb-btn-ghost:hover { border-color: rgba(11, 18, 32, 0.4); }

/* Preferences modal */
#cookie-prefs {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 200ms ease-out;
}
#cookie-prefs.is-open { opacity: 1; }
#cookie-prefs[hidden] { display: none; }
#cookie-prefs .cp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.6);
}
#cookie-prefs .cp-panel {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.30);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
#cookie-prefs .cp-panel h3 {
  margin: 0 0 8px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--color-ink);
}
#cookie-prefs .cp-panel p {
  margin: 0 0 20px;
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.55;
}
#cookie-prefs .cp-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  padding: 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#cookie-prefs .cp-close:hover { color: var(--color-ink); background: rgba(11, 18, 32, 0.04); }
#cookie-prefs .cp-close svg { width: 20px; height: 20px; }

#cookie-prefs .cp-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
  border-top: 1px solid rgba(11, 18, 32, 0.08);
}
#cookie-prefs .cp-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(11, 18, 32, 0.08);
  cursor: pointer;
}
#cookie-prefs .cp-row > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#cookie-prefs .cp-row strong {
  font-size: 0.9375rem;
  color: var(--color-ink);
  font-weight: 600;
}
#cookie-prefs .cp-desc {
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-weight: 400;
  line-height: 1.4;
}
#cookie-prefs .cp-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
#cookie-prefs .cp-row input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
#cookie-prefs .cp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
@media (max-width: 480px) {
  #cookie-prefs .cp-actions .cb-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  #cookie-banner,
  #cookie-prefs {
    transition: none !important;
  }
  #cookie-banner { transform: none; }
}


/* ─── Brand cards (marcas.html) ─────────────────────────────────────── */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .brand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .brand-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.brand-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 1px 3px rgba(11, 18, 32, 0.06);
  overflow: hidden;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
  display: flex;
  flex-direction: column;
}
.brand-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(11, 18, 32, 0.10);
}

.brand-mark-zone {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  position: relative;
  overflow: hidden;
}
.brand-mark-zone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0) 60%);
  pointer-events: none;
}
@media (min-width: 768px) {
  .brand-mark-zone { height: 112px; }
}

.brand-wordmark {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}
@media (min-width: 768px) {
  .brand-wordmark { font-size: 1.5rem; }
}

.brand-body {
  padding: 1.25rem 1.25rem 1.5rem;
}

.brand-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #5A6B7B;
  margin-bottom: 0.75rem;
}

.brand-bullets {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #0B1220;
}

.brand-bullet {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  margin-top: 0.5rem;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .brand-card { transition: none; }
  .brand-card:hover { transform: none; }
}


/* ─── Brand pills (category-page brand strips) ──────────────────────── */
.brand-strip {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}
.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  transition: border-color 200ms ease-out, transform 200ms ease-out, box-shadow 200ms ease-out;
}
.brand-pill:hover {
  border-color: rgba(11, 18, 32, 0.20);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 18, 32, 0.06);
}
.brand-pill-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.brand-pill-text {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  color: #0B1220;
}

@media (prefers-reduced-motion: reduce) {
  .brand-pill { transition: none; }
  .brand-pill:hover { transform: none; }
}


/* ─── Real brand logo wall (marcas.html) ────────────────────────────── */
.brand-logo-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 640px) {
  .brand-logo-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .brand-logo-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .brand-logo-wall { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.brand-logo-tile {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(11,18,32,0.04), 0 1px 3px rgba(11,18,32,0.06);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}
.brand-logo-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(11,18,32,0.08);
}
.brand-logo-tile img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(0.2);
  transition: filter 200ms ease-out;
}
.brand-logo-tile:hover img {
  filter: grayscale(0);
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo-tile, .brand-logo-tile img { transition: none; }
  .brand-logo-tile:hover { transform: none; }
}
