@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* Agrega esto para que los saltos entre secciones sean suaves */
html {
    scroll-behavior: smooth;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', serif;
    background-color: #000;
}

/* =========================================
   HEADER (Navegación Flotante)
========================================= */
/* HEADER INICIAL (Transparente arriba) */
.main-header {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999; 
    background-color: transparent; 
    box-shadow: none; 
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

/* HEADER AL HACER SCROLL */
.main-header.scrolled {
    background-color: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

nav {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 60px;
    max-width: 1400px; 
    margin: 0 auto; 
}

.logo a { display: flex; }
.logo img { height: 50px; width: auto; object-fit: contain; }

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    justify-content: center; 
    gap: 25px; 
}

/* --- TRUCO PARA ÍCONOS BLANCOS --- */
.force-white {
    filter: brightness(0) invert(1);
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 10px;
    padding-bottom: 5px; 
    transition: color 0.3s ease; 
}

.nav-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    transition: filter 0.3s ease;
}

.nav-links a:hover { color: #cc9900; }
.nav-links a:hover .nav-icon {
    filter: invert(65%) sepia(82%) saturate(738%) hue-rotate(9deg) brightness(96%) contrast(105%);
}

/* =========================================
   BOTÓN CONTÁCTENOS 
========================================= */
.nav-links a.btn-contact {
    background-color: #2b4970;
    padding: 12px 24px !important; 
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    justify-content: center; 
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-links a.btn-contact:hover {
    background-color: #1f3755; 
    color: #cc9900 !important; 
    cursor: pointer; 
}

/* =========================================
   MENÚ HAMBURGUESA (oculto en escritorio)
========================================= */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Anima las 3 barras para que formen una X cuando el menú está abierto */
.menu-toggle.active .bar:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.menu-toggle.active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.active .bar:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* =========================================
   CARRUSEL (Estructura principal)
========================================= */
.carousel-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* alto real en móviles, sin saltos por la barra del navegador */
    overflow: hidden; 
}

.carousel-track {
    display: flex; 
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease-in-out; 
}

.carousel-slide {
    min-width: 100%; 
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 60px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-hero { background-image: url('img/imagenesprincipales/MUNDO-CESVI\ 50.webp'); }
.bg-maquinaria { background-image: url('img/imagenesprincipales/2\ 1280x720\ fondo\ negro.webp'); }
.bg-inventario { background-image: url('img/imagenesprincipales/3\ 1280x720\ fondo\ negro.webp'); }

/* Contenido dentro de los slides */
.feature-content {
    max-width: 900px;
    color: #ffffff;
    margin-top: auto;
    margin-bottom: 80px; 
}

.feature-content h1, 
.feature-content h2 {
    font-size: 3.5rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    font-style: italic;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: #e2e8f0;
    text-transform: uppercase;
}

.description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #f8fafc;
}

/* Botones Carrusel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 15px 20px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.carousel-btn:hover { background-color: rgba(0, 0, 0, 0.8); }
.prev { left: 20px; }
.next { right: 20px; }

/* =========================================
   SECCIÓN NUESTROS SERVICIOS 
========================================= */
.services-section {
    background-color: #f1f1f1; 
    padding: 80px 60px;
    font-family: 'Poppins', sans-serif;
}

.services-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    gap: 50px;
    align-items: center;
}

.services-content {
    flex: 1;
}

/* Wrapper nuevo para alinear icono y texto */
.services-title-wrapper {
    display: flex;
    align-items: center; 
    gap: 15px; 
    margin-bottom: 10px; 
}

.services-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: #0d2345; 
    margin-bottom: 0; /* Ahora el wrapper controla el margen */
    transition: color 0.3s ease; /* Agrega esto para que el cambio no sea de golpe */
}

.services-title:hover {
    color: #cc9900; /* Color al pasar el cursor */
}

.services-title:active {
    color: #a67c00; /* Color ligeramente más oscuro al hacer clic */
}




/* Estilo para el icono del título */
.services-main-icon {
    height: 45px; 
    width: auto;
    object-fit: contain;
}

.services-title-line {
    width: 100%;
    max-width: 380px; 
    height: 3px;
    background-color: #000000;
    margin-bottom: 35px;
}

.services-list {
    list-style: none;
    padding: 0;
}

.services-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 25px;
    font-size: 1rem;
    color: #333333;
    line-height: 1.6;
}

.services-list li::before {
    content: '•';
    color: #0d2345;
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.5rem;
    top: -5px;
}

.services-list strong {
    color: #0d2345;
    font-weight: 700;
}

.services-images {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    position: relative;
    padding: 20px;
}

.services-images::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 153, 0, 0.15); 
    border-radius: 12px;
    z-index: 0;
}

.services-images img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 4px;
    z-index: 1;
    position: relative;
    border: 3px solid #CF8800; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* =========================================
   SECCIÓN INVENTARIO 
========================================= */
.inventory-section {
    background-color: #f1f1f1; 
    padding: 80px 60px;
    font-family: 'Poppins', sans-serif; 
}

.section-title {
    display: flex;
    justify-content: center; 
    align-items: center;
    gap: 15px;
    margin-bottom: 60px;
    cursor: pointer; 
}

.section-title h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 800; 
    color: #000000;
    transition: color 0.3s ease; 
}

.title-icon {
    width: 45px;
    height: auto;
    object-fit: contain;
    transition: filter 0.3s ease; 
}

.section-title:hover h2 { color: #cc9900; }
.section-title:hover .title-icon {
    filter: invert(65%) sepia(82%) saturate(738%) hue-rotate(9deg) brightness(96%) contrast(105%);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 60px 40px; 
    max-width: 1200px; 
    margin: 0 auto; 
}

.inventory-item {
    display: flex; 
    gap: 20px;
    align-items: stretch; /* antes: flex-start. Con "stretch" ambas columnas toman la misma altura */
}

.item-img {
    flex: 0 0 280px; 
    position: relative; 
    border-radius: 8px;
    overflow: hidden; 
}

.item-img img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block; 
}

.whatsapp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); 
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; 
    transition: opacity 0.3s ease;
}

.inventory-item:hover .whatsapp-overlay {
    opacity: 1;
}

.btn-whatsapp {
    background-color: #25D366; 
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.inventory-item:hover .btn-whatsapp {
    transform: translateY(0);
}

.btn-whatsapp:hover {
    background-color: #1ebe57; 
}

.item-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* centra el contenido verticalmente en toda la altura disponible */
}
.item-text h3 {
    color: #cf8800; 
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

/* --- DESCRIPCIÓN OCULTA POR DEFECTO, VISIBLE AL HACER HOVER --- */
.item-text p {
    color: #111111;
    font-size: 0.95rem;
    line-height: 1.6;

    max-height: 0;      /* la "aplasta" para que no ocupe espacio */
    opacity: 0;          /* la hace invisible */
    overflow: hidden;    /* recorta lo que se sale mientras está en 0 */
    margin-top: 0;

    transition: max-height 0.4s ease, opacity 0.3s ease 0.05s, margin-top 0.3s ease;
}

.inventory-item:hover .item-text p {
    max-height: 300px;   /* suficiente alto para que quepa el texto completo */
    opacity: 1;
    margin-top: 10px;
}

.services-images {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    position: relative;
    padding: 20px;
}

/* =========================================
   FOOTER (NUEVA SECCIÓN DE CONTACTO)
========================================= */
.main-footer {
    background-color: #e9ecef; 
    padding: 80px 60px 20px;
    font-family: 'Poppins', sans-serif;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 60px;
}

.footer-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.footer-title-wrapper h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #000000;
}

.footer-title-icon {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.footer-details {
    display: flex;
    justify-content: space-around;
    width: 100%;
    gap: 20px;
}

.detail-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.detail-block h4 {
    color: #CF8800; 
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.footer-small-icon {
    height: 22px;
    width: auto;
    object-fit: contain;
}

.detail-block a {
    color: #333333;
    font-size: 0.95rem;
    text-decoration: none;
    line-height: 1.8;
    transition: color 0.3s ease;
}

.detail-block a:hover {
    color: #CF8800; 
}

.email-link {
    text-decoration: underline !important; 
}

.footer-bottom {
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #d1d5db;
    font-size: 0.85rem;
    color: #6b7280;
}

/* =========================================
   BOTÓN FLOTANTE DE ASESORÍA
========================================= */
.floating-btn-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* El botón circular de la base */
.floating-btn {
    background-color: #2b4970;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.floating-btn:hover {
    background-color: #1f3755;
    transform: scale(1.05);
}

.floating-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Pone el icono blanco automáticamente */
}

/* El menú que se abre hacia arriba */
.floating-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

/* Esta clase se activa con JavaScript */
.floating-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-item {
    background-color: #ffffff;
    color: #333333;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #25D366; /* Detalles verdes de WhatsApp */
    transition: background-color 0.3s, transform 0.2s;
}

.floating-item img {
    width: 20px;
    height: 20px;
}

.floating-item:hover {
    background-color: #f1f1f1;
    transform: translateX(-5px); /* Efecto de moverse un poco al lado */
}

/* =========================================
   RESPONSIVE (Tablets y Móviles)
========================================= */
@media (max-width: 992px) {
    .inventory-grid { grid-template-columns: 1fr; }
    
    .services-container { flex-direction: column; }
    
    .footer-container {
        flex-direction: column;
        gap: 60px;
    }
}

@media (max-width: 768px) {
    nav { padding: 18px 20px; }

    /* Muestra la hamburguesa y oculta el menú desplegable por defecto */
    .menu-toggle { display: flex; }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* oculto fuera de la pantalla a la derecha */
        width: 70%;
        max-width: 300px;
        height: 100vh;
        height: 100dvh;
        background-color: rgba(10, 10, 10, 0.97);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 8px;
        padding: 100px 30px 30px;
        transition: right 0.35s ease;
        z-index: 1000;
    }

    /* JS agrega esta clase al hacer clic en la hamburguesa */
    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 0;
        font-size: 1.1rem;
    }

    .nav-links a.btn-contact {
        justify-content: center;
        margin-top: 10px;
    }

    .carousel-slide { padding: 0 30px; }

    .feature-content { margin-bottom: 40px; }
    
    .feature-content h1, .feature-content h2 { font-size: 2.2rem; }
    
    .carousel-btn { font-size: 1.5rem; padding: 10px 15px; }
    
    .services-section, .inventory-section { padding: 60px 20px; }
    
    .inventory-item { flex-direction: column; }
    .item-img { flex: 1; width: 100%; max-width: 100%; }
    
    .whatsapp-overlay {
        opacity: 1;
        background-color: transparent;
        align-items: flex-end;
        padding-bottom: 15px;
    }
    .btn-whatsapp { transform: translateY(0); }

    /* En móvil no hay "hover", así que la descripción se queda siempre visible */
    .item-text p {
        max-height: none;
        opacity: 1;
        margin-top: 10px;
    }
    
    .services-images { grid-template-columns: 1fr; }
    
    .footer-details {
        flex-direction: column;
        gap: 40px;
    }
    
    /* Ajustes del botón flotante en móviles */
    .floating-btn-container {
        bottom: 20px;
        right: 20px;
    }
}

/* =========================================
   RESPONSIVE (Celulares pequeños)
========================================= */
@media (max-width: 480px) {
    .logo img { height: 40px; }

    .feature-content h1, .feature-content h2 { font-size: 1.7rem; }
    .subtitle { font-size: 0.8rem; }
    .description { font-size: 1rem; }

    .carousel-btn {
        font-size: 1.2rem;
        padding: 8px 12px;
    }

    .services-title { font-size: 2rem; }
    .services-main-icon { height: 35px; }
    .services-images img { height: 160px; }

    .section-title h2 { font-size: 1.8rem; }
    .title-icon { width: 35px; }

    .footer-title-wrapper h2 { font-size: 1.8rem; }

    /* El botón flotante se reduce a un círculo con solo el ícono */
    .floating-text { display: none; }
    .floating-btn {
        padding: 14px;
        border-radius: 50%;
    }
}