/* ==========================================================================
   Grupo Novopor — estilos del sitio (sobre Bootstrap 5.3.8)
   Basado en el Manual de Identidad Visual de Grupo Novopor:
   - Colores: azules del grupo #0071BC / #005CB9, Cool Gray 5 C #BCBEC0,
     submarcas cian #00B3E3 (Construcción) y verde #3FAE2A (Packaging).
   - Tipografía: Avenir Next LT Pro (Light / Medium / Bold). Si no está
     instalada o licenciada para web, se usa Figtree como equivalente.
   - Recurso gráfico: fragmentos del isotipo "N" en tintes de azul.
   - Logos en su versión positiva, sin deformar y con área de protección.
   ========================================================================== */

:root {
  /* Manual: grupo */
  --nv-blue: #005CB9;        /* Pantone 300 C */
  --nv-blue-2: #0071BC;      /* Pantone 3005 C */
  --nv-gray: #BCBEC0;        /* Cool Gray 5 C */
  /* Manual: submarcas */
  --nv-cyan: #00B3E3;        /* Pantone 306 C */
  --nv-green: #3FAE2A;       /* Pantone 361 C */
  /* Escala de grises del manual (K80 / K50) y tintes */
  --nv-text: #58595B;        /* K80 */
  --nv-text-2: #939598;      /* K50 */
  --nv-dark: #231F20;
  --nv-rule: #dfe0e1;
  --nv-paper: #f2f3f3;       /* tinte de Cool Gray 5 C */
  --nv-tint-blue-1: #B9D7F0; /* tintes del isotipo (tapa del manual) */
  --nv-tint-blue-2: #8AADD6;
  --nv-tint-c: #e6f7fc;      /* tinte 10 % de #00B3E3 */
  --nv-tint-p: #ecf7ea;      /* tinte 10 % de #3FAE2A */

  --nv-header-h: 100px;
  --nv-chevron: clamp(36px, 4vw, 64px);

  --nv-font: "Avenir Next LT Pro", "Avenir Next", "Avenir", "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-family: var(--nv-font);
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.6;
  --bs-body-color: var(--nv-text);
  --bs-secondary-color: var(--nv-text-2);
  --bs-border-color: var(--nv-rule);
  --bs-link-color-rgb: 0, 92, 185;
  --bs-link-hover-color-rgb: 0, 113, 188;
  --bs-focus-ring-color: rgba(0, 113, 188, .4);
}

html { scroll-padding-top: calc(var(--nv-header-h) + 12px); }
body { background: #fff; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--nv-blue); }
::selection { background: var(--nv-blue-2); color: #fff; }
img { max-width: 100%; height: auto; }
.icon { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--nv-blue-2); outline-offset: 3px; box-shadow: none; }

.skip-link { position: absolute; left: 16px; top: 12px; z-index: 2000; background: var(--nv-blue); color: #fff; padding: .6rem 1rem; border-radius: 4px; }

/* ---------- Header ----------
   Área de protección: X ≈ 1/3 de la altura del logo → 60 px de logo, 20 px libres arriba y abajo */
.site-header { background: #fff; border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.is-scrolled { border-color: var(--nv-rule); }
.site-header .navbar { min-height: var(--nv-header-h); padding-block: 20px; }
.navbar-brand { padding: 0; margin-right: 2rem; }
.brand-logo { height: 60px; width: auto; display: block; }
.site-header .nav-link { font-weight: 500; font-size: 1rem; color: var(--nv-text); padding-inline: .9rem !important; }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--nv-blue); }
.site-header .nav-link.active { text-decoration: underline; text-decoration-color: var(--nv-blue-2); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.navbar-toggler { border: 0; padding: .5rem; }
.navbar-toggler:focus { box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }

.btn { font-weight: 700; border-radius: 4px; display: inline-flex; align-items: center; gap: .55rem; }
.btn-brand {
  --bs-btn-color: #fff; --bs-btn-bg: var(--nv-blue); --bs-btn-border-color: var(--nv-blue);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--nv-blue-2); --bs-btn-hover-border-color: var(--nv-blue-2);
  --bs-btn-active-bg: var(--nv-blue-2); --bs-btn-active-border-color: var(--nv-blue-2);
  --bs-btn-padding-x: 1.25rem; --bs-btn-padding-y: .6rem;
}
.btn-whatsapp {
  --bs-btn-color: #fff; --bs-btn-bg: #1faa53; --bs-btn-border-color: #1faa53;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #178a43; --bs-btn-hover-border-color: #178a43;
  --bs-btn-active-bg: #178a43; --bs-btn-active-border-color: #178a43;
  --bs-btn-padding-x: 1.4rem; --bs-btn-padding-y: .8rem; --bs-btn-font-size: 1.0625rem;
}

/* ---------- Títulos de sección: pestaña bicolor del manual ---------- */
.block-title { position: relative; font-weight: 300; font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); line-height: 1.08; letter-spacing: -.01em; margin-bottom: 1.25rem; padding-top: 1.5rem; }
.block-title::before {
  content: ""; position: absolute; left: 0; top: 0; width: 28px; height: 8px;
  background: linear-gradient(90deg, var(--nv-blue) 0 50%, var(--nv-blue-2) 50% 100%);
}

/* ---------- Portada ---------- */
.intro { position: relative; overflow: hidden; padding-top: clamp(2rem, 1.5rem + 2.5vw, 4rem); padding-bottom: clamp(2rem, 1.5rem + 2.5vw, 4rem); }
.intro-shape {
  /* fragmento del isotipo en tintes, como en la tapa del manual */
  position: absolute; top: 50%; right: -4%; width: min(36vw, 480px); aspect-ratio: 1; transform: translateY(-50%);
  background: url("../img/logos/isotipo-tint.svg") center / contain no-repeat;
  pointer-events: none;
}
.intro-title {
  font-weight: 300; color: var(--nv-blue); margin: 0;
  font-size: clamp(2.75rem, 1.6rem + 4.6vw, 5.5rem); line-height: .98; letter-spacing: -.025em;
}
.intro-lead { font-size: clamp(1.125rem, 1rem + .4vw, 1.375rem); line-height: 1.5; color: var(--nv-text); max-width: 30em; margin: 0; }

/* ---------- Divisiones: paneles con chevrón ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; position: relative; isolation: isolate; }
.panel { position: relative; display: flex; overflow: hidden; }
.panel-construccion { background: var(--nv-tint-c); z-index: 2; overflow: visible; }
.panel-packaging { background: var(--nv-tint-p); }
/* el chevrón de las submarcas: Construcción "apunta" a Packaging */
.panel-construccion::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: calc(var(--nv-chevron) * -1); width: var(--nv-chevron);
  background: var(--nv-tint-c); clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--nv-cyan); z-index: 3; }
.panel-packaging::before { background: var(--nv-green); }

.panel-inner {
  position: relative; z-index: 1; width: 100%; max-width: 680px; display: flex; flex-direction: column;
  padding: clamp(2rem, 1.5rem + 2vw, 3.5rem) clamp(1.5rem, 1rem + 3vw, 4.5rem);
}
.panel-construccion .panel-inner { margin-left: auto; padding-right: clamp(2.5rem, 2rem + 3vw, 5rem); }
.panel-packaging .panel-inner { padding-left: calc(var(--nv-chevron) + clamp(1.5rem, 1rem + 2.5vw, 4rem)); }
.panel-content { display: flex; flex-direction: column; align-items: flex-start; }

/* Submarcas en versión positiva, mismo ancho (mín. web del manual: 180 px) y con área libre */
.panel-logo { display: block; padding: 14px 0; }
.panel-logo img { width: 240px; height: auto; display: block; }

.panel-title { font-weight: 300; font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); line-height: 1.1; margin: 1.25rem 0 1.75rem; }
.panel-text { font-size: 1.0625rem; color: var(--nv-text); max-width: 30em; margin-bottom: 1.75rem; }
.panel-cta {
  display: inline-flex; align-items: center; gap: .6rem; font-weight: 700;
  color: #fff; background: var(--nv-blue); text-decoration: none; padding: .8rem 1.25rem; border-radius: 4px;
  transition: background-color .2s;
}
.panel-cta:hover { background: var(--nv-blue-2); color: #fff; }

/* Dibujo técnico */
.panel-drawing { margin-top: clamp(2rem, 1rem + 3vw, 3.5rem); pointer-events: none; }
.drawing { width: 100%; max-width: 560px; height: auto; display: block; }
.dw-grid line { stroke-width: 1; }
.panel-construccion .dw-grid line { stroke: rgba(0, 179, 227, .14); }
.panel-packaging .dw-grid line { stroke: rgba(63, 174, 42, .14); }
.dw-main path { fill: none; stroke: rgba(0, 92, 185, .55); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.dw-accent path { fill: none; stroke-width: 1.4; }
.panel-construccion .dw-accent path { stroke: var(--nv-cyan); }
.panel-packaging .dw-accent path { stroke: var(--nv-green); }
.dw-text text { font-family: var(--nv-font); font-size: 12px; fill: var(--nv-text); }

/* Único momento animado: los planos se dibujan al cargar */
@media (prefers-reduced-motion: no-preference) {
  .js .dw-main path, .js .dw-accent path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s cubic-bezier(.6, .1, .2, 1) forwards; }
  .js .dw-accent path { animation-delay: 1.1s; animation-duration: .9s; }
  .js .panel-packaging .dw-main path { animation-delay: .25s; }
  .js .dw-text { opacity: 0; animation: fade .6s 1.7s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* ---------- Bloques ---------- */
.block { padding-block: clamp(4rem, 2.5rem + 5vw, 8rem); }
.block-paper { background: var(--nv-paper); }
.block-lead { font-size: 1.125rem; color: var(--nv-text); max-width: 30em; }
.statement { font-size: clamp(1.25rem, 1rem + .9vw, 1.75rem); line-height: 1.4; font-weight: 300; color: var(--nv-text); max-width: 24em; margin: 0; }

.facts { margin: 0; }
.fact { padding: 1.4rem 0 1.4rem 1.5rem; border-left: 4px solid var(--nv-cyan); }
.fact + .fact { margin-top: 1rem; }
.fact-p { border-left-color: var(--nv-green); }
.fact dt { font-size: 1.1875rem; font-weight: 700; color: var(--nv-blue); margin-bottom: .35rem; }
.fact dd { margin: 0; color: var(--nv-text); }

/* Líneas de producto */
.lines { margin-top: clamp(3.5rem, 2rem + 4vw, 6rem); border-top: 1px solid var(--nv-gray); }
.line { padding-top: 2rem; }
.line-construccion { padding-right: clamp(0rem, 3vw, 3rem); }
.line-packaging { padding-left: clamp(0rem, 3vw, 3rem); }
.line-title { font-size: 1.0625rem; font-weight: 500; color: var(--nv-text-2); margin-bottom: 1rem; }
.line-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
.line-list li { font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem); font-weight: 500; color: var(--nv-dark); padding: .7rem 0 .7rem 1.4rem; border-bottom: 1px solid var(--nv-rule); position: relative; }
.line-list li::before { content: ""; position: absolute; left: 0; top: calc(.7rem + .8em); width: 9px; height: 10px; margin-top: -5px; background: var(--nv-cyan); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.line-packaging .line-list li::before { background: var(--nv-green); }

/* ---------- Mapa + sucursales ---------- */
.map-col { position: sticky; top: calc(var(--nv-header-h) + 2rem); }
.map-figure { margin: 2rem 0 0; max-width: 360px; }
.ar-map { width: 100%; height: auto; max-height: 64vh; display: block; overflow: visible; }
.ar-shape { fill: #fff; stroke: var(--nv-gray); stroke-width: 1; }
.ar-city text { font-family: var(--nv-font); font-size: 11.5px; font-weight: 700; fill: var(--nv-dark); paint-order: stroke; stroke: var(--nv-paper); stroke-width: 3px; transition: fill .2s; }
.dot { fill: var(--nv-blue); stroke: #fff; stroke-width: 1.5; }
.ar-city circle { transition: r .2s; }
.ar-city.is-active text { fill: var(--nv-blue); }
.ar-city.is-active .dot { r: 7; fill: var(--nv-blue-2); }

.branches { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--nv-blue); }
.branch { display: grid; grid-template-columns: 132px 1fr auto; gap: 1.5rem; align-items: center; padding: 1.1rem 0; border-bottom: 1px solid var(--nv-rule); }
.branch-photo img { width: 132px; height: 99px; object-fit: cover; border-radius: 2px; display: block; background: var(--nv-rule); }
.branch-city { font-size: 1.375rem; font-weight: 500; margin: 0 0 .2rem; }
.branch-city span { font-weight: 500; color: var(--nv-text-2); font-size: 1rem; margin-left: .35rem; }
.branch-address { font-style: normal; color: var(--nv-text); margin: 0; }
.branch-hours { color: var(--nv-text); font-size: .9375rem; margin: .2rem 0 0; }
.branch-map { font-weight: 700; font-size: .9375rem; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .2rem; }
.branch-map:hover { text-decoration: underline; text-underline-offset: 4px; }
.branch.is-active .branch-city { color: var(--nv-blue-2); }
.branches-note { margin: 1.75rem 0 0; color: var(--nv-text); max-width: 42em; }

/* ---------- Preguntas ---------- */
.faq { --bs-accordion-bg: transparent; --bs-accordion-color: var(--nv-text); --bs-accordion-border-color: var(--nv-rule); --bs-accordion-active-bg: transparent; --bs-accordion-active-color: var(--nv-blue); --bs-accordion-btn-color: var(--nv-dark); --bs-accordion-btn-focus-box-shadow: none; }
.faq .accordion-item { border-width: 0 0 1px; border-radius: 0 !important; }
.faq .accordion-item:first-of-type { border-top: 2px solid var(--nv-blue); }
.faq .accordion-button { font-family: var(--nv-font); font-weight: 500; font-size: 1.1875rem; padding: 1.4rem 0; box-shadow: none; }
.faq .accordion-button:focus-visible { outline: 3px solid var(--nv-blue-2); outline-offset: 2px; }
.faq .accordion-body { padding: 0 0 1.6rem; color: var(--nv-text); max-width: 44em; }

/* ---------- Contacto: azul del grupo con el patrón del isotipo (pág. 2 del manual) ---------- */
.contact { position: relative; overflow: hidden; isolation: isolate; background: var(--nv-blue); color: #fff; padding-block: clamp(4rem, 2.5rem + 5vw, 7.5rem); }
.contact::before, .contact::after {
  content: ""; position: absolute; z-index: -1; aspect-ratio: 1; pointer-events: none;
  background: url("../img/logos/isotipo-pattern.svg") center / contain no-repeat;
}
.contact::before { width: 520px; right: -60px; top: -140px; }
.contact::after { width: 420px; right: 300px; bottom: -220px; }
.contact .block-title { color: #fff; }
.contact .block-title::before { background: linear-gradient(90deg, #fff 0 50%, var(--nv-tint-blue-1) 50% 100%); }
.contact-lead { font-size: 1.1875rem; color: rgba(255, 255, 255, .85); margin-bottom: 2rem; }
.contact-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; }
.contact-mail { font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem); font-weight: 500; color: #fff; text-decoration: underline; text-decoration-color: var(--nv-tint-blue-1); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.contact-mail:hover { color: var(--nv-tint-blue-1); }
.contact-address { margin: 2rem 0 0; color: rgba(255, 255, 255, .75); }
.contact-divisions { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.cdiv { padding: 1.5rem; background: #fff; border-radius: 4px; border-top: 6px solid var(--nv-cyan); }
.cdiv-packaging { border-top-color: var(--nv-green); }
.cdiv h3 { font-size: 1.1875rem; font-weight: 700; margin-bottom: 1rem; }
.cdiv li + li { margin-top: .5rem; }
.cdiv a { color: var(--nv-text); text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.cdiv a:hover { color: var(--nv-blue); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: #fff; padding-top: clamp(3rem, 2rem + 2vw, 4.5rem); }
.footer-logo { height: 56px; width: auto; margin: 0 0 4px; }
.footer-title { font-size: .9375rem; font-weight: 700; color: var(--nv-blue); margin-bottom: 1rem; }
.footer-links li { margin-bottom: .45rem; }
.footer-links a { color: var(--nv-text); text-decoration: none; }
.footer-links a:hover { color: var(--nv-blue); text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-top: 3rem; padding-block: 1.5rem; border-top: 1px solid var(--nv-rule); font-size: .875rem; color: var(--nv-text-2); }
.footer-bottom a { color: var(--nv-text-2); }

/* ---------- WhatsApp flotante ---------- */
.whatsapp-float {
  position: fixed; right: clamp(16px, 2vw, 28px); bottom: clamp(16px, 2vw, 28px); z-index: 1030;
  width: 60px; height: 60px; border-radius: 50%; background: #1faa53; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(35, 31, 32, .25); transition: transform .2s, background-color .2s;
}
.whatsapp-float:hover { color: #fff; background: #178a43; transform: scale(1.06); }
.whatsapp-float .icon-wa { width: 32px; height: 32px; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  :root { --nv-header-h: 80px; }
  .site-header .navbar { padding-block: 16px; }
  .brand-logo { height: 48px; }   /* ≈ 215 px de ancho, sobre el mínimo web de 160 px */
  .navbar-collapse { padding-block: 1rem; }
  .site-header .nav-link.active { text-decoration: none; }

  .intro-shape { width: 46vw; right: -14%; opacity: .5; }

  .split { grid-template-columns: 1fr; }
  .panel-construccion::after { top: auto; right: 0; left: 0; bottom: calc(var(--nv-chevron) * -1); width: auto; height: var(--nv-chevron); clip-path: polygon(0 0, 100% 0, 50% 100%); }
  .panel-inner, .panel-construccion .panel-inner { margin: 0; max-width: none; padding: 2.5rem 1.5rem 2rem; }
  .panel-construccion .panel-inner { padding-bottom: 2.5rem; }
  .panel-packaging .panel-inner { padding-top: calc(var(--nv-chevron) + 2rem); padding-left: 1.5rem; }
  .panel-drawing { margin-top: 2rem; }

  .map-col { position: static; }
  .map-figure { max-width: 300px; }
  .contact::after { display: none; }
}
@media (max-width: 575.98px) {
  .panel-logo img { width: 200px; }
  .line-list { grid-template-columns: 1fr; }
  .line-packaging { padding-top: 2.5rem; }
  .branch { grid-template-columns: 88px 1fr; gap: .25rem 1rem; }
  .branch-photo { grid-row: span 2; }
  .branch-photo img { width: 88px; height: 66px; }
  .branch-map { grid-column: 2; justify-self: start; padding-inline: 0; }
  .contact-divisions { grid-template-columns: 1fr; }
  .contact::before { width: 360px; right: -140px; top: -120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
