/*
 * header-radvasc.css  —  v2.0
 * ===================================================
 * Estilos del header de RadVasc Medical para el tema
 * WordPress "Simplest".
 * ===================================================
 */

/* ── Variables de color ── */
:root {
  --rv-white:       #ffffff;
  --rv-blue:        #002d56;
  --rv-blue-light:  #027df0;
  --rv-blue-light2: #cce6ff;
  --rv-grey:        #436788;
  --rv-bg:          #EEF5FD;
}

/* ════════════════════════════════════════
   RESET ACOTADO AL HEADER
   IMPORTANTE: no reseteamos margin/padding
   de forma global dentro del header para no
   romper los iconos de Font Awesome.
════════════════════════════════════════ */
#rv-site-header,
#rv-site-header *,
#rv-site-header *::before,
#rv-site-header *::after {
  box-sizing: border-box;
}

/* Tipografía consistente solo para el header */
#rv-site-header,
#rv-site-header a,
#rv-site-header button,
#rv-site-header div,
#rv-site-header nav,
#rv-site-header span {
  font-family: "Poppins", sans-serif;
}

/* ════════════════════════════════════════
   HEADER CONTENEDOR
════════════════════════════════════════ */
#rv-site-header {
  width: 100%;
  background: var(--rv-white);
  padding: 0 6vw;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 2px 16px rgba(0, 45, 86, 0.08);
}

/* Evita desbordamiento horizontal en toda la página */
body {
  overflow-x: hidden;
}

/* ════════════════════════════════════════
   TOP BAR
════════════════════════════════════════ */
.rv-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 45, 86, 0.08);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rv-top-bar > a {
  font-size: clamp(0.7rem, 0.95vw, 0.82rem);
  color: var(--rv-grey);
  text-decoration: none;
  transition: color 0.25s;
  display: inline-block;
  line-height: 1.4;
}

.rv-top-bar > a:hover {
  color: var(--rv-blue-light);
}

/* Redes sociales */
.rv-social-media {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.rv-social-media a {
  color: var(--rv-grey);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.25s, transform 0.25s;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.rv-social-media a:hover {
  color: var(--rv-blue-light);
  transform: translateY(-2px);
}

/* ════════════════════════════════════════
   DESKTOP HEADER
════════════════════════════════════════ */
.rv-desktop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  gap: 1rem;
}

/* Logo */
.rv-logo-box {
  display: inline-flex;
  align-items: center;
  width: clamp(110px, 7vw, 160px);
  flex-shrink: 0;
  text-decoration: none;
}

.rv-logo-box img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Nav bar ── */
.rv-nav-contain {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.rv-nav-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(0.4rem, 1.2vw, 1.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Items de navegación ── */
.rv-navbar-item {
  font-size: clamp(0.78rem, 0.95vw, 0.9rem);
  font-weight: 500;
  color: var(--rv-grey);
  text-decoration: none;
  transition: color 0.25s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 0.3rem 0;
  line-height: 1;
}

.rv-navbar-item:hover,
.rv-navbar-item.rv-navbar-active {
  color: var(--rv-blue-light);
}

/* Flecha del dropdown en el item de la nav */
.rv-navbar-item i.fa-angle-down {
  font-size: 0.75em;
  display: inline-block;
  transition: transform 0.25s;
  line-height: 1;
  width: auto;
  height: auto;
}

/* ════════════════════════════════════════
   DROPDOWN PRINCIPAL (nivel 1)
════════════════════════════════════════ */
.rv-dropdown {
  position: relative;
  display: inline-block;
}

/* Mostrar dropdown al hover */
.rv-dropdown:hover > .rv-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

/* Rotar flecha al hacer hover */
.rv-dropdown:hover > .rv-navbar-item i.fa-angle-down {
  transform: rotate(180deg);
}

/* Panel del dropdown */
.rv-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--rv-white);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 45, 86, 0.15);
  min-width: 240px;
  width: max-content;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  z-index: 1000;
  border-top: 3px solid var(--rv-blue-light);
}

/* Flechita decorativa arriba del panel */
.rv-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--rv-blue-light);
}

/* Links directos dentro del dropdown (sin submenú) */
.rv-dropdown-menu > a {
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--rv-blue);
  padding: 10px 18px;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, padding-left 0.18s;
  display: block;
  white-space: nowrap;
  line-height: 1.4;
}

.rv-dropdown-menu > a:hover {
  background: var(--rv-blue-light2);
  color: var(--rv-blue-light);
  padding-left: 22px;
}

/* ════════════════════════════════════════
   DROPDOWN ANIDADO (nivel 2)
════════════════════════════════════════ */
.rv-dropdown-nested {
  position: relative;
}

/* Link del nivel 2 con flecha → a la derecha */
.rv-dropdown-nested-link {
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--rv-blue);
  padding: 10px 18px;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
  line-height: 1.4;
}

.rv-dropdown-nested-link:hover {
  background: var(--rv-blue-light2);
  color: var(--rv-blue-light);
}

/* Flecha → del submenú anidado */
.rv-nested-icon {
  font-size: 0.75em;
  display: inline-block;
  line-height: 1;
  width: auto;
  height: auto;
  flex-shrink: 0;
  transition: transform 0.22s;
  margin-left: auto;
}

/* Panel del nivel 2 */
.rv-dropdown-menu-nested {
  position: absolute;
  left: 100%;
  top: -6px;
  background: var(--rv-white);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 45, 86, 0.15);
  min-width: 220px;
  width: max-content;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
  z-index: 1001;
  border-top: 3px solid var(--rv-blue-light);
}

/* Mostrar submenú al hover del item padre */
.rv-dropdown-nested:hover > .rv-dropdown-menu-nested {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Rotar la flecha → cuando el submenú está abierto */
.rv-dropdown-nested:hover .rv-nested-icon {
  transform: rotate(90deg);
}

/* Links dentro del submenú nivel 2 */
.rv-dropdown-menu-nested a {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--rv-blue);
  padding: 9px 16px;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, padding-left 0.18s;
  display: block;
  white-space: nowrap;
  line-height: 1.4;
}

.rv-dropdown-menu-nested a:hover {
  background: var(--rv-blue-light2);
  color: var(--rv-blue-light);
  padding-left: 20px;
}

/* ════════════════════════════════════════
   BOTÓN CTA
════════════════════════════════════════ */
.rv-header-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.rv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s, color 0.25s;
  white-space: nowrap;
  border: none;
  line-height: 1;
}

.rv-btn-primary {
  background: var(--rv-blue-light);
  color: var(--rv-white) !important;
  box-shadow: 0 4px 16px rgba(2, 125, 240, 0.35);
}

.rv-btn-primary:hover {
  background: var(--rv-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 45, 86, 0.35);
  color: var(--rv-white) !important;
}

/* ════════════════════════════════════════
   MOBILE HEADER STRIP (logo + hamburger)
════════════════════════════════════════ */
.rv-mobile-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

/* Botón hamburger */
.rv-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.rv-menu-toggle:hover {
  background: var(--rv-blue-light2);
}

.rv-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--rv-blue);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* Animación → X al abrirse */
.rv-menu-toggle.rv-is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.rv-menu-toggle.rv-is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.rv-menu-toggle.rv-is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ════════════════════════════════════════
   PANEL MOBILE (desliza desde la derecha)
════════════════════════════════════════ */
.rv-mobile-menu {
  position: fixed;
  top: 0;
  right: -360px;        /* empieza fuera de pantalla */
  width: 320px;
  max-width: 88vw;
  height: 100vh;
  height: 100dvh;       /* soporte móvil moderno */
  background: var(--rv-white);
  box-shadow: -4px 0 30px rgba(0, 45, 86, 0.18);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.rv-mobile-menu.rv-menu-active {
  right: 0;
}

/* Cabecera del panel: logo + botón X */
.rv-mobile-menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--rv-blue-light2);
  background: var(--rv-white);
  position: sticky;
  top: 0;
  z-index: 1;
}

.rv-mobile-menu-top .rv-logo-box {
  width: 110px;
  flex-shrink: 0;
}

.rv-menu-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--rv-blue);
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.rv-menu-close:hover {
  background: var(--rv-blue-light2);
  color: var(--rv-blue-light);
}

/* ── Nav mobile ── */
.rv-mobile-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.5rem 0;
}

/* Links simples dentro del menú mobile */
.rv-mobile-nav > a {
  display: block;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--rv-blue);
  padding: 13px 20px;
  border-bottom: 1px solid rgba(0, 45, 86, 0.06);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  line-height: 1.3;
}

.rv-mobile-nav > a:hover,
.rv-mobile-nav > a.rv-navbar-active {
  color: var(--rv-blue-light);
  background: rgba(2, 125, 240, 0.04);
}

/* ── Mobile Dropdowns (accordion) ── */
.rv-mobile-dropdown {
  border-bottom: 1px solid rgba(0, 45, 86, 0.06);
}

.rv-mobile-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--rv-blue);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s, background 0.2s;
  line-height: 1.3;
}

.rv-mobile-dropdown-header:hover {
  color: var(--rv-blue-light);
  background: rgba(2, 125, 240, 0.04);
}

/* Flecha del dropdown mobile */
.rv-mobile-dropdown-header i.fa-angle-down {
  font-size: 0.8em;
  display: inline-block;
  line-height: 1;
  width: auto;
  height: auto;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.rv-mobile-dropdown.rv-mobile-open > .rv-mobile-dropdown-header i.fa-angle-down {
  transform: rotate(180deg);
}

.rv-mobile-dropdown.rv-mobile-open > .rv-mobile-dropdown-header {
  color: var(--rv-blue-light);
  background: rgba(2, 125, 240, 0.04);
}

/* Contenedor de items del dropdown mobile */
.rv-mobile-dropdown-menu {
  display: none;
  flex-direction: column;
  background: rgba(0, 45, 86, 0.02);
  padding: 4px 0 8px 0;
}

.rv-mobile-dropdown.rv-mobile-open > .rv-mobile-dropdown-menu {
  display: flex;
}

/* Links dentro del dropdown mobile */
.rv-mobile-dropdown-menu > a {
  display: block;
  font-size: 0.87rem;
  color: var(--rv-blue);
  padding: 9px 20px 9px 30px;
  text-decoration: none;
  transition: color 0.18s, background 0.18s;
  font-weight: 500;
  line-height: 1.35;
  border-bottom: 1px solid rgba(0, 45, 86, 0.04);
}

.rv-mobile-dropdown-menu > a:last-child {
  border-bottom: none;
}

.rv-mobile-dropdown-menu > a:hover {
  color: var(--rv-blue-light);
  background: rgba(2, 125, 240, 0.06);
}

/* Sub-items (nivel 2) en mobile */
.rv-mobile-subitem {
  font-size: 0.81rem !important;
  color: var(--rv-grey) !important;
  padding-left: 42px !important;
  font-weight: 400 !important;
}

.rv-mobile-subitem:hover {
  color: var(--rv-blue-light) !important;
}

/* CTA en el panel mobile */
.rv-mobile-menu .rv-header-buttons {
  padding: 1.2rem 1.4rem;
  justify-content: center;
}

.rv-mobile-menu .rv-btn {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 0.9rem;
}

/* ════════════════════════════════════════
   OVERLAY (fondo oscuro al abrir mobile)
════════════════════════════════════════ */
#rv-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 50, 0.5);
  z-index: 9998;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#rv-menu-overlay.rv-overlay-active {
  display: block;
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 1100px) {
  /* Ocultar header desktop, mostrar mobile strip */
  .rv-desktop-header {
    display: none !important;
  }

  .rv-mobile-header {
    display: flex !important;
  }

  .rv-top-bar {
    display: none;
  }
}

/* Ajustar padding del header en pantallas pequeñas */
@media (max-width: 768px) {
  #rv-site-header {
    padding: 0 1.25rem;
  }
}

@media (max-width: 480px) {
  #rv-site-header {
    padding: 0 1rem;
  }
}

/* Seguridad: si el submenú de nivel 2 queda fuera de la pantalla,
   lo abrimos hacia la izquierda */
@media (max-width: 1300px) {
  .rv-dropdown-menu-nested {
    left: auto;
    right: 100%;
    transform: translateX(8px);
  }
  .rv-dropdown-nested:hover > .rv-dropdown-menu-nested {
    transform: translateX(0);
  }
}
