/* ============================================================
   EcoCicle Products — Global Stylesheet
   ============================================================
   STRUCTURE:
   1. CSS Custom Properties (variables de diseño)
   2. Reset y base
   3. Layout: .container
   4. Header y navegación
   5. Dark Mode toggle pill
   6. Footer
   7. WhatsApp flotante
   8. Dark Mode overrides
   9. Responsive (media queries)
   ============================================================
   Para editar colores globales → cambia los valores en :root
   Para cambiar la fuente global → cambia font-family en body
   ============================================================ */


/* ─────────────────────────────────────────────
   1. CSS CUSTOM PROPERTIES
   ───────────────────────────────────────────── */
:root {
  --blue:    #0a2f66;
  --blue-2:  #0c2450;
  --blue-3:  #123d7c;
  --green:   #78b536;
  --green-2: #6eaf2e;
  --text:    #0e2348;
  --muted:   #587093;
  --bg:      #f4f7fb;
  --soft:    #edf2f8;
  --line:    #dbe5f1;
  --white:   #ffffff;
}


/* ─────────────────────────────────────────────
   2. RESET Y BASE
   ───────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}
img  { max-width: 100%; display: block; }
a    { text-decoration: none; color: inherit; }


/* ─────────────────────────────────────────────
   3. LAYOUT
   ───────────────────────────────────────────── */
.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}


/* ─────────────────────────────────────────────
   4. HEADER Y NAVEGACIÓN
   Estilo estandarizado (pill nav del catálogo).
   El script.js marca automáticamente .active
   en el enlace de la página actual.
   ───────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(10,47,102,.08);
  box-shadow: 0 10px 24px rgba(8,47,102,.04);
}

/* Fila principal del nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 90px;
}

/* Logo */
.brand img { width: 200px; height: auto; }

/* Contenedor pill del menú */
.menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 8px;
  background: rgba(10,47,102,.04);
  border: 1px solid rgba(10,47,102,.08);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(8,47,102,.06);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

/* Enlace normal y botón de dropdown */
.menu > a,
.menu-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
  color: #314a6c;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.menu > a:hover,
.menu-link:hover,
.menu > a.active,
.menu-link.active,
.dropdown.active > .menu-link {
  color: #fff;
  background: linear-gradient(180deg, #0b2f67, #071d45);
  box-shadow: 0 10px 20px rgba(10,47,102,.18);
  transform: translateY(-1px);
}

/* Dropdown wrapper */
.dropdown { position: relative; }
.caret    { font-size: 12px; opacity: .7; }

/* Panel desplegable */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 260px;
  padding: 10px;
  background: #fff;
  border: 1px solid rgba(10,47,102,.10);
  border-radius: 20px;
  box-shadow: 0 24px 44px rgba(8,47,102,.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
  z-index: 90;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: #304766;
  font-size: 14px;
  font-weight: 700;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.dropdown-menu a:hover {
  background: #f4f8fd;
  color: var(--blue);
  transform: translateX(2px);
}

/* Ancla del dark-mode pill (posicionamiento relativo) */
.dm-anchor { position: relative; display: inline-flex; }

/* Botón CTA verde del header */
.cta-btn {
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), #30c55a);
  color: #fff;
  box-shadow: 0 10px 24px rgba(120,181,54,.28);
  white-space: nowrap;
  font-size: 14px;
  transition: opacity .2s;
}
.cta-btn:hover { opacity: .88; }


/* ─────────────────────────────────────────────
   5. DARK MODE TOGGLE PILL
   El pill flota sobre el enlace "Contáctanos"
   ───────────────────────────────────────────── */
#dm-pill {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(10,47,102,.15);
  border-radius: 999px;
  padding: 4px 9px 4px 7px;
  box-shadow: 0 3px 12px rgba(10,47,102,.15);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 700;
  color: #2f4668;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background .25s, color .25s;
  z-index: 200;
}
#dm-pill .dm-track {
  position: relative;
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: #b8cde0;
  transition: background .25s;
  flex-shrink: 0;
}
#dm-pill .dm-track::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .25s;
}
#dm-pill.on .dm-track            { background: #1a3a6b; }
#dm-pill.on .dm-track::after     { transform: translateX(14px); }
#dm-pill.on {
  background: rgba(13,27,52,.93);
  color: #c5d8f0;
  border-color: rgba(255,255,255,.12);
}


/* ─────────────────────────────────────────────
   6. FOOTER
   ───────────────────────────────────────────── */
.footer {
  background: linear-gradient(180deg, #072759 0%, #051b40 100%);
  color: #fff;
  padding: 60px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.footer-brand img  { width: 260px; margin-bottom: 14px; }
.footer-brand p    { color: #d8e6ff; font-size: 18px; line-height: 1.6; max-width: 380px; }

/* Redes sociales */
.socials       { display: flex; gap: 12px; margin-top: 18px; }
.socials a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.socials a:hover { background: rgba(255,255,255,.16); }

/* Columnas del footer */
.footer-col h4 {
  margin: 0 0 18px;
  font-size: 18px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.footer-col a,
.footer-col div {
  display: block;
  color: #d8e6ff;
  margin: 0 0 14px;
  font-size: 17px;
}
.footer-col a:hover { color: #fff; }

/* Línea de copyright */
.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #c7d7f2;
  font-size: 15px;
  flex-wrap: wrap;
}
.footer-bottom .note::before {
  content: "•";
  color: #22d06f;
  margin-right: 8px;
  font-size: 24px;
  vertical-align: middle;
}


/* ─────────────────────────────────────────────
   7. WHATSAPP FLOTANTE
   ───────────────────────────────────────────── */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 60;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 38px rgba(0,0,0,.22);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: floaty 2.6s ease-in-out infinite;
}
.whatsapp-float img  { width: 68px; height: 68px; }
.whatsapp-float:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 24px 44px rgba(0,0,0,.28);
}
@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}


/* ─────────────────────────────────────────────
   8. DARK MODE OVERRIDES
   Para añadir reglas dark-mode a nuevas páginas,
   agregar al <style> de cada página con el prefijo
   "body.dark-mode .mi-clase { ... }"
   ───────────────────────────────────────────── */

/* Base */
body.dark-mode {
  background: #0d1b2e !important;
  color: #d8e6ff !important;
}

/* Header */
body.dark-mode .header {
  background: rgba(10,22,45,.97) !important;
  border-bottom-color: rgba(255,255,255,.07) !important;
}
body.dark-mode .menu {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.08) !important;
}
body.dark-mode .menu > a,
body.dark-mode .menu-link {
  color: #c5d8f0 !important;
}
body.dark-mode .dropdown-menu {
  background: rgba(13,27,52,.98) !important;
  border-color: rgba(255,255,255,.08) !important;
}
body.dark-mode .dropdown-menu a         { color: #b8d0ee !important; }
body.dark-mode .dropdown-menu a:hover   { background: rgba(255,255,255,.06) !important; color: #fff !important; }

/* Section tags */
body.dark-mode .section-tag {
  background: rgba(120,181,54,.12) !important;
  color: #9dcc55 !important;
}


/* ─────────────────────────────────────────────
   9. RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .container     { width: min(100% - 22px, 1180px); }
  .menu          { display: none; }          /* Ocultar nav en mobile */
  .nav           { min-height: 78px; }
  .brand img     { width: 170px; }
  .cta-btn       { padding: 12px 18px; font-size: 15px; }
  .whatsapp-float,
  .whatsapp-float img { width: 56px; height: 56px; }
  .footer-grid   { grid-template-columns: 1fr; }
}
