/* ═══════════════════════════════════════════════════════
   ESPERANZARTE MANUALIDADES — Estilos principales
   Mobile-first: base = mobile, min-width para desktop
═══════════════════════════════════════════════════════ */

/* ─── TOKENS ──────────────────────────────────────────── */
:root {
  /* Paleta cálida artesanal */
  --cream:       hsl(44, 43%, 91%);
  --cream-dark:  hsl(44, 30%, 84%);
  --burgundy:    hsl(0, 67%, 32%);
  --burgundy-lt: hsl(0, 55%, 42%);
  --burgundy-dim:hsl(0, 40%, 18%);
  --forest:      hsl(158, 45%, 11%);
  --forest-lt:   hsl(158, 30%, 18%);
  --ink:         hsl(158, 35%, 10%);

  /* Aliases semánticos */
  --bg:          var(--cream);
  --surface:     var(--cream-dark);
  --primary:     var(--ink);
  --accent:      var(--burgundy);
  --accent-lt:   var(--burgundy-lt);
  --muted-fg:    hsl(158, 15%, 38%);
  --border:      hsl(44, 20%, 78%);

  --wa:          #25D366;

  --font:        'Bree Serif', Georgia, serif;
  --radius:      1rem;
  --nav-h:       68px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--primary);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; object-fit: cover; }
button { cursor: pointer; font-family: var(--font); }


/* ══════════════════════════════════════════════════════
   NAV
══════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1.25rem;
  background: hsl(44, 50%, 93%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

.nav.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.nav-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
}

.nav-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-main {
  font-size: 1.15rem;
  color: var(--burgundy);
  letter-spacing: -0.3px;
}

.logo-sub {
  font-size: 0.68rem;
  color: var(--muted-fg);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--wa);
  color: #fff;
  border-radius: 3rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.nav-cta:active,
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,211,102,0.4);
}

.nav-cta svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-cta--rojo { background: var(--burgundy); }
.nav-cta--rojo:hover { box-shadow: 0 6px 20px rgba(120,20,40,0.35); }


/* ══════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════ */
.hero {
  min-height: 100svh;
  padding: calc(var(--nav-h) + 3rem) 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--cream);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 110%, hsl(0,40%,82%) 0%, transparent 65%),
    radial-gradient(ellipse 50% 35% at 90% 10%,  hsl(44,40%,84%) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: var(--burgundy);
  color: #fff;
  border: 1px solid hsla(0, 67%, 32%, 0.35);
  border-radius: 3rem;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 10vw, 5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--ink);
}

.hero h1 em {
  font-style: normal;
  color: var(--burgundy);
}

.hero-desc {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--muted-fg);
  margin-bottom: 2rem;
  max-width: 480px;
  line-height: 1.7;
  text-align: center;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

@media (min-width: 420px) {
  .hero-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}


/* ─── Botones globales ─────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--burgundy);
  color: var(--cream);
  border: none;
  border-radius: 0.75rem;
  padding: 1rem 1.75rem;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  width: 100%;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--burgundy);
  border-radius: 0.75rem;
  padding: 0.95rem 1.6rem;
  font-family: var(--font);
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
  width: 100%;
}

@media (min-width: 420px) {
  .btn-primary, .btn-ghost { width: auto; }
}

.btn-primary:hover, .btn-primary:active {
  background: var(--burgundy-lt);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px hsla(0, 67%, 32%, 0.3);
}

.btn-ghost:hover, .btn-ghost:active {
  background: var(--burgundy);
  color: var(--cream);
}


/* ══════════════════════════════════════════════════════
   TRUST BAR
══════════════════════════════════════════════════════ */
.trust-bar {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--burgundy);
  border-top: 1px solid var(--burgundy-lt);
  border-bottom: 1px solid var(--burgundy-lt);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid hsla(0, 55%, 50%, 0.3);
}

.trust-item:last-child { border-bottom: none; }

.trust-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
  color: var(--cream);
  width: 2.5rem;
  text-align: center;
  opacity: 0.9;
}

.trust-text strong {
  display: block;
  font-size: 1.05rem;
  color: var(--cream);
  margin-bottom: 0.15rem;
}

.trust-text span {
  font-size: 0.9rem;
  color: hsla(44, 43%, 91%, 0.7);
}

@media (min-width: 640px) {
  .trust-bar { grid-template-columns: repeat(3, 1fr); }
  .trust-item {
    border-bottom: none;
    border-right: 1px solid hsla(0, 55%, 50%, 0.3);
    padding: 2rem 1.75rem;
  }
  .trust-item:last-child { border-right: none; }
}


/* ══════════════════════════════════════════════════════
   SECTION SHARED
══════════════════════════════════════════════════════ */
.section {
  padding: 4rem 1.25rem;
}

@media (min-width: 768px)  { .section { padding: 5.5rem 2.5rem; } }
@media (min-width: 1200px) { .section { padding: 6rem 5rem; } }

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-block;
  color: var(--burgundy);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 0.6rem;
  color: var(--ink);
}

.section-header p {
  font-size: 1.05rem;
  color: var(--muted-fg);
  max-width: 480px;
  margin: 0 auto;
}


/* ══════════════════════════════════════════════════════
   CURSOS
══════════════════════════════════════════════════════ */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .courses-grid { gap: 1.25rem; }
}

@media (min-width: 900px) {
  .courses-grid { grid-template-columns: repeat(3, 1fr); }
  .course-card:nth-child(4) { grid-column: 1 / 2; justify-self: end; width: 100%; }
  .course-card:nth-child(5) { grid-column: 2 / 3; justify-self: start; width: 100%; }
}

.course-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.course-card:hover,
.course-card:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 20px 48px hsla(0, 67%, 32%, 0.15);
  border-color: var(--burgundy);
}

.course-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--burgundy-dim);
}

.course-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}

.course-card:hover .course-img-wrap img { transform: scale(1.05); }

.course-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(10,20,12,0.6));
  pointer-events: none;
}

/* badges */
.course-badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 3rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.course-badge--principiante {
  background: hsl(145, 50%, 35%);
  color: hsl(145, 40%, 95%);
}

.course-badge--avanzado {
  background: var(--burgundy);
  color: var(--cream);
}

/* placeholder sagrada familia */
.course-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, hsl(0,30%,22%), hsl(0,20%,14%));
  color: hsl(0, 40%, 75%);
}

.course-placeholder .ph-icon { font-size: 4rem; opacity: 0.5; }
.course-placeholder .ph-text {
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.45;
}

/* body card */
.course-body {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .course-body { padding: 1.25rem; gap: 1rem; }
}

.course-name {
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1.2;
}

@media (min-width: 640px) {
  .course-name { font-size: 1.5rem; }
}

.course-tagline {
  font-size: 0.8rem;
  color: var(--muted-fg);
  line-height: 1.5;
  margin-top: -0.25rem;
  flex: 1;
}

@media (min-width: 640px) {
  .course-tagline { font-size: 0.95rem; }
}

.btn-course {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: transparent;
  color: var(--burgundy);
  border: 2px solid var(--burgundy);
  border-radius: 0.65rem;
  padding: 0.6rem;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}

@media (min-width: 640px) {
  .btn-course { padding: 0.85rem; font-size: 1rem; }
}

.btn-course:hover,
.btn-course:active {
  background: var(--burgundy);
  color: var(--cream);
}


/* ══════════════════════════════════════════════════════
   CÓMO FUNCIONA  (fondo verde selva)
══════════════════════════════════════════════════════ */
.how-section {
  background: var(--forest);
  border-top: none;
  border-bottom: none;
}

.how-section .section-tag  { color: hsl(0, 55%, 65%); }
.how-section .section-header h2 { color: var(--cream); }
.how-section .section-header p  { color: hsla(44, 43%, 91%, 0.65); }

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-top: 0.5rem;
}

@media (min-width: 540px) { .steps { grid-template-columns: repeat(2, 1fr); gap: 2rem; } }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); } }

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.step-num {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--burgundy-dim);
  border: 2px solid var(--burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: hsl(0, 55%, 70%);
  flex-shrink: 0;
}

.step h3 { font-size: 1.15rem; color: var(--cream); }
.step p   { font-size: 0.95rem; color: hsla(44, 43%, 91%, 0.6); line-height: 1.6; }


/* ══════════════════════════════════════════════════════
   CTA FINAL  (también verde selva)
══════════════════════════════════════════════════════ */
.cta-section {
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--forest-lt);
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 70% at 50% 50%, hsla(0,40%,20%,0.4) 0%, transparent 70%);
  pointer-events: none;
}

.cta-section > * { position: relative; z-index: 1; }

.cta-section h2 {
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  margin-bottom: 0.75rem;
  line-height: 1.2;
  color: var(--cream);
}

.cta-section h2 em {
  font-style: normal;
  color: hsl(0, 60%, 65%);
}

.cta-section p {
  font-size: 1.1rem;
  color: hsla(44, 43%, 91%, 0.65);
  max-width: 460px;
  margin: 0 auto 2.25rem;
  line-height: 1.7;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--wa);
  color: #fff;
  border-radius: 0.85rem;
  padding: 1.1rem 2rem;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-whatsapp:hover,
.btn-whatsapp:active {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(37,211,102,0.4);
}

.btn-whatsapp svg { width: 24px; height: 24px; flex-shrink: 0; }


/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
footer {
  padding: 2rem 1.25rem;
  background: var(--ink);
  border-top: 1px solid hsla(158, 35%, 20%, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 768px) {
  footer { flex-direction: row; justify-content: space-between; padding: 2rem 2.5rem; }
}

.footer-logo { font-size: 1.1rem; color: hsl(0, 55%, 65%); }

.footer-links { display: flex; gap: 1.5rem; font-size: 0.9rem; color: hsla(44, 43%, 91%, 0.5); }
.footer-links a:hover { color: var(--cream); }

.footer-copy { font-size: 0.82rem; color: hsla(44, 43%, 91%, 0.35); }


/* ══════════════════════════════════════════════════════
   WHATSAPP FLOTANTE
══════════════════════════════════════════════════════ */
.wa-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  background: var(--wa);
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 28px rgba(37,211,102,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: wa-pulse 2.5s ease-in-out infinite;
}

.wa-float:hover,
.wa-float:active {
  transform: scale(1.12);
  box-shadow: 0 10px 36px rgba(37,211,102,0.65);
  animation: none;
}

.wa-float svg { width: 32px; height: 32px; }

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 6px 28px rgba(37,211,102,0.5); }
  50%       { box-shadow: 0 6px 44px rgba(37,211,102,0.8); }
}

@media (min-width: 768px) {
  .wa-float { width: 68px; height: 68px; bottom: 2rem; right: 2rem; }
  .wa-float svg { width: 36px; height: 36px; }
}

/* ── Mobile performance: deshabilitar efectos pesados ── */
@media (max-width: 767px) {
  .scroll-hint,
  .toast-actividad {
    display: none !important;
  }

  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

.nav-wa-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--burgundy);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s;
}
.nav-wa-link:hover { opacity: 0.75; }
.nav-wa-link svg { width: 20px; height: 20px; flex-shrink: 0; }
