/* ══════════════════════════════════════════════════════════════════════════
   CICLO DE PLAGAS — estilos específicos de la subpágina informativa
   Reutiliza tokens y utilidades de style.css (container, btn, fade-in, tema).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── HERO INFORMATIVO ─────────────────────────────────────────────────────── */
.cycle-hero {
    position: relative;
    padding: 96px 0 72px;
    background: linear-gradient(150deg, var(--navy-dark) 0%, #0E4229 100%);
    color: var(--white);
    overflow: hidden;
    text-align: center;
}
.cycle-hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 20% 10%, rgba(9,184,117,0.28) 0%, transparent 60%),
        radial-gradient(ellipse 50% 70% at 90% 90%, rgba(10,148,207,0.18) 0%, transparent 60%);
    animation: auroraDrift 16s ease-in-out infinite alternate;
    pointer-events: none;
}
.cycle-hero .container { position: relative; z-index: 1; }
.cycle-hero h1 {
    font-size: clamp(2rem, 4.6vw, 3.2rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -1px;
    margin: 14px auto 18px;
    max-width: 18ch;
}
.cycle-hero h1 .accent {
    background: linear-gradient(92deg, var(--emerald-lt), #5fe0a8, var(--green-eco));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cycle-hero p {
    color: rgba(255,255,255,0.86);
    font-size: 1.1rem;
    max-width: 60ch;
    margin: 0 auto;
    font-weight: 500;
}
.cycle-hero .eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Lexend', sans-serif;
    font-size: 0.78rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--emerald-lt);
    background: rgba(9,184,117,0.12);
    border: 1px solid rgba(9,184,117,0.25);
    padding: 6px 16px; border-radius: 20px;
}
.breadcrumb {
    margin-top: 28px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}
.breadcrumb a { color: var(--emerald-lt); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span[aria-current] { color: rgba(255,255,255,0.85); }

/* ── LEYENDA DE METAMORFOSIS ──────────────────────────────────────────────── */
.metamorph-legend {
    background: var(--bg-alt);
    border-bottom: 1px solid #DDE6EF;
    padding: 22px 0;
}
.legend-flex {
    display: flex; flex-wrap: wrap; gap: 12px 28px;
    justify-content: center; align-items: center;
}
.legend-item {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 0.9rem; font-weight: 600; color: var(--navy);
}
.legend-swatch {
    width: 26px; height: 26px; border-radius: 8px;
    display: grid; place-items: center; color: var(--white);
    flex-shrink: 0;
}
.legend-swatch.complete { background: var(--emerald); }
.legend-swatch.incomplete { background: var(--blue-tech); }

/* ── BLOQUE POR PLAGA ─────────────────────────────────────────────────────── */
.pest-block { padding: 84px 0; }
.pest-block:nth-of-type(even) { background: var(--white); }
.pest-block:nth-of-type(odd)  { background: var(--bg-light); }

.pest-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.pest-head .section-eyebrow { color: var(--emerald); }
.pest-head h2 {
    font-family: 'Lexend', sans-serif;
    color: var(--navy);
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 800; line-height: 1.15; letter-spacing: -0.5px;
    margin-bottom: 16px;
}
.pest-head p { color: var(--text-muted); line-height: 1.8; }

.pest-meta {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 10px; margin-top: 22px;
}
.pest-meta .chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--white);
    border: 1px solid #e2e8f0;
    color: var(--navy);
    font-size: 0.82rem; font-weight: 600;
    padding: 7px 14px; border-radius: 20px;
    box-shadow: var(--shadow-sm);
}
.pest-meta .chip i { color: var(--emerald); }

/* ── PISTA DE ETAPAS ──────────────────────────────────────────────────────── */
/* La CSP del sitio no permite atributos style en línea, por eso el número de
   columnas se fija con clases (.cols-3 / .cols-4), no con --stages inline. */
.stage-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
    max-width: 1120px; margin: 0 auto;
}
.stage-track.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stage-track.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stage-card {
    position: relative;
    background: var(--white);
    border: 1px solid #e6edf4;
    border-radius: var(--radius-lg);
    padding: 20px 18px 24px;
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
    transition: transform 0.35s var(--ease-out-soft), box-shadow 0.35s ease, border-color 0.35s ease;
}
.stage-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-float);
    border-color: rgba(6,129,83,0.4);
}
.stage-num {
    position: absolute; top: -14px; left: 20px;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--navy); color: var(--white);
    font-family: 'Lexend', sans-serif; font-weight: 800; font-size: 0.95rem;
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(17,42,70,0.3);
    transition: background 0.3s ease;
}
.stage-card:hover .stage-num { background: var(--emerald); }

.stage-svg {
    width: 100%; height: auto; display: block;
    border-radius: var(--radius-md);
    margin: 8px 0 16px;
    background: #f1f6fb;
}
.stage-svg svg { width: 100%; height: auto; display: block; }

.stage-name {
    font-family: 'Lexend', sans-serif;
    font-size: 1.08rem; font-weight: 700; color: var(--navy);
    margin-bottom: 4px;
}
.stage-tag {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--emerald); margin-bottom: 10px;
}
.stage-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* Flechas conectoras entre etapas (desktop) */
.stage-card:not(:last-child)::after {
    content: '';
    position: absolute; top: 50%; right: -20px;
    width: 20px; height: 2px;
    background: repeating-linear-gradient(90deg, var(--emerald) 0 6px, transparent 6px 10px);
    z-index: 2;
}
.stage-card:not(:last-child)::before {
    content: '';
    position: absolute; top: 50%; right: -24px;
    transform: translateY(-50%);
    border-left: 7px solid var(--emerald);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    z-index: 3;
}

/* Nota de cierre por plaga */
.pest-note {
    max-width: 900px; margin: 40px auto 0;
    display: flex; gap: 16px; align-items: flex-start;
    background: rgba(6,129,83,0.07);
    border-left: 4px solid var(--emerald);
    border-radius: var(--radius-md);
    padding: 18px 22px;
}
.pest-note i { color: var(--emerald); font-size: 1.3rem; margin-top: 2px; flex-shrink: 0; }
.pest-note p { color: var(--text-dark); font-size: 0.92rem; line-height: 1.7; }
.pest-note strong { color: var(--navy); }

/* ── CTA FINAL ────────────────────────────────────────────────────────────── */
.cycle-cta {
    padding: 80px 0;
    background: linear-gradient(150deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: var(--white); text-align: center;
}
.cycle-cta h2 {
    font-family: 'Lexend', sans-serif;
    font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800;
    margin-bottom: 14px; letter-spacing: -0.5px;
}
.cycle-cta p { color: rgba(255,255,255,0.82); max-width: 54ch; margin: 0 auto 30px; }
.cycle-cta .btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── TEMA OSCURO ──────────────────────────────────────────────────────────── */
[data-theme="dark"] .pest-block:nth-of-type(even) { background: var(--dk-surface-2); }
[data-theme="dark"] .pest-block:nth-of-type(odd)  { background: var(--dk-bg); }
[data-theme="dark"] .pest-head h2,
[data-theme="dark"] .stage-name { color: var(--dk-heading); }
[data-theme="dark"] .pest-head p,
[data-theme="dark"] .stage-desc { color: var(--dk-ink-muted); }
[data-theme="dark"] .stage-card {
    background: var(--dk-surface);
    border-color: var(--dk-border);
    box-shadow: var(--shadow-dark);
}
[data-theme="dark"] .stage-svg { background: var(--dk-elev); }
[data-theme="dark"] .stage-num { background: var(--dk-elev); }
[data-theme="dark"] .pest-meta .chip {
    background: var(--dk-elev); border-color: var(--dk-border); color: var(--dk-ink);
}
[data-theme="dark"] .metamorph-legend {
    background: var(--dk-surface-2); border-bottom-color: var(--dk-border);
}
[data-theme="dark"] .legend-item { color: var(--dk-ink); }
[data-theme="dark"] .pest-note {
    background: rgba(6,129,83,0.14);
}
[data-theme="dark"] .pest-note p { color: var(--dk-ink); }
[data-theme="dark"] .pest-note strong { color: var(--dk-heading); }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    /* Especificidad igual a .cols-3/.cols-4 para que estas reglas ganen */
    .stage-track.cols-3, .stage-track.cols-4 { grid-template-columns: repeat(2, 1fr); gap: 30px 20px; }
    /* En 2 columnas, las flechas horizontales confunden: las ocultamos */
    .stage-card::after, .stage-card::before { display: none; }
}
@media (max-width: 520px) {
    .stage-track.cols-3, .stage-track.cols-4 { grid-template-columns: 1fr; gap: 34px; }
    .pest-block { padding: 60px 0; }
    .cycle-hero { padding: 76px 0 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .cycle-hero::before { animation: none; }
    .stage-card:hover { transform: none; }
}
