/* =========================================
   1. RESET Y CONFIGURACIÓN GLOBAL
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #fcfcfc;
    overflow-x: hidden;
}

/* =========================================
   2. HEADER: LOGO Y NAVBAR FLOTANTE
   ========================================= */
.external-logo {
    position: fixed;
    top: 15px;
    left: 3%;
    z-index: 1100;
    transition: all 0.4s ease;
}

.external-logo img {
    height: 160px;
    width: auto;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

.navbar {
    background: #dcbff6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 55px;
    left: 15%;
    right: 3%;
    height: 70px;
    padding: 0 40px;
    border-radius: 100px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    z-index: 1000;
    transition: all 0.4s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links li {
    position: relative;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a:hover {
    color: #4a148c;
}

.social-media {
    display: flex;
    gap: 20px;
}

.social-media a {
    color: white;
    font-size: 1.3rem;
    transition: 0.3s;
}

.social-media a:hover {
    color: #4a148c;
    transform: scale(1.1);
}

/* =========================================
   3. SECCIÓN: QUIÉNES SOMOS / QUÉ OFRECEMOS
   ========================================= */
.content-wrapper {
    padding-top: 240px; 
    padding-bottom: 50px;
}

.about-section {
    padding: 0 5%;
    margin-bottom: 80px;
}

.about-island {
    background: white;
    border-radius: 40px;
    padding: 80px 40px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.03);
    border: 1px solid #f0e6ff;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.badge {
    background: #f0e6ff;
    color: #c197f4ab;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 20px;
}

.about-island h2 {
    color: #4a148c;
    font-size: 2.2rem;
    margin-bottom: 25px;
}

.about-island p {
    color: #666;
    font-size: 1.3rem;
    line-height: 1.8;
}

.separator {
    border: none;
    border-top: 1px solid #f0e6ff;
    margin: 40px auto;
    width: 80%;
}

.offers-title {
    margin-bottom: 40px;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.offer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.offer-item p {
    font-size: 0.95rem;
    color: #555;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.icon-box {
    position: relative;
    background: #f0e6ff;
    width: 85px;
    height: 85px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.icon-box i {
    font-size: 2.5rem;
    color: #4a148c;
}

.icon-box::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: max-content;
    max-width: 250px;
    padding: 12px 18px;
    white-space: normal;
    word-wrap: break-word;
    background-color: #4a148c;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 999;
}

.icon-box::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-style: solid;
    border-color: #4a148c transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 999;
}

.icon-box:hover::after,
.icon-box:hover::before {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   4. MISIÓN Y VISIÓN
   ========================================= */
.mission-vision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 40px;
    margin-top: 20px;
    text-align: center; 
}

.mv-card {
    background: #fcfcfc; 
    padding: 40px;
    border-radius: 30px;
    border: 1px solid #f0e6ff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mv-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(74, 20, 140, 0.08);
}

.mv-icon {
    margin-bottom: 10px;
}

.mv-icon i {
    font-size: 2.5rem;
    color: #4a148c !important; 
}

.mv-card h3 {
    color: #4a148c !important; 
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}

.mv-card p {
    color: #555;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

/* =========================================
   5. FOOTER & CLIENTES
   ========================================= */
.footer-container {
    padding: 60px 3% 40px 3%;
}

.footer-island {
    background: white;
    border-radius: 50px;
    padding: 60px 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
    text-align: center;
    border: 2px solid #f0e6ff;
}

.footer-island h2 {
    color: #4a148c;
    text-transform: uppercase;
    margin-bottom: 50px;
    font-size: 1.8rem;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 40px;
    align-items: center;
    justify-items: center;
}

.clients-grid img {
    max-width: 120px;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: 0.4s;
}

.clients-grid img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.client-text-logo {
    display: flex;
    flex-direction: column;
    color: #888;
    border: 2px dashed #ddd;
    padding: 15px;
    border-radius: 15px;
}

.footer-bottom {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 40px;
    color: #aaa;
    font-size: 0.8rem;
}

/* =========================================
   6. SECCIÓN: PROYECTOS (SLIDER)
   ========================================= */
.projects-section {
    padding: 0 5%;
    margin-bottom: 80px;
}

.projects-island {
    background: white;
    border-radius: 40px;
    padding: 60px 40px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.03);
    border: 1px solid #f0e6ff;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.projects-island h2 {
    color: #4a148c;
    font-size: 2.2rem;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.slider-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth;
    gap: 30px;
    width: 90%; 
    padding: 10px 0 20px 0;
    scrollbar-width: none;  
}

.slider-track::-webkit-scrollbar {
    display: none; 
}

.slide {
    flex: 0 0 100%; 
    scroll-snap-align: center;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border: 3px solid #f0e6ff;
    background-color: #fcfcfc; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide img {
    width: 100%;
    height: 100%;
    max-height: 500px; 
    object-fit: contain; 
    background-color: white;
}

.placeholder-box {
    width: 100%;
    height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f9f6ff;
    color: #dcbff6;
    gap: 15px;
}

.placeholder-box i {
    font-size: 4rem;
    color: #dcbff6;
}

.placeholder-box span {
    font-size: 1.5rem;
    color: #4a148c;
    font-weight: bold;
    text-transform: uppercase;
}

.placeholder-box small {
    font-size: 0.9rem;
    color: #888;
    font-weight: normal;
}

.slider-btn {
    background: #4a148c;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    box-shadow: 0 5px 15px rgba(74, 20, 140, 0.3);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slider-btn:hover {
    background: #dcbff6;
    color: #4a148c;
    transform: translateY(-50%) scale(1.1); 
}

.prev-btn { left: -10px; }
.next-btn { right: -10px; }

/* =========================================
   7. MENÚS DESPLEGABLES (COMPUTADORA)
   ========================================= */
@media screen and (min-width: 851px) {
    .dropdown-menu {
        position: absolute;
        top: 150%; 
        left: 0;
        background: #f4e8ff; 
        min-width: 260px;
        border-radius: 15px;
        box-shadow: 0 15px 40px rgba(74, 20, 140, 0.25); 
        list-style: none !important;
        padding: 10px 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 2000;
        border: 2px solid #dcbff6; 
    }

    .dropdown-menu li {
        list-style: none !important;
    }

    .dropdown:hover > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        top: 120%; 
    }

    .dropdown-menu a {
        padding: 12px 20px;
        color: #4a148c; 
        font-weight: 700;
        text-transform: none; 
        font-size: 0.95rem;
        transition: all 0.2s ease;
        justify-content: space-between; 
    }

    .dropdown-menu a:hover {
        background: #4a148c; 
        color: #ffffff; 
        padding-left: 25px; 
    }

    .dropdown-submenu {
        position: relative;
    }

    .submenu {
        position: absolute;
        top: 10px; 
        left: 100%; 
        background: #f4e8ff; 
        min-width: 220px;
        border-radius: 15px;
        box-shadow: 0 15px 40px rgba(74, 20, 140, 0.25); 
        list-style: none !important;
        padding: 10px 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border: 2px solid #dcbff6;
        z-index: 2001;
    }

    .dropdown-submenu:hover > .submenu {
        opacity: 1;
        visibility: visible;
        top: -5px; 
    }
}

/* =========================================
   8. RESPONSIVE DESIGN (CELULARES) + PLAN B
   ========================================= */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: #4a148c;
    cursor: pointer;
}

@media screen and (max-width: 850px) {
    .navbar {
        left: 25%;
        right: 3%;
        padding: 0 20px;
        justify-content: flex-end;
    }

    .menu-toggle {
        display: block;
    }

    .external-logo {
        top: 15px;
        left: 3%;
    }
    
    .external-logo img {
        height: 70px;
    }

    .content-wrapper {
        padding-top: 140px;
    }

    /* Contenedor colapsable móvil */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        right: 0;
        width: 280px; /* Un poco más ancho para que quepa bien la lista */
        background: #fcfcfc;
        border-radius: 20px;
        box-shadow: 0 15px 40px rgba(74, 20, 140, 0.2);
        padding: 15px 0;
        border: 2px solid #dcbff6;
        gap: 0px;
        max-height: 80vh; /* Para que el menú no sea infinito */
        overflow-y: auto; /* Permite hacer scroll dentro del menú si es muy largo */
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: left;
        list-style: none !important;
    }

    .nav-links a {
        padding: 12px 20px;
        color: #4a148c;
        font-size: 0.95rem;
        width: 100%;
    }

    .social-media {
        display: none;
        justify-content: center;
        gap: 15px;
        padding: 15px;
        background: #f4e8ff;
        border-radius: 0 0 18px 18px;
    }

    .social-media.active {
        display: flex;
    }

    .social-media a {
        color: #4a148c;
    }

    /* Ajustes generales de relleno */
    .about-island, .projects-island, .footer-island {
        padding: 40px 20px; 
    }

    .mv-card {
        padding: 25px; 
    }
    
    .offers-grid {
        grid-template-columns: 1fr; 
    }

    /* ----------------------------------------------------
       PLAN B: SUBMENÚS SIEMPRE ABIERTOS Y ORDENADOS EN MÓVIL
       ---------------------------------------------------- */
    /* Forzamos a que las listas secundarias siempre estén visibles */
    .nav-links .dropdown-menu,
    .nav-links .submenu {
        display: block !important;
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding-left: 20px !important;
        margin-top: 0px !important;
        width: 100% !important;
    }

    /* Toque visual: Líneas laterales para distinguir jerarquía */
    .nav-links .dropdown-menu {
        border-left: 2px solid #dcbff6 !important;
        margin-left: 20px !important;
        width: calc(100% - 20px) !important;
    }

    .nav-links .submenu {
        border-left: 2px dashed #dcbff6 !important;
        margin-left: 20px !important;
        width: calc(100% - 20px) !important;
    }

    /* Ajustamos el tamaño de la letra para los submenús */
    .dropdown-menu a, .submenu a {
        font-size: 0.85rem !important;
        padding: 8px 15px !important;
        font-weight: normal !important;
    }

    /* Ocultamos las flechitas porque la lista ya está desplegada */
    .dropdown-toggle-btn i, 
    .submenu-toggle-btn i {
        display: none !important;
    }
}