/*
 * ============================================================
 * ECO-STEM — Diseño móvil y de la app
 * Archivo: mobile.css (se carga después de style.css)
 * Todo lo que está dentro de @media (max-width: 768px) solo
 * afecta a teléfonos; el diseño de escritorio no cambia.
 * ============================================================
 */

/* ── Elementos nuevos (todas las pantallas) ── */
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(7, 29, 37, 0.55);
  border: 1px solid rgba(72, 228, 178, 0.35);
  color: #b8ffcf;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-kicker::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48e4b2;
  box-shadow: 0 0 10px #48e4b2;
}

.hero-btn-outline {
  padding: 14px 28px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(7, 29, 37, 0.35);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.hero-btn-outline:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }
.hero-btn-outline:active { transform: scale(0.97); }

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}
.hero-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 29, 37, 0.55);
  color: #e4f1ec;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s, transform 0.15s;
}
.hero-feature:hover { border-color: rgba(72, 228, 178, 0.6); }
.hero-feature:active { transform: scale(0.97); }
.hero-feature svg { width: 24px; height: 24px; color: #48e4b2; }

.footer-column a { cursor: pointer; }

/* ── Pago seguro (sin datos de tarjeta) ── */
.secure-pay-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(72, 228, 178, 0.07);
  border: 1px solid rgba(72, 228, 178, 0.22);
  color: #d8e6ec;
  font-size: 14px;
  line-height: 1.5;
}
.secure-pay-app-note {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d8e6ec;
  font-size: 14px;
  line-height: 1.6;
}

/* ── IoT en modo demostración ── */
.iot-demo-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fde68a;
  font-size: 12px;
  font-weight: 700;
}

/* ── Privacidad y legal ── */
.legal-list { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
.legal-item {
  border-radius: 16px;
  border: 1px solid rgba(73, 156, 112, 0.22);
  background: linear-gradient(180deg, rgba(16, 53, 58, 0.88), rgba(7, 29, 37, 0.82));
  padding: 4px 18px;
}
.legal-item summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 0;
  font-weight: 700;
  color: #e4f1ec;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.legal-item summary::-webkit-details-marker { display: none; }
.legal-item summary::after { content: '+'; color: #48e4b2; font-size: 20px; line-height: 1; }
.legal-item[open] summary::after { content: '−'; }
.legal-item p, .legal-item ul { color: #b9cdd4; font-size: 14px; line-height: 1.65; padding-bottom: 14px; }
.legal-item ul { padding-left: 18px; display: grid; gap: 6px; }
.legal-item a { color: #48e4b2; text-decoration: underline; }
.legal-actions { text-align: center; margin-top: 22px; }
.legal-updated { margin-top: 10px; color: #8fb3a8; font-size: 12px; }
.delete-data-btn {
  margin-top: 12px;
  width: 100%;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.delete-data-btn:hover { background: rgba(239, 68, 68, 0.16); }

/* Barra de navegación inferior (la crea mobile.js; solo se ve en teléfonos) */
.bottom-nav { display: none; }
.swipe-hint { display: none; }

/* ════════════════════════════════════════
   TELÉFONO
════════════════════════════════════════ */
@media (max-width: 768px) {
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

  .container { padding: 0 18px; }

  /* ── Barra superior ── */
  .nav-container { height: 60px; padding: 0 16px; }
  .nav-logo { font-size: 1.05rem; }
  .nav-logo-img { height: 30px; width: auto; border-radius: 8px; }

  /* ── Portada ── */
  .hero {
    min-height: 0 !important;
    padding: 92px 0 40px !important;
  }
  .hero-content { width: 100%; padding: 0 20px; }
  /* Oscurece la foto para que el texto se lea bien y funde con la sección siguiente */
  .hero::after {
    background: linear-gradient(180deg,
      rgba(4, 14, 20, 0.45) 0%,
      rgba(4, 14, 20, 0.62) 55%,
      rgba(7, 29, 37, 0.96) 100%) !important;
    z-index: 1;
  }
  .hero-logo-wrapper {
    width: 124px !important;
    margin: 0 auto 18px !important;
    animation: heroLogoFloat 6s ease-in-out infinite;
  }
  .hero-logo-img { margin-top: 0 !important; width: 100% !important; height: 100% !important; }
  .hero-slogan {
    display: block;
    width: auto !important;
    margin: 0 auto 14px !important;
    white-space: normal;
    overflow: visible;
    border-right: 0;
    animation: none;
    font-size: 30px !important;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.01em !important;
    background: linear-gradient(100deg, #e6fff0 0%, #8ff5cf 50%, #a8ecff 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    text-shadow: none !important;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.7));
  }
  .hero-desc { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
  .hero-desc {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 auto 24px;
    color: #d8e6ec;
  }
  .hero-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }
  .hero-buttons .btn-primary,
  .hero-buttons .hero-btn-outline {
    width: 100%;
    padding: 15px 10px;
    font-size: 15px;
    border-radius: 14px;
  }
  .hero-feature { padding: 12px 6px; font-size: 12px; }
  .hero-feature svg { width: 22px; height: 22px; }

  /* ── Secciones: menos aire muerto, títulos más claros ── */
  .section { padding: 56px 0 !important; }
  .section-header { margin-bottom: 28px !important; }
  .section-header h2 { font-size: 28px !important; line-height: 1.2; }
  .section-header p { font-size: 15px !important; line-height: 1.6; }

  /* Tarjetas con bordes más suaves y separación uniforme */
  .plan-card, .about-card, .value-card, .team-card, .contact-item,
  .auth-card, .chat-container, .chart-card, .sensor-card {
    border-radius: 18px !important;
  }

  /* ── Planes: carrusel deslizable ── */
  .plans-grid {
    display: flex !important;
    gap: 14px;
    max-width: none !important;
    margin: 0 -18px !important;
    padding: 22px 18px 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 18px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .plans-grid::-webkit-scrollbar { display: none; }
  .plans-grid .plan-card {
    flex: 0 0 84%;
    scroll-snap-align: center;
    opacity: 1 !important;
    transform: none !important;
  }

  /* ── Equipo: carrusel deslizable ── */
  .team-grid {
    display: flex !important;
    gap: 14px;
    margin: 0 -18px;
    padding: 4px 18px 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .team-grid::-webkit-scrollbar { display: none; }
  .team-grid .team-card { flex: 0 0 82%; scroll-snap-align: center; }

  .swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    color: #8fb3a8;
    font-size: 12px;
    font-weight: 600;
  }

  /* ── Pie de página compacto ── */
  .footer { padding-top: 40px !important; }
  .footer-container { width: 100% !important; padding: 0 20px 24px !important; }
  .footer-top {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 22px 12px !important;
    margin-bottom: 28px !important;
  }
  .footer-brand { grid-column: 1 / -1; max-width: none; text-align: center; }
  .footer-logo { justify-content: center; }
  .footer-socials { justify-content: center; }
  .footer-column h3 { font-size: 14px; margin-bottom: 10px; }
  .footer-column a { font-size: 13px; margin-bottom: 10px; }
  .footer-newsletter { padding: 18px; border-radius: 18px; }
  .newsletter-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
  .newsletter-form input, .newsletter-form button { width: 100%; }
  .footer-bottom { justify-content: center; text-align: center; font-size: 12px; }

  /* ── Barra de navegación inferior ── */
  .bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 1100;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px;
    border-radius: 22px;
    background: rgba(7, 29, 37, 0.92);
    border: 1px solid rgba(73, 156, 112, 0.28);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 2px 7px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #8fb3a8;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
  }
  .bottom-nav button svg { width: 22px; height: 22px; }
  .bottom-nav button.active {
    color: #48e4b2;
    background: rgba(72, 228, 178, 0.12);
  }
  .bottom-nav button:active { transform: scale(0.95); }

  /* Que el menú de hamburguesa no quede debajo de la barra inferior */
  .nav-links.open { max-height: calc(100vh - 160px); overflow-y: auto; }

  /* ── Aviso de términos: hoja inferior con el botón siempre visible ── */
  .cookie-consent-overlay {
    padding: 12px !important;
    align-items: flex-end !important;
    justify-content: center !important;
    z-index: 2200 !important;
  }
  .cookie-banner {
    width: 100% !important;
    max-height: calc(100vh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    padding: 18px 16px 16px !important;
    border-radius: 24px !important;
  }
  .cookie-banner > * { flex-shrink: 0; }
  .cookie-banner .cookie-terms-card {
    flex: 1 1 auto;
    min-height: 90px;
    max-height: none;
    margin-bottom: 12px;
  }
  .cookie-header { flex-direction: row !important; align-items: center !important; margin-bottom: 6px !important; }
  .cookie-header h3 { font-size: 21px !important; line-height: 1.2; }
  .cookie-eyebrow { margin-bottom: 6px; }
  .cookie-required { display: none; }
  .cookie-intro { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
  .cookie-check { padding: 12px 14px; margin-bottom: 8px; font-size: 14px; }
  .cookie-warning { margin-bottom: 10px !important; font-size: 12px; }
  .cookie-actions { flex-direction: column-reverse !important; gap: 8px !important; }
  .cookie-actions .btn-primary, .cookie-actions .btn-outline { width: 100%; min-width: 0; }
  .cookie-footer-note { display: none; }
}

/* Teléfonos pequeños */
@media (max-width: 360px) {
  .hero-slogan { font-size: 26px !important; }
  .hero-feature span { font-size: 11px; }
  .bottom-nav button { font-size: 10px; }
}

/* ============================================================
 * PORTADA: foto del parque con movimiento suave y menos elementos
 * ============================================================ */
.hero { background: #06222a; }
.hero-bg-photo {
  position: absolute;
  inset: -6%;
  z-index: 0;
  background: url('assets/hero-parque.jpg') center 42% / cover no-repeat;
  filter: saturate(0.9) brightness(0.92);
  transform-origin: 50% 45%;
  animation: heroKenBurns 32s ease-in-out infinite alternate;
  will-change: transform;
  pointer-events: none;
}
@keyframes heroKenBurns {
  0%   { transform: scale(1.02) translate3d(0, 0, 0); }
  50%  { transform: scale(1.10) translate3d(-2.5%, -1%, 0); }
  100% { transform: scale(1.16) translate3d(2%, 1.5%, 0); }
}
/* Velo oscuro para que el texto se lea sobre la foto */
.hero::before {
  z-index: 1 !important;
  background: radial-gradient(ellipse at 50% 48%, rgba(4, 18, 24, 0.42) 0%, rgba(4, 18, 24, 0) 70%) !important;
}
.hero::after {
  z-index: 1 !important;
  background: linear-gradient(180deg,
    rgba(4, 18, 24, 0.55) 0%,
    rgba(4, 18, 24, 0.30) 38%,
    rgba(4, 18, 24, 0.50) 72%,
    rgba(7, 29, 37, 1) 100%) !important;
}
.hero-content { z-index: 10; }
@media (prefers-reduced-motion: reduce) {
  .hero-bg-photo { animation: none; transform: scale(1.04); }
}

@media (max-width: 768px) {
  .hero {
    min-height: 100vh !important;
    min-height: 100svh !important;
    padding: 72px 0 112px !important;
    align-items: center !important;
  }
  .hero-logo-wrapper {
    width: 88px !important;
    margin: 0 auto 22px !important;
  }
  .hero-slogan { font-size: 34px !important; margin-bottom: 34px !important; }
  .hero-buttons {
    grid-template-columns: 1fr !important;
    max-width: 300px;
    margin: 0 auto !important;
    gap: 12px !important;
  }
}
@media (max-width: 360px) {
  .hero-slogan { font-size: 27px !important; }
}

/* ── Suscripción dentro de la app (Google Play / App Store) ── */
.store-price-line {
  margin: 4px 0 14px;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: #8ff5cf;
}
.store-link-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 0;
  background: none;
  color: #9fe9d0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.store-legal {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(216, 230, 236, 0.62);
  text-align: center;
}
.store-manage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 8px;
}
.store-manage .store-link-btn { width: auto; margin-top: 0; }

/* ── Flecha "ver más" al pie de la portada ── */
.hero-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(7, 29, 37, 0.35);
  color: #eafff6;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: heroHintBounce 2.4s ease-in-out infinite;
}
.hero-scroll-hint svg { width: 22px; height: 22px; display: block; margin: auto; }
@keyframes heroHintBounce {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(7px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .hero-scroll-hint { animation: none; } }

/* ── Qué es Eco-STEM (justo debajo de la portada) ── */
.intro-section {
  background: #071d25;
  padding-top: 24px !important;
}
.intro-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.intro-text {
  margin: 4px auto 26px;
  font-size: 17px;
  line-height: 1.75;
  color: #d8e6ec;
}
@media (max-width: 768px) {
  .hero-scroll-hint { bottom: 100px; } /* encima de la barra inferior */
  .intro-section { padding: 20px 0 48px !important; }
  .intro-text { font-size: 15.5px; line-height: 1.7; }
}
#intro { scroll-margin-top: 64px; }

/* ── Panel IoT: clima real + consejo de la IA ── */
.iot-demo-badge.iot-live {
  background: rgba(0, 229, 176, 0.14);
  border-color: rgba(0, 229, 176, 0.45);
  color: #8ff5cf;
}
.iot-ai-status {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}
.iot-ai-good { background: rgba(0, 229, 176, 0.15); color: #00e5b0; }
.iot-ai-attention { background: rgba(250, 204, 21, 0.15); color: #facc15; }
.iot-ai-alert { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.iot-ai-headline { font-weight: 700; color: #e6fff0; margin: 6px 0; }
.iot-ai-water { color: #a8ecff; margin: 8px 0; }
.iot-ai-loading { color: rgba(216, 230, 236, 0.75); font-style: italic; }

/* ── App web instalada en iPhone (pantalla completa, con muesca) ── */
.navbar { padding-top: env(safe-area-inset-top); }
@media (max-width: 768px) {
  .hero { padding-top: calc(72px + env(safe-area-inset-top)) !important; }
}
#intro { scroll-margin-top: calc(64px + env(safe-area-inset-top)); }

/* ── Aviso "Agregar a inicio" (iPhone, Safari) ── */
.install-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(10, 41, 48, 0.97);
  border: 1px solid rgba(72, 228, 178, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  color: #e6f4f0;
  font-size: 13.5px;
  line-height: 1.45;
  animation: installHintIn 0.35s ease-out;
}
.install-hint img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install-hint p { margin: 0; flex: 1; }
.install-hint p strong:first-child { display: block; font-size: 14.5px; color: #fff; }
.install-share { display: inline-flex; vertical-align: -3px; color: #5ab8ff; }
.install-share svg { width: 18px; height: 18px; }
.install-hint button {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #cfe3dd;
  cursor: pointer;
}
@keyframes installHintIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Respuestas del asistente con pasos en líneas separadas */
.ai-bubble p { white-space: pre-line; }
