/* ==========================================================================
   1. IMPORTACIONES Y VARIABLES GLOBALES (Temas Claro y Oscuro)
   ========================================================================== */

/* Importación de fuentes */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');
/* Se añade Raleway implícitamente porque el body final la requiere */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800&display=swap');

/* Tema Claro (Última versión priorizada) */
:root {
    --ionet-green: #0a9d65;
    --ionet-green-dark: #087f5b;
    --ionet-green-light: #e6fcf5;
    --bg-color: #ffffff;
    --text-color: #212529;
    --muted-color: #64748b;
    --card-bg: #ffffff;
    --surface-soft: #f6f9f8;
    --border-color: #e0e0e0;
    --trust-bg: #f8f9fa;
    --mega-hover: #f0fdf6;
    --shadow-premium: 0 18px 42px -24px rgba(8, 127, 91, 0.38);
}

/* Tema Oscuro (Última versión priorizada) */
[data-bs-theme="dark"] {
    --bg-color: #0d1114;
    --text-color: #f4f8f6;
    --muted-color: #a7b4bd;
    --card-bg: #151b20;
    --surface-soft: #10171a;
    --border-color: rgba(255, 255, 255, 0.11);
    --trust-bg: #0a0f12;
    --mega-hover: rgba(10, 157, 101, 0.12);
    --shadow-premium: 0 24px 55px -28px rgba(0, 0, 0, 0.8);
}

html {
    scroll-padding-top: 80px; /* Ponle unos pixeles más que tu padding-top del body */
    scroll-behavior: smooth; /* Para que baje de forma suave y elegante */
}

/* ==========================================================================
   2. ESTILOS BASE Y CONTENEDORES GLOBALES
   ========================================================================== */

/* Transición global para animaciones fluidas de tema */
* {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Base del cuerpo (Combinación priorizando la última versión) */
body {
    font-family: 'Raleway', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    padding-top: 50px; /* Espacio para el navbar fijo */
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Contenedor principal para centrar contenido */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Animaciones Reveal de Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

    .reveal.active {
        opacity: 1;
        transform: translateY(0);
    }


/* ==========================================================================
   3. BARRA DE NAVEGACIÓN Y MEGA MENÚ
   ========================================================================== */

/* Navbar principal */
.navbar-ionet {
    background: linear-gradient(135deg, var(--ionet-green-dark), var(--ionet-green)) !important;
    padding: 10px 0;
    box-shadow: 0 14px 38px rgba(5, 64, 46, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.navbar-shell {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 28px;
    gap: 18px;
}

.navbar-logo {
    height: 42px;
    width: auto;
}

.navbar-main-list {
    width: 100%;
    justify-content: flex-end;
    gap: 0.45rem;
}

.navbar-ionet .nav-link,
.navbar-ionet .navbar-brand {
    color: #ffffff !important;
    font-weight: 600;
    white-space: nowrap;
}

.navbar-ionet .nav-link {
    border-radius: 999px;
    padding: 0.55rem 0.72rem;
}

    .navbar-ionet .nav-link:hover {
        opacity: 1;
        background: rgba(255, 255, 255, 0.14);
    }

.navbar-search-item {
    width: clamp(220px, 22vw, 310px);
}

    .navbar-search-item .input-group {
        min-width: 0;
    }

    .navbar-search-item .form-control {
        min-width: 0;
        border: 0;
        background: rgba(255, 255, 255, 0.18);
        color: #ffffff;
    }

        .navbar-search-item .form-control::placeholder {
            color: rgba(255, 255, 255, 0.82);
        }

        .navbar-search-item .form-control:focus {
            background: #ffffff;
            color: #17211d;
            box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
        }

    .navbar-search-item .btn {
        border-color: rgba(255, 255, 255, 0.55);
    }

    .navbar-search-item .dropdown-menu {
        background-color: var(--card-bg);
        border: 1px solid var(--border-color) !important;
    }

.nav-cta-btn {
    color: var(--ionet-green) !important;
    box-shadow: 0 10px 22px rgba(5, 64, 46, 0.16);
    white-space: nowrap;
}

/* Botón cambio de tema */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 42px;
    min-height: 42px;
}

    .theme-toggle-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

/* Estilos de Mega Menú */
.dropdown-mega {
    position: static !important;
}

.dropdown-menu-mega {
    width: 100%;
    border: none;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-premium);
    background-color: var(--card-bg);
    margin-top: 0;
    padding: 1.8rem 0;
    border-top: 4px solid var(--ionet-green);
    transition: background-color 0.4s ease;
}

.mega-container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 32px;
}

.mega-title {
    color: var(--ionet-green);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.mega-link {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

    .mega-link i {
        font-size: 0.8rem;
        opacity: 0;
        transform: translateX(-5px);
        transition: all 0.2s ease;
    }

    .mega-link:hover {
        background-color: var(--mega-hover);
        color: var(--ionet-green);
    }

        .mega-link:hover i {
            opacity: 1;
            transform: translateX(0);
        }


/* ==========================================================================
   4. BANNERS Y CARROUSEL PRINCIPAL (Hero)
   ========================================================================== */

/* Banner Full-Width General */
.seccion-banner-principal {
    width: 100%;
}

.banner-carrusel {
    width: 100%;
    height: 400px;
}

    .banner-carrusel .swiper-slide {
        text-align: center;
        font-size: 18px;
        background: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
    }

        .banner-carrusel .swiper-slide img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    /* Navegación del Carrusel */
    .banner-carrusel .swiper-button-next,
    .banner-carrusel .swiper-button-prev {
        color: #0a9d65;
        --swiper-navigation-size: 30px;
    }

    .banner-carrusel .swiper-pagination-bullet-active {
        background: #0a9d65;
    }

/* Hero Carousel (Slider Principal) */
.carousel-item {
    height: 80vh;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.carousel-content {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    z-index: 2;
    color: #ffffff;
}

.hero-title {
    font-weight: 900;
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 25px;
}

    .hero-title span {
        color: var(--ionet-green);
    }

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    z-index: 3;
}

.carousel-indicators {
    z-index: 3;
    margin-bottom: 2rem;
}


/* ==========================================================================
   5. TARJETAS (CARDS)
   ========================================================================== */

/* Sección y Grid de Cards Clásicas */
.seccion-cards h1 {
    text-align: center;
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

#contenedor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Card Clásica */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s;
    border: 1px solid var(--border-color);
}

    .card:hover {
        transform: translateY(-5px);
    }

    .card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }

.card-body {
    padding: 15px;
}

    .card-body h3 {
        margin-top: 0;
        font-size: 1.25rem;
    }

    .card-body p {
        font-size: 0.9rem;
        opacity: 0.8;
    }

/* Solution Card (Premium) - Última versión priorizada */
.solution-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 40px;
    height: 100%;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 0 rgba(10, 157, 101, 0.06);
}

    .solution-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-premium);
        border-color: var(--ionet-green);
        z-index: 2;
        position: relative;
    }

.card-icon {
    font-size: 3rem;
    color: var(--ionet-green);
    margin-bottom: 20px;
    display: inline-block;
}

.card-icon.solution-card-logo {
    width: 4.25rem;
    height: 4.25rem;
    object-fit: contain;
    padding: .55rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 24px rgba(10, 157, 101, .12);
}

.m31-home-logo-panel {
    min-height: 320px;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    background:
        radial-gradient(circle at 25% 18%, rgba(10, 157, 101, .14), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, color-mix(in srgb, var(--ionet-green) 8%, #ffffff) 100%);
}

.m31-home-logo-img {
    width: min(190px, 52%);
    max-height: 190px;
    object-fit: contain;
    display: block;
}

@media (max-width: 576px) {
    .m31-home-logo-panel {
        min-height: 240px;
    }

    .m31-home-logo-img {
        width: min(155px, 58%);
        max-height: 155px;
    }
}


/* ==========================================================================
   6. DETALLES DE ARTÍCULO / PRODUCTO
   ========================================================================== */

.articulo-detalle {
    max-width: 900px;
    margin: 20px auto;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.articulo-banner-imagen {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.articulo-contenido {
    padding: 30px;
}

    .articulo-contenido h1 {
        margin-top: 0;
        color: var(--text-color);
    }

.articulo-imagen {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin: 20px 0;
}

.articulo-descripcion-larga {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
}


/* ==========================================================================
   7. COMPONENTES EXTRA, BOTONES Y FOOTER
   ========================================================================== */

/* Barra de Confianza (Partners/Marcas) */
.trust-bar {
    background-color: var(--trust-bg);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.4s ease;
}

    .trust-bar img {
        max-height: 40px;
        filter: grayscale(100%);
        opacity: 0.6;
        transition: all 0.3s ease;
    }

        .trust-bar img:hover {
            filter: grayscale(0%);
            opacity: 1;
        }

/* Secciones Adicionales */
.seccion-extra {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

    .seccion-extra h2 {
        color: var(--text-color);
        margin-bottom: 15px;
    }

/* Botones */
.boton-whatsapp {
    display: inline-block;
    background-color: #25D366;
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

    .boton-whatsapp:hover {
        background-color: #1DA851;
    }

.boton-volver {
    display: block;
    width: fit-content;
    margin: 20px auto 0;
    padding: 10px 20px;
    background-color: var(--ionet-green);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

    .boton-volver:hover {
        opacity: 0.8;
    }

/* Footer Links */
.footer-link-hover {
    color: var(--text-color);
    transition: all 0.3s ease;
}

    .footer-link-hover:hover {
        color: var(--ionet-green) !important;
        opacity: 1 !important;
        padding-left: 6px;
    }


/* ==========================================================================
   8. MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */

/* Pantallas grandes y Mega Menú */
@media (min-width: 992px) {
    .dropdown-mega:hover .dropdown-menu-mega {
        display: block;
    }

    .dropdown-menu-mega {
        position: absolute;
        left: 0;
        right: 0;
        width: 95%;
        max-width: 1380px;
        margin: 0 auto;
    }
}

@media (max-width: 1280px) and (min-width: 992px) {
    .navbar-shell {
        padding: 0 18px;
        gap: 12px;
    }

    .navbar-main-list {
        gap: 0.25rem;
    }

    .navbar-ionet .nav-link {
        padding-inline: 0.55rem;
        font-size: 0.94rem;
    }

    .navbar-search-item {
        width: 220px;
    }

    .nav-cta-btn {
        padding-inline: 1rem !important;
    }
}

/* Laptops y Tablets (hasta 992px) */
@media (max-width: 991px) {
    body {
        padding-top: 72px;
    }

    .navbar-shell {
        padding: 0 16px;
    }

    .navbar-main-list {
        align-items: stretch !important;
        gap: 0.5rem;
        padding: 1rem 0 0.25rem;
    }

    .navbar-ionet .nav-link {
        padding: 0.75rem 0.9rem;
    }

    .navbar-search-item {
        width: 100%;
    }

    .dropdown-menu-mega {
        padding: 1rem;
        border-radius: 0;
        border-top: none;
    }

    .mega-title {
        margin-top: 1.5rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .carousel-content {
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .theme-toggle-btn {
        justify-content: center;
        width: 100%;
    }

    .nav-cta-btn {
        width: 100%;
    }
}

/* Dispositivos Móviles (hasta 768px) */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .carousel-item {
        height: 70vh;
        min-height: 500px;
    }
}

.dropdown-item {
    color: var(--text-color);
}

    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: var(--mega-hover);
        color: var(--ionet-green);
    }
