/**
 * Nombre: layout.css
 * Propósito: Estilos del header, footer y estructura general.
 * Dependencias: tokens.css, core.css.
 * Responsabilidad: Definir la estructura principal del sitio.
 * Autor: PREVENGO SAS
 * Fecha: 2026-08-02
 */

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--prv-color-white);
  box-shadow: 0 2px 12px rgba(11, 79, 163, 0.08);
  height: 96px;
}

@media (min-width: 1024px) {
  .header {
    height: var(--prv-header-height);
  }
}.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--prv-space-md);
}

.header__logo {
  display: flex;
  align-items: center;
  height: 88px;
  max-width: 250px;
  flex-shrink: 0;
}

.header__logo img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

@media (min-width: 768px) {
  .header__logo {
    height: 92px;
    max-width: 280px;
  }
}

@media (min-width: 1024px) {
  .header__logo {
    height: 116px;
    max-width: 400px;
  }
}

.header__cta {
  display: none;
}

@media (min-width: 1024px) {
  .header__cta {
    display: inline-flex;
  }
}

.nav {
  display: none;
  align-items: center;
  gap: var(--prv-space-xl);
}

@media (min-width: 1024px) {
  .nav {
    display: flex;
  }
}

.nav__link {
  font-size: var(--prv-text-sm);
  font-weight: 500;
  color: var(--prv-color-text);
  transition: color var(--prv-transition);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--prv-space-xs);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--prv-color-secondary);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--prv-color-secondary);
  transition: width var(--prv-transition);
}

.nav__link:hover::after,
.nav__link:focus-visible::after {
  width: 100%;
}

.dropdown {
  position: relative;
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--prv-color-white);
  border-radius: var(--prv-border-radius);
  box-shadow: var(--prv-shadow-lg);
  padding: var(--prv-space-sm) 0;
  min-width: 260px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--prv-transition);
  z-index: 1001;
}

.dropdown.is-open .dropdown__menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown__item {
  display: block;
  padding: var(--prv-space-sm) var(--prv-space-lg);
  font-size: var(--prv-text-sm);
  color: var(--prv-color-text);
  transition: background var(--prv-transition), color var(--prv-transition);
  white-space: nowrap;
}

.dropdown__item:hover,
.dropdown__item:focus-visible {
  background: var(--prv-color-background);
  color: var(--prv-color-secondary);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: var(--prv-color-white);
  background: linear-gradient(135deg, var(--prv-color-primary) 0%, var(--prv-color-secondary) 100%);
  border-radius: var(--prv-border-radius);
  border: none;
  box-shadow: var(--prv-shadow);
  flex-shrink: 0;
  cursor: pointer;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: var(--prv-color-primary);
}

.menu-toggle .icon {
  width: 26px;
  height: 26px;
}

@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }
}

.mobile-nav {
  position: fixed;
  top: 96px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--prv-color-white);
  padding: var(--prv-space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--prv-space-lg);
  transform: translateX(100%);
  transition: transform var(--prv-transition);
  z-index: 999;
  overflow-y: auto;
}
@media (min-width: 1024px) {
  .mobile-nav {
    top: var(--prv-header-height);
    display: none;
  }
}

.mobile-nav.is-open {
  transform: translateX(0);
}

.mobile-nav__link {
  font-size: var(--prv-text-xl);
  font-weight: 500;
  color: var(--prv-color-text);
  padding: var(--prv-space-sm) 0;
  border-bottom: 1px solid var(--prv-color-background);
}

.mobile-nav__link:hover,
.mobile-nav__link:focus-visible {
  color: var(--prv-color-secondary);
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  gap: var(--prv-space-xs);
}

.mobile-nav__sub {
  display: flex;
  flex-direction: column;
  gap: var(--prv-space-xs);
  padding-left: var(--prv-space-md);
  border-left: 2px solid var(--prv-color-background);
}

.mobile-nav__sublink {
  font-size: var(--prv-text-base);
  color: var(--prv-color-text);
  opacity: 0.85;
  padding: var(--prv-space-xs) 0;
  transition: color var(--prv-transition), opacity var(--prv-transition);
}

.mobile-nav__sublink:hover,
.mobile-nav__sublink:focus-visible {
  color: var(--prv-color-secondary);
  opacity: 1;
}

/* Footer */
.footer {
  background: #021F49;
  color: var(--prv-color-white);
  padding: var(--prv-space-3xl) 0 var(--prv-space-lg);
}

.footer__grid {
  display: grid;
  gap: var(--prv-space-xl);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
}

.footer__brand img {
  height: 44px;
  width: auto;
  margin-bottom: var(--prv-space-md);
}

.footer__desc {
  font-size: var(--prv-text-sm);
  opacity: 0.85;
  line-height: 1.7;
  margin-bottom: var(--prv-space-md);
}

.footer__socials {
  display: flex;
  gap: var(--prv-space-md);
}

.footer__social {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--prv-transition), transform var(--prv-transition);
}

.footer__social:hover,
.footer__social:focus-visible {
  background: var(--prv-color-secondary);
  transform: translateY(-2px);
}

.footer__title {
  font-size: var(--prv-text-lg);
  font-weight: 600;
  margin-bottom: var(--prv-space-md);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--prv-space-sm);
}

.footer__link {
  font-size: var(--prv-text-sm);
  opacity: 0.85;
  transition: opacity var(--prv-transition), color var(--prv-transition);
}

.footer__link:hover,
.footer__link:focus-visible {
  opacity: 1;
  color: var(--prv-color-accent);
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: var(--prv-space-md);
}

.footer__contact-item {
  display: flex;
  gap: var(--prv-space-sm);
  font-size: var(--prv-text-sm);
  opacity: 0.85;
  align-items: flex-start;
}

.footer__contact-item .icon {
  margin-top: 2px;
  flex-shrink: 0;
}

.footer__bottom {
  margin-top: var(--prv-space-2xl);
  padding-top: var(--prv-space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: var(--prv-space-md);
  align-items: center;
  text-align: center;
  font-size: var(--prv-text-sm);
  opacity: 0.7;
}

@media (min-width: 768px) {
  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer__legal {
  display: flex;
  gap: var(--prv-space-lg);
}

.footer__legal a:hover,
.footer__legal a:focus-visible {
  color: var(--prv-color-accent);
}

/* WhatsApp float */
.whatsapp-float {
  position: fixed;
  bottom: var(--prv-space-xl);
  right: var(--prv-space-xl);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  color: var(--prv-color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--prv-shadow-lg);
  transition: transform var(--prv-transition), box-shadow var(--prv-transition);
  z-index: 1002;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.35);
}

.whatsapp-float .icon {
  width: 32px;
  height: 32px;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: var(--prv-space-xl);
  left: var(--prv-space-xl);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--prv-color-primary);
  color: var(--prv-color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--prv-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--prv-transition);
  z-index: 1002;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--prv-color-secondary);
  transform: translateY(-2px);
}

.back-to-top .icon {
  width: 20px;
  height: 20px;
}
