/*
Theme Name: Coopebacen Emergencia
Theme URI: https://www.coopebacen.fi.cr
Author: Coopebacen
Description: Tema estatico de emergencia. Blindado contra plugins vulnerables.
Version: 1.0
Text Domain: coopebacen
*/

/* ==========================================================================
   Coopebacen R.L. - Manual de Marca Oficial Explicito
   Colores HEX Oficiales:
   - Verde Principal: #00AE4D (R:0 G:174 B:77)
   - Verde Lima: #B0D235 (R:176 G:210 B:53)
   - Amarillo: #FFDD00 (R:255 G:221 B:0)
   - Naranja: #FAA21B (R:250 G:162 B:27)
   - Gris Claro: #AFB1B4 (R:175 G:177 B:180)
   - Gris Medio/Oscuro: #77787B (R:119 G:120 B:123)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,600;0,700;0,800;1,600&family=Poppins:ital,wght@0,400;0,500;0,600;0,700;0,800;1,600;1,700&display=swap');

:root {
  /* Manual de Marca Oficial Coopebacen */
  --brand-green: #00AE4D;
  --brand-green-dark: #007A36;
  --brand-green-deep: #004D22;
  --brand-green-light: #E6F7ED;

  --lime-accent: #B0D235;
  --lime-accent-dark: #8BA921;

  --brand-yellow: #FFDD00;
  --brand-orange: #FAA21B;
  --brand-orange-hover: #E08B07;

  --gray-light: #AFB1B4;
  --gray-medium: #77787B;
  --gray-dark: #333333;
  --black: #1A1A1A;

  --bg-warm: #FAFAF7;
  --white: #FFFFFF;

  --font-heading: 'Poppins', 'Montserrat', system-ui, sans-serif;
  --font-sans: 'Poppins', 'Montserrat', system-ui, sans-serif;

  --shadow-sm: 0 4px 12px rgba(0, 174, 77, 0.08);
  --shadow-md: 0 10px 28px rgba(0, 122, 54, 0.12);
  --shadow-lg: 0 20px 48px rgba(0, 77, 34, 0.22);
  --shadow-orange: 0 8px 24px rgba(250, 162, 27, 0.5);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --max-width: 1240px;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--black);
  background-color: var(--bg-warm);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--brand-green);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--brand-yellow);
}

:focus-visible {
  outline: 3px solid var(--brand-yellow);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.5px;
}

a {
  color: var(--brand-green);
  text-decoration: none;
  transition: var(--transition);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* --------------------------------------------------------------------------
   Top Bar (Deep Green)
   -------------------------------------------------------------------------- */
.top-bar {
  background-color: var(--brand-green-deep);
  color: #D2E2D6;
  font-size: 0.825rem;
  font-family: var(--font-sans);
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-contacts {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.top-contact-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #D2E2D6;
  text-decoration: none;
  font-weight: 500;
}

.top-contact-item svg {
  color: var(--brand-yellow);
}

.top-contact-item:hover {
  color: var(--white);
}

/* --------------------------------------------------------------------------
   Site Header (Primary Brand Green #00AE4D)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--brand-green-dark);
  border-bottom: 3px solid var(--lime-accent);
  box-shadow: var(--shadow-md);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 95px;
}

.brand-logo img {
  height: 65px;
  width: auto;
}

/* NARANJA/AMARILLO CTA BUTTON 'Gestión en Línea' */
.btn-gold-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #FFDD00 0%, #FAA21B 100%);
  color: #120E02 !important;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.975rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-orange);
  transition: var(--transition);
  border: 1.5px solid #FFFFFF;
  letter-spacing: 0.2px;
}

.btn-gold-cta:hover {
  background: linear-gradient(135deg, #FFEE33 0%, #FFB02E 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(250, 162, 27, 0.65);
}

/* --------------------------------------------------------------------------
   HERO SECTION (VIBRANT BRAND GREEN GRADIENT)
   -------------------------------------------------------------------------- */
.hero-section {
  background: linear-gradient(135deg, #00AE4D 0%, #007A36 60%, #004D22 100%);
  color: var(--white);
  padding: 5rem 0 6.5rem 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(255, 221, 0, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--lime-accent);
  color: var(--brand-yellow);
  padding: 0.5rem 1.3rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
  letter-spacing: 0.5px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.3rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
  line-height: 1.15;
}

.hero-title span {
  color: var(--lime-accent);
  font-style: italic;
  font-weight: 700;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  color: #EAF7EF;
  line-height: 1.7;
  margin-bottom: 2.25rem;
  max-width: 580px;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   CONTACT CARDS SECTION
   -------------------------------------------------------------------------- */
.contact-section-simple {
  padding: 5rem 0;
  background: var(--white);
}

.section-tag {
  font-family: var(--font-heading);
  font-size: 0.825rem;
  font-weight: 800;
  color: var(--brand-green);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 0.5rem;
}

.contact-card-simple {
  background: var(--bg-warm);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  border: 1.5px solid var(--gray-light);
  text-align: center;
  transition: var(--transition);
}

.contact-card-simple:hover {
  transform: translateY(-4px);
  border-color: var(--brand-green);
  box-shadow: var(--shadow-md);
  background: var(--white);
}

.contact-card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-medium);
  margin-bottom: 0.6rem;
}

/* --------------------------------------------------------------------------
   FOOTER (Deep Brand Green #004D22 with Yellow Border)
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--brand-green-deep);
  color: #B5C9BC;
  padding: 4.5rem 0 2.5rem 0;
  border-top: 5px solid var(--brand-yellow);
}

.footer-brand-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-family: var(--font-sans);
}

.infocoop-badge {
  color: var(--brand-yellow);
  font-weight: 800;
}

/* Floating WhatsApp Widget */
.whatsapp-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
}

.whatsapp-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #25D366;
  color: var(--white) !important;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none !important;
  transition: var(--transition);
}

.whatsapp-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.6);
}

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.3rem; }
  .top-contacts { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

/* --------------------------------------------------------------------------
   Navigation Menu (Used in Sitio 1)
   -------------------------------------------------------------------------- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.8rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: #EAF7EF;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition);
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--brand-yellow);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: #B5C9BC;
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--lime-accent);
}

/* ==========================================================================
   Responsive Grids & Layout Classes (Fixes)
   ========================================================================== */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 95px;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem auto;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header-container { flex-direction: column; justify-content: center; }
  .brand-logo img { height: 50px !important; }
  .btn-gold-cta { width: 100%; justify-content: center; text-align: center; }
  .main-nav { flex-direction: column; width: 100%; gap: 1rem; }
  .nav-list { flex-direction: column; align-items: center; gap: 1rem; }

  .contact-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  
  .footer-top { flex-direction: column; text-align: center; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  
  .hero-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.3rem; }
  .hero-section { padding: 3rem 0; }
  .contact-section-simple { padding: 3rem 0; }
  .top-contacts { flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; }
  .top-bar .container { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2rem; }
  .brand-logo img { height: 40px !important; }
}

/* ==========================================================================
   KILL HORIZONTAL OVERFLOW GLOBALLY
   ========================================================================== */
html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
  width: 100% !important;
  position: relative;
}

* {
  box-sizing: border-box !important;
  max-width: 100%;
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

.hero-title, .contact-card-title, h1, h2, h3, p {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

@media (max-width: 768px) {
  .hero-section { overflow: hidden !important; width: 100% !important; }
  .btn-gold-cta { padding-left: 0.5rem; padding-right: 0.5rem; white-space: normal; height: auto; }
  .top-contacts { width: 100%; word-break: break-word; }
  .top-contact-item { width: 100%; justify-content: center; word-break: break-all; }
  .whatsapp-widget { right: 1rem; bottom: 1rem; max-width: calc(100% - 2rem); }
  .whatsapp-btn { padding: 0.75rem 1rem; white-space: normal; text-align: center; font-size: 0.85rem; }
}

/* ==========================================================================
   REDISENO: FONDOS BLANCOS Y TEXTOS OSCUROS
   ========================================================================== */
.site-header {
    background-color: var(--white) !important;
}
.hero-section {
    background: var(--bg-warm) !important;
}
.hero-section::before {
    display: none !important;
}
.hero-title {
    color: var(--brand-green-deep) !important;
}
.hero-title span {
    color: var(--brand-green) !important;
}
.hero-subtitle {
    color: var(--gray-medium) !important;
}
.hero-rating-pill {
    background: var(--white) !important;
    border: 1px solid var(--gray-light) !important;
    color: var(--gray-dark) !important;
}
.site-footer {
    background-color: var(--white) !important;
    color: var(--gray-medium) !important;
    border-top: 5px solid var(--brand-green) !important;
}
.footer-brand-title {
    color: var(--brand-green-deep) !important;
}
.footer-bottom {
    border-top: 1px solid var(--gray-light) !important;
    color: var(--gray-medium) !important;
}
.footer-links a {
    color: var(--gray-medium) !important;
}
.footer-links a:hover {
    color: var(--brand-green) !important;
}

.top-bar {
    background-color: var(--bg-warm) !important;
    border-bottom: 1px solid var(--gray-light) !important;
    color: var(--gray-dark) !important;
}
.top-contact-item {
    color: var(--gray-dark) !important;
}
.top-contact-item:hover {
    color: var(--brand-green) !important;
}

.top-bar {
    background-color: var(--brand-green-deep) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #D2E2D6 !important;
}
.top-contact-item {
    color: #D2E2D6 !important;
}
.top-contact-item:hover {
    color: var(--white) !important;
}


/* Alinear imagen al borde inferior de la seccion */
.hero-visual {
    display: flex;
    align-items: flex-end;
    height: 100%;
}
.hero-visual img {
    margin-bottom: -6.5rem !important; 
    position: relative;
    z-index: 10;
}
