/* Menú superior: barra de cristal, paneles con descripciones, indicador de sección y cajón móvil.
   Reutiliza las clases .nav-item / .dropdown-menu / .dropdown-menu-bridge que gestiona NavigationMenu en main.js. */

/* ---------- Barra ---------- */
.header-one.nv-bar { background-color: rgba(255, 255, 255, 0.82); border-color: rgba(223, 228, 235, 0.9); box-shadow: 0 10px 34px -16px rgba(20, 32, 31, 0.28); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); transition: all 0.4s ease-in-out; }
.header-one.nv-bar.scroll-header { background-color: rgba(255, 255, 255, 0.95); box-shadow: 0 16px 40px -18px rgba(11, 111, 108, 0.5); }
.nv-logo { flex: none; }
.nv-logo img { display: block; transition: transform 0.3s ease; }
.nv-logo:hover img { transform: scale(1.03); }

.nv-nav { display: flex; align-items: center; }
.nv-list { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; white-space: nowrap; }

.nv-link { position: relative; display: flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 999px; font-size: 0.95rem; font-weight: 500; line-height: 1.4; color: rgba(32, 32, 32, 0.68); text-decoration: none; transition: color 0.2s ease, background-color 0.2s ease; }
.nv-link:hover, .nv-link:focus-visible, .nav-item.active > .nv-link { color: #0b6f6c; background: rgba(81, 217, 214, 0.16); outline: none; }
.nv-link::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 16px; height: 3px; margin-left: -8px; border-radius: 3px; background: #51D9D6; transform: scaleX(0); transition: transform 0.3s ease; }
.nv-link.is-current { color: #0b6f6c; }
.nv-link.is-current::after { transform: scaleX(1); }
.nv-link .nav-arrow svg { display: block; width: 16px; height: 16px; }

/* Barra de progreso de lectura */
.nv-progress { position: absolute; left: 28px; right: 28px; bottom: -1px; height: 3px; overflow: hidden; border-radius: 3px; pointer-events: none; }
.nv-progress i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #51D9D6, #0b6f6c); transform-origin: left; transform: scaleX(var(--nv-p, 0)); }

/* ---------- Llamada y CTA ---------- */
.nv-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; flex: none; }
.nv-phone { display: none; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; white-space: nowrap; border-radius: 999px; font-size: 0.9rem; font-weight: 700; color: #202020; text-decoration: none; transition: background-color 0.2s ease, color 0.2s ease; }
.nv-phone:hover, .nv-phone:focus-visible { background: rgba(81, 217, 214, 0.16); color: #0b6f6c; outline: none; }
.nv-phone__ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(81, 217, 214, 0.22); color: #0b6f6c; }
.nv-phone__ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: nv-ring 4s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes nv-ring { 0%, 70%, 100% { transform: rotate(0); } 74% { transform: rotate(-14deg); } 78% { transform: rotate(12deg); } 82% { transform: rotate(-10deg); } 86% { transform: rotate(8deg); } 90% { transform: rotate(0); } }

.nv-cta { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; overflow: hidden; white-space: nowrap; border: 0; border-radius: 999px; background: linear-gradient(100deg, #51D9D6, #2db5b2); box-shadow: 0 10px 18px -8px rgba(65, 201, 198, 0.65); font-size: 1rem; font-weight: 700; color: #14201f; cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.nv-cta::before { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-20deg); animation: nv-shine 5s ease-in-out infinite; }
@keyframes nv-shine { 0%, 60% { left: -60%; } 100% { left: 140%; } }
.nv-cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s ease; }
.nv-cta:hover, .nv-cta:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 26px -10px rgba(65, 201, 198, 0.8); outline: none; }
.nv-cta:hover svg { transform: translateX(4px); }

/* ---------- Paneles desplegables ---------- */
.nv-panel.dropdown-menu { position: absolute; left: 50%; top: 100%; margin-top: 10px; padding: 10px; width: 360px; border: 1px solid #dfe4eb; border-radius: 26px; background: #fff; box-shadow: 0 34px 70px -30px rgba(20, 32, 31, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.6) inset; translate: -50% 0; z-index: 50; white-space: normal; text-align: left; }
.nv-panel::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 3px; border-radius: 0 0 6px 6px; background: linear-gradient(90deg, #51D9D6, #0b6f6c); }
.nv-panel.dropdown-menu.nv-panel--md { width: 350px; }
.nv-panel.dropdown-menu.nv-panel--lg { width: 680px; }
.nv-panel--lg .nv-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 8px; }
.nv-panel.dropdown-menu.nv-panel--xl { width: 700px; }
.nv-bridge { position: absolute; left: 50%; top: 100%; width: 100%; min-width: 320px; height: 16px; translate: -50% 0; z-index: 40; }

.nv-cols { display: grid; gap: 4px 8px; }
.nv-cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nv-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nv-h { display: block; margin: 8px 10px 2px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #0b6f6c; }
.nv-col > .nv-h:first-child { margin-top: 4px; }

.nv-item { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px; padding: 7px 10px; border-radius: 14px; color: #202020; text-decoration: none; transition: background-color 0.2s ease, transform 0.2s ease; }
.nv-item:hover, .nv-item:focus-visible, .nv-item[aria-current="page"] { background: #f2f8f8; outline: none; }
.nv-item:hover { transform: translateX(3px); }
.nv-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: rgba(81, 217, 214, 0.18); color: #0b6f6c; transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease; }
.nv-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nv-item:hover .nv-ico, .nv-item:focus-visible .nv-ico { background: #51D9D6; color: #14201f; transform: rotate(-7deg) scale(1.08); }
.nv-txt { display: block; min-width: 0; }
.nv-txt b { display: flex; align-items: center; gap: 8px; font-size: 0.94rem; font-weight: 700; line-height: 1.25; color: #202020; }
.nv-txt small { display: block; margin-top: 1px; font-size: 0.78rem; line-height: 1.3; color: rgba(32, 32, 32, 0.6); }
.nv-tag { padding: 2px 8px; border-radius: 999px; background: #0b6f6c; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }

/* Entrada escalonada al abrir un panel */
.nv-panel.active .nv-item { animation: nv-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(0.04s + var(--n, 0) * 0.05s); }
@keyframes nv-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Los paneles también deben funcionar entre 1025 y 1279 px (main.css los ocultaba por debajo de 1280) */
@media (min-width: 1025px) {
  .nv-panel.dropdown-menu { display: block !important; }
}
@media (min-width: 1025px) and (max-width: 1279px) {
  .nv-list { gap: 0; }
  .nv-link { padding: 8px 10px; font-size: 0.9rem; }
  .nv-logo figure { max-width: 150px; }
  .nv-cta { padding: 11px 18px; font-size: 0.95rem; }
  .nv-panel.dropdown-menu.nv-panel--lg { width: 620px; }
  .nv-panel.dropdown-menu.nv-panel--xl { width: 640px; }
}
@media (min-width: 1500px) {
  .nv-phone { display: inline-flex; }
}

/* ---------- Menú móvil (≤1024 px): isla flotante + panel con pestañas ----------
   Todo es fluido (flex, min(), contenedores): sin anchos fijos, funciona desde ~280 px. */
.nvm, .nvd { display: none; }
@keyframes nvm-ripple { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes nvm-pop { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: none; } }
@keyframes nvm-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes nvm-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 1024px) {
  html body { padding-top: 72px !important; }

  /* Isla */
  #mobileTopBar.nvm { position: fixed; left: 0; right: 0; top: calc(8px + env(safe-area-inset-top)); z-index: 50; display: flex !important; justify-content: center; box-sizing: border-box; height: auto !important; padding: 0 8px; background: transparent !important; box-shadow: none !important; pointer-events: none; }
  .nvm__pill { position: relative; pointer-events: auto; display: flex; align-items: center; gap: 8px; box-sizing: border-box; width: min(100%, 560px); min-height: 54px; padding: 7px 7px 7px 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 999px; background: rgba(255, 255, 255, 0.8); box-shadow: 0 14px 34px -14px rgba(10, 79, 77, 0.5), 0 0 0 1px rgba(11, 111, 108, 0.08); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1), padding 0.4s ease; }
  .nvm__logo { position: absolute; left: 50%; top: 50%; display: flex; align-items: center; justify-content: center; transform: translate(-50%, -50%); width: calc(100% - 204px); min-width: 0; }
  #mobileTopBar .nvm__full { display: block; width: auto !important; height: auto !important; max-width: 100% !important; max-height: 32px; object-fit: contain; }
  #mobileTopBar.is-compact .nvm__logo { position: static; transform: none; width: auto; margin-right: auto; }
  #mobileTopBar .nvm__mark { display: none; width: 34px !important; height: 34px !important; max-width: none !important; animation: nvm-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .nvm__call { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-left: auto; border-radius: 50%; background: #51D9D6; color: #14201f; }
  .nvm__call::after { content: ""; position: absolute; inset: 0; border: 2px solid #51D9D6; border-radius: 50%; animation: nvm-ripple 2.6s ease-out infinite; pointer-events: none; }
  .nvm__call svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
  .nv-burger { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #0b6f6c; color: #fff; cursor: pointer; transition: background-color 0.3s ease, color 0.3s ease; }
  .nv-burger:hover, .nv-burger:focus-visible { background: #0a4f4d; outline: none; }
  .nv-burger span { display: block; flex: none; width: 18px; height: 2px; margin: 2.5px 0; border-radius: 2px; background: currentColor; transition: transform 0.3s ease, opacity 0.2s ease; }
  .nv-burger[aria-expanded="true"] { background: #51D9D6; color: #14201f; }
  .nv-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nv-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nv-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nvm__prog { position: absolute; left: 22px; right: 22px; bottom: 0; height: 3px; overflow: hidden; border-radius: 3px; pointer-events: none; }
  .nvm__prog i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #51D9D6, #0b6f6c); transform-origin: left; transform: scaleX(var(--nv-p, 0)); }
  #mobileTopBar.is-compact .nvm__pill { width: 152px; padding-left: 7px; }
  #mobileTopBar.is-compact .nvm__full, #mobileTopBar.is-compact .nvm__prog { display: none; }
  #mobileTopBar.is-compact .nvm__mark { display: block; }

  /* Panel */
  .nvd { position: fixed; left: 8px; right: 8px; top: calc(70px + env(safe-area-inset-top)); bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 49; display: flex; flex-direction: column; box-sizing: border-box; max-width: 560px; margin: 0 auto; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 28px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 34px 70px -26px rgba(10, 79, 77, 0.6); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); visibility: hidden; opacity: 0; transform: translateY(-14px) scale(0.97); transform-origin: 90% 0; transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.45s; }
  .nvd.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .nvd__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; container-type: inline-size; padding: 14px 12px 10px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .nvd-h { margin: 0 4px 8px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #0b6f6c; }
  .nvd-h:not(:first-child) { margin-top: 16px; }
  .nvd-prods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
  .nvd-prods li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .nvd-prod { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; box-sizing: border-box; height: 100%; padding: 12px; border: 1px solid #e6ecf1; border-radius: 20px; background: linear-gradient(160deg, #f4fcfb, #fff 70%); color: #202020; text-decoration: none; overflow-wrap: anywhere; animation: nvm-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; transition: border-color 0.2s ease, transform 0.2s ease; }
  .nvd-prod:active, .nvd-prod:hover { border-color: #51D9D6; }
  .nvd-prods li:nth-child(2) .nvd-prod { animation-delay: 0.04s; }
  .nvd-prods li:nth-child(3) .nvd-prod { animation-delay: 0.08s; }
  .nvd-prods li:nth-child(4) .nvd-prod { animation-delay: 0.12s; }
  .nvd-prods li:nth-child(5) .nvd-prod { animation-delay: 0.16s; }
  .nvd-prods li:nth-child(6) .nvd-prod { animation-delay: 0.2s; }
  .nvd-prod__i { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px; border-radius: 12px; background: #51D9D6; color: #14201f; }
  .nvd-prod__i svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .nvd-prod b { font-size: 0.95rem; font-weight: 800; line-height: 1.2; }
  .nvd-prod b em { margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: #0b6f6c; font-style: normal; font-size: 0.62rem; font-weight: 800; color: #fff; vertical-align: 2px; }
  .nvd-prod small { font-size: 0.76rem; line-height: 1.3; color: rgba(32, 32, 32, 0.62); }
  .nvd-more { display: flex; flex-wrap: wrap; gap: 6px; }
  .nvd-more a { flex: 1 1 auto; padding: 10px 14px; border: 1.5px solid #e1e8ee; border-radius: 999px; background: #fff; text-align: center; font-size: 0.86rem; font-weight: 800; color: #202020; text-decoration: none; }
  .nvd-more a:active, .nvd-more a:hover { border-color: #51D9D6; color: #0b6f6c; }
  .nvd__bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid #eef1f5; background: #fff; }
  .nvd__bar .nv-cta { flex: 1 1 auto; justify-content: center; min-width: 0; }
  .nvd__call { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 1px solid #51D9D6; border-radius: 50%; background: rgba(81, 217, 214, 0.14); color: #0b6f6c; }
  .nvd__call svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  html.nv-lock, html.nv-lock body { overflow: hidden !important; }
  html.nv-lock .contact-widget, html.nv-lock .contact-notification { visibility: hidden; opacity: 0; pointer-events: none; }
  html.nv-lock::before { content: ""; position: fixed; inset: 0; z-index: 48; background: rgba(20, 32, 31, 0.4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: nvm-fade 0.3s ease both; }
  .nvd { display: flex; }
}
@container (max-width: 250px) {
  .nvd-prods { grid-template-columns: minmax(0, 1fr); }
}
/* Horizontal (móvil apaisado): panel más ancho, tarjetas compactas en 3 columnas para ver más productos a la vez */
@media (max-width: 1024px) and (max-height: 520px) {
  .nvd { max-width: 760px; top: calc(66px + env(safe-area-inset-top)); }
  .nvd__scroll { padding: 10px 12px 6px; }
  .nvd-prods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nvd-prods li:last-child:nth-child(odd) { grid-column: auto; }
  .nvd-prod { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 0; padding: 8px 10px; border-radius: 16px; }
  .nvd-prod__i { grid-row: 1 / 3; width: 32px; height: 32px; margin: 0; }
  .nvd-prod b { flex: 1 1 calc(100% - 44px); font-size: 0.86rem; }
  .nvd-prod small { flex: 1 1 100%; padding-left: 42px; margin-top: -2px; font-size: 0.72rem; }
  .nvd-h:not(:first-child) { margin-top: 10px; }
  .nvd__bar { padding: 8px 12px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .nv-cta::before, .nv-phone__ico svg { animation: none; }
  .nv-panel.active .nv-item { animation: none; }
  .nv-item, .nv-ico, .nvd { transition: none; }
  .nvm__call::after, .nvm__mark, .nvd-prod { animation: none; }
  .nvm__pill { transition: none; }
}
