/* =========================================
   VARIABLES GLOBALES
   ========================================= */
:root {
  --blue-dark:      #004F9B;
  --blue-mid:       #1149b0;
  --gold:           #f0b429;
  --gold-hover:     #ffd060;
  --white:          #ffffff;
  --font-main:      Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --header-radius:  50px;
  --transition:     0.22s ease;
  --container-width: 1200px;
}

/* =========================================
   RESET Y BASE
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-main);
  background: #6ec5e8;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

a {
  text-decoration: none;
  color: inherit;
}

/* =========================================
   WRAPPER DEL HEADER
   ========================================= */
.header-wrapper {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 18px 24px;
  background: transparent;
  position: relative;
  z-index: 1;
}

.alerts-wrap {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 16px 48px 0;
}

/* =========================================
   HEADER PRINCIPAL
   ========================================= */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--blue-dark);
  border-radius: var(--header-radius);
  padding: 0 36px;
  height: 66px;
  box-sizing: border-box;
  box-shadow:
    0 4px 24px rgba(13, 58, 142, 0.28),
    0 1px 4px rgba(0, 0, 0, 0.14);
  gap: 16px;
}

@media (min-width: 901px) and (max-width: 1100px) {
  .site-header {
    padding: 0 20px;
    gap: 8px;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 7px 10px;
  }

  .btn-outline {
    font-size: 0.75rem;
    padding: 8px 14px;
  }

  .nav-link--wrap {
    max-width: 120px;
  }
}

/* =========================================
   NAVEGACIÓN — LINKS
   ========================================= */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.nav-link {
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  padding: 8px 16px;
  border-radius: 30px;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

.nav-link--wrap {
  white-space: normal;
  max-width: 160px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-link.active {
  background: rgba(255, 203, 0, 0.22) !important;
  color: #FFCB00 !important;
  box-shadow: inset 0 -3px 0 #FFCB00 !important;
}

/* =========================================
   NAVEGACIÓN — BOTONES
   ========================================= */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  line-height: 1;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 10px 26px;
  border-radius: 30px;
  border: 2.5px solid var(--gold);
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.btn-outline:hover {
  background: var(--gold);
  color: var(--blue-dark);
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(240, 180, 41, 0.45);
  transform: translateY(-1px);
}

.btn-outline:active {
  transform: translateY(0);
  box-shadow: none;
}

/* =========================================
   FONDO GLOBAL (SOL DESTELLADO)
   ========================================= */
.page-svg-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  isolation: isolate;
  pointer-events: none;
}

.page-svg-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.page-svg-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.30), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.14), transparent 38%);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* =========================================
   MAIN CONTENT
   ========================================= */
.main-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* =========================================
   HERO
   ========================================= */
.hero {
  background: #ffffff;
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 460px;
  height: 460px;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  max-width: var(--container-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  z-index: 1;
}

.hero::before {
  content: none;
}

.hero-svg-bg {
  position: absolute;
  inset: 0;
  clip-path: polygon(20% 0%, 100% 0%, 100% 50%, 70% 100%, 0% 100%, 0% 38%);
  z-index: 0;
  isolation: isolate;
}

.hero-svg-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-svg-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 38% 55%, rgba(255,255,255,0.30), transparent 18%),
    radial-gradient(circle at 38% 55%, rgba(255,255,255,0.14), transparent 38%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #F5C800;
  clip-path: polygon(100% 50%, 100% 100%, 70% 100%);
  z-index: 0;
}

.hero-sigelec-logo,
.hero-logo,
.hero-tecnico {
  position: relative;
  z-index: 1;
}

.hero-sigelec-logo {
  position: absolute;
  top: 20px;
  left: 28px;
  height: 52px;
  width: auto;
  z-index: 2;
}

.hero-logo {
  display: flex;
  align-items: center;
  align-self: center;
  flex-shrink: 0;
  animation: fadeUp 0.5s ease both;
}

.hero-logo img {
  width: 460px;
  max-width: 100%;
  height: auto;
  display: block;
}

.hero-tecnico {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 440px;
  width: auto;
}

/* =========================================
   SECCIÓN AMARILLA
   ========================================= */
.yellow-section {
  background: #F5C800;
  padding: 0;
}

.ys-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  width: 100%;
  padding: 48px 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-sizing: border-box;
}

/* Fila superior: logo + botones */
.yellow-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* Logo con círculo */
.ys-logo-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.ys-logo {
  position: relative;
  z-index: 1;
  height: 64px;
  width: auto;
  display: block;
}

.ys-slogan {
  position: relative;
  z-index: 1;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue-dark);
  padding-left: 4px;
}

/* Botones derecha */
.ys-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.ys-btn {
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--blue-dark);
  padding: 14px 52px;
  border-radius: 50px;
  text-align: center;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.ys-btn:hover {
  background: #003d7a;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Banda de marcas */
.ys-brands {
  background: #ffffff;
  border-radius: 50px;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 32px;
  flex-wrap: wrap;
}

.ys-brands img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: none;
}

/* Texto legal */
.ys-legal {
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--blue-dark);
  text-align: justify;
}

/* =========================================
   TEXTO LEGAL — componente reutilizable
   ========================================= */
.legal-text {
  padding: 12px 24px 28px;
}

.legal-text p {
  font-size: 0.74rem;
  color: #002d6b;
  line-height: 1.65;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 10px;
  padding: 12px 20px;
}

.legal-text strong { color: #001f3f; }

@media (max-width: 600px) {
  .legal-text { padding: 8px 12px 20px; }
  .legal-text p { font-size: 0.72rem; padding: 10px 14px; }
}

/* =========================================
   ANIMACIONES
   ========================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   HERO RESPONSIVE
   ========================================= */

/* Tablet grande */
@media (max-width: 1200px) {
  .hero {
    min-height: 460px;
    height: 460px;
  }
  .hero-inner     { padding: 0 24px; }
  .hero-logo img  { width: 360px; }
}

/* Tablet */
@media (max-width: 960px) {
  .hero {
    min-height: 420px;
    height: 420px;
  }
  .hero-inner     { padding: 0 16px; }
  .hero-logo img  { width: 260px; }
  .hero-tecnico   { height: 400px; }
  .ys-btn         { font-size: 0.95rem; padding: 12px 36px; }
}

/* Mobile */
@media (max-width: 768px) {
  .hero {
    height: 380px;
    min-height: 380px;
  }
  .hero-sigelec-logo { height: 36px; left: 16px; top: 16px; }
  .hero-logo {
    position: absolute;
    top: 38%;
    left: 16%;
    transform: translate(-50%, -50%);
    z-index: 2;
    align-self: unset;
    margin: 0;
  }
  .hero-logo img  { width: 190px; }
  .hero-tecnico   { height: 360px; }

  /* Inner container reduce padding en móvil */
  .ys-inner {
    padding: 32px 24px 28px;
    gap: 24px;
  }

  .yellow-top {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .ys-logo-wrap   { align-items: center; text-align: center; }
  .ys-buttons     { width: 100%; max-width: 320px; }
  .ys-btn         { width: 100%; padding: 13px 20px; font-size: 1rem; }

  .ys-brands {
    padding: 16px 20px;
    gap: 16px;
    border-radius: 24px;
    justify-content: center;
  }
  .ys-brands img  { height: 26px; }
  .ys-legal       { font-size: 0.74rem; }
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  background: #004387;
  padding: 14px 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.social-btn svg {
  width: 18px;
  height: 18px;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

/* =========================================
   HAMBURGUESA
   ========================================= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Animación X al abrir */
.hamburger.open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* =========================================
   NAV DESKTOP WRAPPER
   ========================================= */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: space-between;
}

/* =========================================
   OVERLAY FULLSCREEN MOBILE
   ========================================= */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--blue-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.mobile-overlay.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Botón X cerrar */
.overlay-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.4);
  color: var(--white);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.overlay-close:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--white);
}

/* Links del overlay */
.overlay-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0 32px;
}

.overlay-link {
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  padding: 14px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  border-radius: 12px;
  transition: background var(--transition);
}

.overlay-link:hover {
  background: rgba(255,255,255,0.1);
  color: var(--gold);
}

.overlay-link.active {
  background: rgba(255, 203, 0, 0.15);
  color: #FFCB00;
  border-left: 4px solid #FFCB00;
  padding-left: 20px;
}

/* Botones del overlay */
.overlay-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 32px;
}

.overlay-actions .btn-outline {
  width: 100%;
  max-width: 360px;
  text-align: center;
  padding: 13px 20px;
  font-size: 1rem;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .header-wrapper {
    padding: 12px 14px;
  }

  .site-header {
    border-radius: 20px;
    padding: 0 18px;
    height: 60px;
    overflow: visible;
  }

  .hamburger {
    display: flex;
  }

  .nav-desktop {
    display: none;
  }
}

@media (min-width: 901px) {
  .site-header {
    overflow: visible;
  }
}

/* =========================================
   USUARIO AUTENTICADO EN HEADER
   ========================================= */
.nav-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
}

.btn-user {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  line-height: 1;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  padding: 10px 26px;
  border-radius: 30px;
  border: 2.5px solid rgba(255,255,255,0.45);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-user:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.7);
}

/* =========================================
   BOTÓN WHATSAPP FLOTANTE
   ========================================= */
.whatsapp-btn {
  position: fixed;
  bottom: 70px;
  left: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5c800;
  border-radius: 50px;
  padding: 10px 20px 10px 10px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.3);
}
.whatsapp-btn svg {
  width: 42px;
  height: 42px;
  color: #25D366;
  flex-shrink: 0;
}
.whatsapp-btn span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-size: 0.72rem;
  font-weight: 700;
  color: #003d7a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.whatsapp-btn span strong {
  font-size: 0.9rem;
  font-weight: 900;
  color: #003d7a;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
@media (max-width: 600px) {
  .whatsapp-btn {
    bottom: 60px;
    padding: 8px 14px 8px 8px;
  }
  .whatsapp-btn svg {
    width: 34px;
    height: 34px;
  }
}
