/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
  --green: #1f7a5a;
  --dark: #0f5132;
  --soft: #eef7f3;
  --alert-yellow: #ffd166;
  --whatsapp-green: #25d366;
  --white: #ffffff;
  --text-dark: #222222;
  --shadow-light: rgba(0, 0, 0, 0.06);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --shadow-heavy: rgba(0, 0, 0, 0.3);
  
  /* Espaciado */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Tipografía */
  --font-base: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-weight-normal: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Transiciones */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================
   RESET Y BASE
   ============================================ */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-base);
  background: #f7f9fb;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  background: linear-gradient(90deg, #0b3d2e, #1f7a5a);
  border: none;
  min-height: 4.6875rem; /* 75px */
  box-shadow: 0 0.25rem 1.25rem var(--shadow-medium);
  transition: var(--transition-base);
}

.navbar-fixed-top {
  z-index: 1030;
}

.logo-wrapper {
  background: var(--white);
  padding: 0.375rem 0.875rem; /* 6px 14px */
  border-radius: 0.75rem; /* 12px */
  display: inline-flex;
  align-items: center;
  transition: var(--transition-fast);
}

.logo-wrapper:hover {
  transform: scale(1.02);
}

.logo-img {
  height: 2.5rem; /* 40px */
}

.navbar .nav > li > a {
  color: var(--white) !important;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  padding: 1.625rem 1.125rem; /* 26px 18px */
  transition: var(--transition-fast);
  font-size: 0.875rem;
  letter-spacing: 0.03em;
}

.navbar .nav > li > a:hover,
.navbar .nav > li > a:focus {
  background: rgba(255, 255, 255, 0.15) !important;
  transform: translateY(-2px);
}

.navbar .nav > li.active > a {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Botón hamburguesa (toggle) */
.navbar-toggle {
  border-color: rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 0.5rem 0.75rem;
}

.navbar-toggle:hover,
.navbar-toggle:focus {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggle .icon-bar {
  background-color: var(--white);
  height: 3px;
  border-radius: 2px;
}

/* Menú colapsado en móvil */
.navbar-collapse {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.navbar-collapse.in,
.navbar-collapse.collapsing {
  background: linear-gradient(180deg, rgba(11, 61, 46, 0.98), rgba(31, 122, 90, 0.98));
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  margin-top: 4.6875rem; /* 75px */
  position: relative;
  overflow: hidden;
}

.hero img {
  width: 100%;
  object-fit: cover;
  min-height: 28.125rem; /* 450px */
}

.hero-overlay {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  color: var(--white);
  max-width: 31.25rem; /* 500px */
  animation: fadeInLeft 1s ease;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-2rem);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.hero-overlay h1 {
  font-size: 2.625rem; /* 42px */
  font-weight: var(--font-weight-extrabold);
  text-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.4);
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
}

.hero-overlay p {
  font-size: 1.125rem;
  margin-bottom: var(--spacing-lg);
  text-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3);
}

/* ============================================
   ALERTA INSTITUCIONAL - DESTACADA
   ============================================ */
.alerta {
  background: linear-gradient(135deg, #ff6b6b 0%, #ffd166 50%, #ff6b6b 100%);
  background-size: 200% 200%;
  padding: 1.75rem 0; /* Más grande */
  box-shadow: 0 0.5rem 2rem rgba(255, 107, 107, 0.4);
  animation: slideDown 0.5s ease, gradientShift 3s ease infinite;
  border-top: 4px solid #e63946;
  border-bottom: 4px solid #e63946;
  position: relative;
  overflow: hidden;
}

/* Efecto de brillo animado */
.alerta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  animation: shine 3s infinite;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.alerta-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  position: relative;
  z-index: 1;
}

.alerta-texto {
  font-weight: var(--font-weight-bold);
  font-size: 1.25rem; /* Más grande */
  flex: 1;
  min-width: 15rem;
  color: #1a1a1a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Icono de campana animado */
.alerta-texto .bell-icon {
  font-size: 1.75rem;
  display: inline-block;
  animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
  0%, 100% {
    transform: rotate(0deg);
  }
  10%, 30% {
    transform: rotate(-15deg);
  }
  20%, 40% {
    transform: rotate(15deg);
  }
  50% {
    transform: rotate(0deg);
  }
}

.btn-alerta {
  background: #e63946;
  color: var(--white);
  padding: 1rem 2.5rem; /* Más grande */
  border-radius: 3.125rem; /* 50px */
  text-decoration: none;
  font-weight: var(--font-weight-extrabold);
  transition: var(--transition-base);
  display: inline-block;
  white-space: nowrap;
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0.5rem 1.5rem rgba(230, 57, 70, 0.4);
  animation: buttonPulse 2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

@keyframes buttonPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0.5rem 1.5rem rgba(230, 57, 70, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0.75rem 2rem rgba(230, 57, 70, 0.6);
  }
}

.btn-alerta::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-alerta:hover::before {
  width: 300px;
  height: 300px;
}

.btn-alerta:hover,
.btn-alerta:focus {
  background: #d62828;
  color: var(--white);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0.75rem 2rem rgba(230, 57, 70, 0.6);
  text-decoration: none;
  animation: none;
}

.btn-alerta .btn-text {
  position: relative;
  z-index: 1;
}

/* ============================================
   SECCIONES
   ============================================ */
.section {
  padding: 5.625rem 0; /* 90px */
}

.section-soft {
  background: linear-gradient(180deg, #eef7f3 0%, #e3f3ec 100%);
}

.section-white {
  background: var(--white);
}

.section-title {
  text-align: center;
  margin-bottom: 3.75rem; /* 60px */
}

.section-title h2 {
  font-weight: var(--font-weight-extrabold);
  color: var(--text-dark);
  font-size: 2.25rem; /* 36px */
  margin-bottom: var(--spacing-sm);
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -0.625rem; /* -10px */
  left: 50%;
  transform: translateX(-50%);
  width: 4rem; /* 64px */
  height: 0.25rem; /* 4px */
  background: var(--green);
  border-radius: 0.125rem;
}

.section-title p {
  font-size: 1.125rem;
  color: #666;
  margin-top: var(--spacing-md);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--white);
  padding: 2.1875rem; /* 35px */
  border-radius: 1.125rem; /* 18px */
  text-align: center;
  box-shadow: 0 0.625rem 2.5rem var(--shadow-light);
  transition: var(--transition-base);
  margin-bottom: 1.5625rem; /* 25px */
  border: 1px solid transparent;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-0.625rem); /* -10px */
  box-shadow: 0 1.25rem 3rem rgba(31, 122, 90, 0.15);
  border-color: rgba(31, 122, 90, 0.1);
}

.card img {
  width: 4.375rem; /* 70px */
  margin: 0 auto 1.25rem; /* 0 auto 20px */
}

.card h3,
.card h4 {
  color: var(--text-dark);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-sm);
}

.card p {
  color: #666;
  font-size: 0.9375rem;
  margin-bottom: var(--spacing-md);
  flex-grow: 1;
}

.card-big img {
  width: 7.5rem; /* 120px */
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
  transition: var(--transition-base);
  font-weight: var(--font-weight-semibold);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--green);
  border: none;
  border-radius: 2.5rem; /* 40px */
  padding: 0.75rem 1.625rem; /* 12px 26px */
  color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #165a43;
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(31, 122, 90, 0.3);
  color: var(--white);
}

.btn-cta {
  background: var(--alert-yellow);
  border: none;
  border-radius: 2.5rem; /* 40px */
  padding: 0.875rem 2rem; /* 14px 32px */
  font-weight: var(--font-weight-bold);
  color: var(--text-dark);
}

.btn-cta:hover,
.btn-cta:focus {
  background: #ffbf3d;
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(255, 209, 102, 0.4);
  color: var(--text-dark);
  text-decoration: none;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--dark);
  color: var(--white);
  padding: 3.75rem 0; /* 60px */
}

footer h4 {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-md);
  color: var(--white);
}

footer p {
  margin-bottom: var(--spacing-xs);
  color: rgba(255, 255, 255, 0.9);
}

footer hr {
  border-color: rgba(255, 255, 255, 0.2);
  margin: var(--spacing-lg) 0;
}

.footer-logo-minimal {
  padding: 0.625rem; /* 10px */
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0.75rem; /* 12px */
  display: inline-block;
  transition: var(--transition-base);
}

.footer-logo-minimal:hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
}

.footer-logo-minimal img {
  max-width: 8.75rem; /* 140px */
}

.social {
  margin-top: var(--spacing-md);
}

.social a {
  color: var(--white);
  font-size: 1.375rem; /* 22px */
  margin: 0 0.625rem; /* 0 10px */
  transition: var(--transition-base);
  display: inline-block;
}

.social a:hover {
  color: var(--alert-yellow);
  transform: translateY(-3px) scale(1.2);
}

.copy {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin-top: var(--spacing-md);
}

/* ============================================
   BOTONES FLOTANTES
   ============================================ */

/* WhatsApp Flotante */
.whatsapp {
  position: fixed;
  right: 1.5625rem; /* 25px */
  bottom: 1.5625rem; /* 25px */
  background: var(--whatsapp-green);
  color: var(--white);
  width: 4.0625rem; /* 65px */
  height: 4.0625rem; /* 65px */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.875rem; /* 30px */
  box-shadow: 0 0.625rem 1.875rem var(--shadow-heavy);
  transition: var(--transition-base);
  z-index: 1000;
  animation: pulse 2s infinite;
}

.whatsapp:hover {
  background: #20ba5a;
  transform: scale(1.1);
  box-shadow: 0 1rem 2.5rem rgba(37, 211, 102, 0.4);
  color: var(--white);
}

/* PSE Flotante */
.pse-float {
  position: fixed;
  right: 1.5625rem; /* 25px */
  bottom: 6.875rem; /* 110px - debajo del WhatsApp */
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: var(--white);
  width: 4.0625rem; /* 65px */
  height: 4.0625rem; /* 65px */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem; /* 12px */
  font-weight: var(--font-weight-extrabold);
  box-shadow: 0 0.625rem 1.875rem rgba(30, 58, 138, 0.4);
  transition: var(--transition-base);
  z-index: 1000;
  animation: bounce 2s infinite;
  text-decoration: none;
  line-height: 1.2;
  text-align: center;
  padding: 0.5rem;
}

.pse-float:hover {
  background: linear-gradient(135deg, #1e40af 0%, #60a5fa 100%);
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 1rem 2.5rem rgba(59, 130, 246, 0.5);
  color: var(--white);
  text-decoration: none;
}

/* Variante con icono de tarjeta */
.pse-float .pse-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.125rem;
}

.pse-float .pse-text {
  font-size: 0.625rem;
  display: block;
  letter-spacing: 0.05em;
}

/* Tooltip para PSE */
.pse-float::before {
  content: 'Pagar con PSE';
  position: absolute;
  right: calc(100% + 1rem);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-base);
  font-weight: var(--font-weight-semibold);
}

.pse-float::after {
  content: '';
  position: absolute;
  right: calc(100% + 0.25rem);
  top: 50%;
  transform: translateY(-50%);
  border: 0.5rem solid transparent;
  border-left-color: rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-base);
}

.pse-float:hover::before,
.pse-float:hover::after {
  opacity: 1;
}

/* Animación de rebote */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Contenedor de botones flotantes (para organizarlos mejor) */
.floating-buttons {
  position: fixed;
  right: 1.5625rem;
  bottom: 1.5625rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

/* Badge de notificación (opcional) */
.float-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background: #ef4444;
  color: white;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: var(--font-weight-bold);
  border: 2px solid white;
  animation: pulse 1.5s infinite;
}

/* ============================================
   CAROUSEL MEJORAS
   ============================================ */
.carousel-control {
  opacity: 0.7;
  transition: var(--transition-base);
}

.carousel-control:hover {
  opacity: 1;
}

.carousel-indicators li {
  border-color: var(--white);
  transition: var(--transition-base);
}

.carousel-indicators .active {
  background-color: var(--green);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 991px) {
  .hero-overlay {
    left: 5%;
    max-width: 90%;
  }
  
  .hero-overlay h1 {
    font-size: 2rem;
  }
  
  .section {
    padding: 3.75rem 0; /* 60px */
  }
  
  .section-title h2 {
    font-size: 1.875rem; /* 30px */
  }
}

@media (max-width: 767px) {
  /* Navbar en móvil */
  .navbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  
  .navbar-toggle {
    display: block;
    margin-right: 0;
  }
  
  .navbar-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }
  
  .navbar-collapse.in {
    max-height: 500px;
    overflow-y: auto;
  }
  
  .navbar .nav > li > a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .navbar .nav > li:last-child > a {
    border-bottom: none;
  }
  
  .navbar .navbar-nav {
    margin: 0;
  }
  
  .navbar-brand {
    padding: 0.9375rem 0;
  }
  
  .hero-overlay {
    position: relative;
    left: 0;
    top: auto;
    transform: none;
    max-width: 100%;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
  }
  
  .hero-overlay h1 {
    font-size: 1.75rem;
  }
  
  .hero img {
    min-height: auto;
  }
  
  .alerta-flex {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }
  
  .alerta-texto {
    margin-bottom: 0;
    font-size: 1.125rem;
    flex-direction: column;
    text-align: center;
  }
  
  .alerta-texto .bell-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }
  
  .btn-alerta {
    width: 100%;
    max-width: 300px;
    padding: 1.25rem 2rem;
  }
  
  .section {
    padding: 2.5rem 0; /* 40px */
  }
  
  .section-title {
    margin-bottom: 2rem;
  }
  
  .card {
    margin-bottom: 1.25rem;
  }
  
  .whatsapp {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.5rem;
    right: 1rem;
    bottom: 1rem;
  }
  
  .pse-float {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 0.625rem;
    right: 1rem;
    bottom: 5.5rem;
  }
  
  .pse-float .pse-icon {
    font-size: 1.5rem;
  }
  
  .pse-float .pse-text {
    font-size: 0.5rem;
  }
  
  /* Ocultar tooltips en móvil */
  .pse-float::before,
  .pse-float::after {
    display: none;
  }
  
  .floating-buttons {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 480px) {
  :root {
    font-size: 14px;
  }
  
  .hero-overlay h1 {
    font-size: 1.5rem;
  }
  
  .section-title h2 {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 1.5rem;
  }
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.smooth-scroll {
  scroll-behavior: smooth;
}

/* Accesibilidad */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible para accesibilidad */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Mejora de rendimiento */
.card,
.btn,
.whatsapp,
.navbar .nav > li > a {
  will-change: transform;
}

/* Print styles */
@media print {
  .navbar,
  .whatsapp,
  .alerta,
  footer {
    display: none;
  }
  
  .hero {
    margin-top: 0;
  }
  
  body {
    background: white;
  }
}
