/* =====================================================================
   Soil Desert Technologies · ajustes de diseño para celular
   Se carga después del <style> de cada página (index.html y asesoria.html)
   y corrige diagramación, tamaños táctiles, contraste y desbordes.
   ===================================================================== */

/* ---------- 1. Global (todas las pantallas) ---------- */

/* Nada puede generar scroll horizontal. */
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }

a, button { touch-action: manipulation; -webkit-tap-highlight-color: rgba(168, 214, 75, 0.15); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

/* La línea decorativa sobre el subtítulo del video medía 600 px fijos. */
.video-subtitle::before { width: min(600px, 70vw); }

/* Botones del bloque de contacto (antes eran estilos en línea). */
.cta-section .btn-primary-custom,
.cta-section .btn-outline-custom { font-size: 0.95rem; padding: 0.9rem 2.5rem; }
a.cta-contact-item { text-decoration: none; transition: color 0.2s ease; }
a.cta-contact-item:hover { color: var(--lime); }

/* Las tarjetas de servicio no son enlaces: sin cursor de mano. */
.service-card { cursor: default; }

/* Contraste de textos secundarios: antes 0.28–0.45 de opacidad (≈2,5:1),
   ahora ≥ 4,5:1 sobre los verdes del sitio (WCAG AA). */
.section-desc, .hero-subtitle, .product-info-text, .cta-text, .topic-description { color: rgba(255, 255, 255, 0.74); }
.benefit-text, .case-card-text, .tech-content p, .service-info p, .step-desc,
.testimonial-quote, .sub-topic-text, .key-point span, .pest-info-list li { color: rgba(255, 255, 255, 0.7); }
.stat-label, .case-stat-label, .testimonial-role, .pest-latin,
.footer-links a, .footer p, .social-icons a { color: rgba(255, 255, 255, 0.62); }
.cta-contact-item { color: rgba(255, 255, 255, 0.85); }

/* Íconos vectoriales en lugar de emoji (asesoria.html). */
.topic-icon-box { color: #fff; }
.topic-icon-box i { line-height: 1; }
.pest-emoji {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.25rem; background: rgba(168, 214, 75, 0.1); color: var(--lime);
}
#hongos .pest-emoji { background: rgba(192, 112, 112, 0.16); color: #ebb0b0; }
#insectos .pest-emoji { background: rgba(112, 192, 144, 0.16); color: #9be0b8; }

/* asesoria.html: las transiciones entre módulos eran franjas verde claro
   sobre secciones de fondo oscuro. Ahora el paso es continuo. */
.st-hero-to-poda { background: linear-gradient(180deg, var(--e4) 0%, var(--e1) 100%); }
.st-poda-to-poda-luz, .st-poda-luz-to-hongos, .st-hongos-to-insectos { display: none; }
.st-insectos-to-cta { background: linear-gradient(180deg, var(--e1) 0%, var(--e7) 100%); }

/* Texto "Frutales · Hortalizas · Zonas áridas" del pie (color en línea casi invisible). */
.footer .col-md-6 p.mt-3 { color: rgba(255, 255, 255, 0.5) !important; }

/* Botón flotante de WhatsApp: solo en celular (ver más abajo). */
.wsp-fab { display: none; }

/* En pantallas táctiles no hay "hover": sin saltos al tocar. */
@media (hover: none) {
    .benefit-card:hover, .case-card:hover, .tech-item:hover, .testimonial-card:hover,
    .service-card:hover, .topic-card:hover, .sub-topic-card:hover,
    .training-module:hover, .product-main-img:hover, .hero-product-img:hover { transform: none; box-shadow: none; }
    .case-card:hover .case-card-img { transform: none; }
    .process-step:hover .step-number, .topic-card:hover .topic-icon-box { transform: none; }
}

/* Quien pide menos movimiento en su teléfono, lo recibe. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important; scroll-behavior: auto !important;
    }
    #particles-container { display: none; }
    .fade-in { opacity: 1 !important; transform: none !important; }
}


/* ---------- 2. Celular (hasta 767 px) ---------- */
@media (max-width: 767.98px) {
    :root { --gutter: 20px; }

    section { padding: 3.25rem 0; }
    .seamless-transition { height: 36px; }
    .container { padding-left: var(--gutter); padding-right: var(--gutter); }
    .section-center { padding: 0 var(--gutter); }
    .section-label { font-size: 0.7rem; letter-spacing: 2px; margin-bottom: 0.75rem; }
    .section-title { font-size: 1.75rem; line-height: 1.2; }
    .section-desc { font-size: 1rem; line-height: 1.6; }

    /* Botones: mínimo 48 px de alto y texto legible. */
    .btn-primary-custom, .btn-outline-custom {
        min-height: 48px; justify-content: center; font-size: 0.95rem; padding: 0.8rem 1.5rem;
    }

    /* --- Barra de navegación --- */
    .navbar-custom { padding: 0.5rem 0; }
    .brand-logo-img { height: 34px; }
    .brand-sub { font-size: 0.62rem; }
    .navbar-toggler {
        width: 44px; height: 44px; padding: 0; border-radius: 12px;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .navbar-toggler:focus { box-shadow: 0 0 0 2px rgba(168, 214, 75, 0.45); }
    .navbar-collapse {
        margin: 0.5rem calc(-1 * var(--gutter)) 0; padding: 0.25rem var(--gutter) 1rem;
        border-top: 1px solid rgba(168, 214, 75, 0.08);
        max-height: calc(100vh - 64px); max-height: calc(100svh - 64px); overflow-y: auto;
    }
    .navbar-nav .nav-link-custom {
        font-size: 1rem; padding: 0.8rem 0.25rem !important;
        color: rgba(255, 255, 255, 0.85) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .nav-link-custom::after { display: none; }
    .navbar-nav .btn-nav-cta {
        display: block; text-align: center; margin-top: 0.9rem;
        font-size: 0.95rem; padding: 0.8rem 1rem !important;
    }

    /* --- Portada con video (index) --- */
    .video-intro-section { height: 72vh; height: 72svh; min-height: 440px; }
    .video-content { padding: 0 var(--gutter); }
    .video-logo { width: min(62vw, 240px); margin-bottom: 1rem; }
    .video-subtitle { font-size: 1rem; line-height: 1.5; letter-spacing: 1px; max-width: 320px; padding: 0; }

    /* --- Hero --- */
    .hero-section { min-height: auto; padding: 3rem 0 3.5rem; }
    #mainNav + .hero-section { padding-top: 104px; }          /* asesoria: debajo de la barra fija */
    .hero-glow { width: 280px; height: 280px; }
    .hero-content { padding: 0 var(--gutter); }
    .hero-badge { font-size: 0.68rem; letter-spacing: 1px; padding: 0.45rem 1rem; margin-bottom: 1.25rem; }
    .hero-title { font-size: 2rem; line-height: 1.15; }
    .hero-subtitle { font-size: 1rem; line-height: 1.6; margin-bottom: 1.75rem; }
    .hero-actions { flex-direction: column; align-items: stretch; gap: 0.75rem; max-width: 340px; margin: 0 auto; }
    .hero-product-img { display: none; }                       /* el envase aparece justo abajo */
    .hero-stats {
        display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 2.25rem;
        padding: 1rem 0.25rem; border-radius: 16px;
        background: rgba(20, 29, 18, 0.35); border: 1px solid rgba(168, 214, 75, 0.1);
    }
    .stat-item { min-width: 0; padding: 0 0.4rem; }
    .stat-item + .stat-item { border-left: 1px solid rgba(168, 214, 75, 0.1); }
    .stat-number { font-size: 1.6rem; }
    .stat-label { font-size: 0.75rem; letter-spacing: 0.2px; line-height: 1.3; margin-top: 6px; }

    /* --- Producto --- */
    .product-img-wrap { margin-bottom: 1.5rem; }
    .product-main-img { max-width: 230px; }
    .product-tagline { font-size: 0.8rem; line-height: 1.4; }
    .product-info-text { font-size: 1rem; line-height: 1.7; text-align: left; margin-bottom: 1.25rem; }
    .feature-list { margin-bottom: 1.75rem; }
    .feature-list li { font-size: 0.98rem; line-height: 1.5; padding: 0.5rem 0; color: rgba(255, 255, 255, 0.8); }
    .product-section .btn-primary-custom { width: 100%; max-width: 340px; }

    /* --- Tarjetas en filas más juntas --- */
    .benefits-section .row.g-4, .cases-section .row.g-4,
    .testimonials-section .row.g-4 { --bs-gutter-y: 0.9rem; }

    /* --- Beneficios: ícono a la izquierda, texto a la derecha --- */
    .benefit-card {
        display: grid; grid-template-columns: 52px 1fr; column-gap: 1rem; align-items: start;
        text-align: left; padding: 1.1rem 1.15rem; border-radius: 16px;
    }
    .benefit-icon { grid-row: span 2; width: 52px; height: 52px; margin: 0; font-size: 1.35rem; border-radius: 14px; }
    .benefit-title { font-size: 1.02rem; margin: 0.15rem 0 0.25rem; }
    .benefit-text { font-size: 0.92rem; line-height: 1.55; margin: 0; }

    /* --- Casos de éxito: cifras en una fila --- */
    .case-card { border-radius: 18px; }
    .case-card-img { height: 190px; }
    .case-card-body { padding: 1.15rem 1.15rem 1.25rem; }
    .case-card-title { font-size: 1.08rem; }
    .case-card-text { font-size: 0.92rem; }
    .case-card-stats {
        display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
        align-items: start; text-align: center;
    }
    .case-stat-val { font-size: 1.05rem; line-height: 1.2; }
    .case-stat-label { font-size: 0.72rem; letter-spacing: 0.2px; line-height: 1.3; margin-top: 4px; }

    /* --- Tecnología: número a la izquierda --- */
    .tech-item {
        flex-direction: row; align-items: flex-start; text-align: left;
        gap: 1rem; padding: 1.1rem 1.15rem; margin-bottom: 0.75rem;
    }
    .tech-content h5 { font-size: 1.02rem; }
    .tech-content p { font-size: 0.92rem; line-height: 1.55; }

    /* --- Testimonios --- */
    .testimonial-card { padding: 1.4rem 1.25rem; text-align: left; }
    .testimonial-stars { font-size: 0.85rem; }
    .testimonial-quote { font-size: 1rem; line-height: 1.6; }
    .testimonial-quote::before {
        position: static; display: block; height: 1.5rem; line-height: 1;
        font-size: 2.6rem; opacity: 0.35;
    }
    .testimonial-author { font-size: 0.95rem; }
    .testimonial-role { font-size: 0.8rem; }

    /* --- Asesoría (index) --- */
    .advisory-img { max-width: 100%; height: 220px; object-fit: cover; margin-bottom: 0.25rem; border-radius: 18px; }
    .service-card { padding: 1rem 1.1rem; gap: 0.9rem; margin-bottom: 0.75rem; align-items: flex-start; }
    .service-icon { width: 44px; height: 44px; font-size: 1.1rem; }
    .service-info h5 { font-size: 1rem; }
    .service-info p { font-size: 0.9rem; }
    .btn-asesoria { width: 100%; max-width: 340px; }

    /* --- Proceso: línea de tiempo vertical --- */
    .process-section .row > [class*="col-"] { width: 100%; }
    .process-step {
        display: grid; grid-template-columns: 48px 1fr; column-gap: 1rem;
        text-align: left; padding: 0 0 1.5rem;
    }
    .process-step::before {
        content: ''; position: absolute; left: 23px; top: 48px; bottom: 0; width: 2px;
        background: linear-gradient(var(--lime), rgba(168, 214, 75, 0.08));
    }
    .process-section .row > div:last-child .process-step { padding-bottom: 0; }
    .process-section .row > div:last-child .process-step::before { display: none; }
    .step-number { grid-row: span 2; width: 48px; height: 48px; font-size: 1rem; margin: 0; position: relative; z-index: 1; }
    .step-title { font-size: 1.05rem; margin: 0.65rem 0 0.25rem; }
    .step-desc { font-size: 0.92rem; margin: 0; }

    /* --- Contacto --- */
    .cta-title { font-size: 1.75rem; line-height: 1.2; }
    .cta-text { font-size: 1rem; line-height: 1.6; }
    .cta-section .d-flex { flex-direction: column; align-items: center; }
    .cta-section .btn-primary-custom,
    .cta-section .btn-outline-custom { width: 100%; max-width: 340px; padding: 0.9rem 1.5rem; }
    .cta-contact-info { flex-direction: column; align-items: stretch; gap: 0.5rem; max-width: 340px; margin: 2rem auto 0; }
    .cta-contact-item {
        justify-content: center; min-height: 44px; font-size: 0.95rem;
        padding: 0.6rem 1rem; border-radius: 12px;
        background: rgba(20, 29, 18, 0.25); border: 1px solid rgba(168, 214, 75, 0.12);
    }

    /* --- Pie de página: dos columnas, enlaces tocables --- */
    .footer { padding: 2.5rem 0 calc(88px + env(safe-area-inset-bottom)); }
    .footer-logo-container { padding: 0 0 1.75rem; }
    .footer .row.g-4 { --bs-gutter-y: 1.75rem; }
    .footer .row > .col-md-6 { text-align: left !important; }
    .footer .row > .col-md-6:nth-child(-n+2) { width: 50%; }
    .footer-links { display: block !important; margin: 0; }
    .footer-links li { margin: 0; }
    .footer-links a { display: inline-flex; align-items: center; min-height: 40px; font-size: 0.92rem; }
    .footer-links a:hover { padding-left: 0; }
    .footer h6 { margin-bottom: 0.5rem; }
    .social-icons { text-align: left !important; }
    .social-icons a { width: 44px; height: 44px; font-size: 1.05rem; margin-right: 8px; }
    .footer-bottom { margin-top: 2rem; }
    .footer-bottom p { font-size: 0.78rem; }

    /* --- Botón flotante de WhatsApp --- */
    .wsp-fab {
        display: flex; align-items: center; justify-content: center;
        position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
        width: 56px; height: 56px; border-radius: 50%; z-index: 1030;
        background: #128c7e; color: #fff; font-size: 1.7rem; text-decoration: none;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); transition: transform 0.15s ease;
    }
    .wsp-fab:active { transform: scale(0.94); }
    .wsp-fab:hover { color: #fff; }

    /* --- Asesoría: módulos de capacitación --- */
    .topic-section { padding: 2rem 0; }
    .topic-section .container { padding-left: 12px; padding-right: 12px; }
    .topic-card { border-radius: 20px; }
    .topic-image-area img { height: 200px; }
    .topic-header {
        flex-direction: row; flex-wrap: nowrap; align-items: center;
        gap: 0.9rem; padding: 1.25rem 1.15rem 0.85rem;
    }
    .topic-header-text { flex: 1; min-width: 0; }
    .topic-icon-box { width: 48px; height: 48px; font-size: 1.35rem; border-radius: 14px; }
    .topic-header-text h3 { font-size: 1.2rem; line-height: 1.3; margin-bottom: 0.4rem; }
    .topic-header-text h3 .topic-tag { vertical-align: middle; margin-left: 0.2rem; }
    .topic-tag { font-size: 0.72rem; padding: 0.25rem 0.7rem; }
    .pest-severity { font-size: 0.75rem; }
    .hero-badge, .case-card-tag { font-size: 0.72rem; }
    .topic-body { padding: 0 1.15rem 1.35rem; }
    .topic-description { font-size: 1rem; line-height: 1.7; margin-bottom: 1.35rem; }
    .sub-topics-grid { gap: 0.65rem; margin-bottom: 1.35rem; }
    .sub-topic-card { padding: 0.9rem 1rem; border-radius: 12px; }
    .sub-topic-header { gap: 0.65rem; margin-bottom: 0.4rem; }
    .sub-topic-icon { width: 32px; height: 32px; font-size: 0.9rem; border-radius: 9px; }
    .sub-topic-title { font-size: 0.98rem; line-height: 1.3; }
    .sub-topic-text { font-size: 0.9rem; line-height: 1.55; margin: 0; }
    .key-points { gap: 0.5rem; margin-bottom: 1.35rem; }
    .key-point { padding: 0.7rem 0.8rem; }
    .key-point span { font-size: 0.92rem; }
    .pest-detail-grid { gap: 0.75rem; margin-bottom: 1.35rem; }
    .pest-detail-card { padding: 1.1rem 1rem; border-radius: 14px; }
    .pest-detail-header { gap: 0.75rem; margin-bottom: 0.75rem; align-items: flex-start; }
    .pest-name { font-size: 1.02rem; line-height: 1.3; }
    .pest-latin { font-size: 0.8rem; }
    .pest-info-list li { font-size: 0.9rem; line-height: 1.5; }

    /* Galerías: fotos completas en dos columnas, leyenda legible debajo. */
    .topic-gallery-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; align-items: start; }
    .topic-gallery-item { min-width: 0; aspect-ratio: auto; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
    .topic-gallery-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .topic-gallery-placeholder {
        height: auto; gap: 0; justify-content: flex-start;
        border: 1px solid rgba(168, 214, 75, 0.12); border-radius: 12px; overflow: hidden;
    }
    .topic-gallery-item img { height: auto; max-height: 300px; object-fit: contain; }
    .topic-gallery-placeholder span {
        display: block; width: 100%; padding: 0.5rem 0.6rem; text-align: center;
        font-size: 0.72rem; line-height: 1.3; color: rgba(255, 255, 255, 0.78);
        background: rgba(20, 29, 18, 0.6);
    }
}

/* ---------- 3. Teléfonos chicos (hasta 380 px) ---------- */
@media (max-width: 380px) {
    :root { --gutter: 16px; }
    .hero-title { font-size: 1.75rem; }
    .section-title, .cta-title { font-size: 1.55rem; }
    .stat-number { font-size: 1.4rem; }
    .case-stat-val { font-size: 0.98rem; }
}
