/* ==========================================================================
   1. VARIABLES GLOBALES Y RESET
   ========================================================================== */
:root {
    --primary-color: #0056b3;
    --primary-dark: #003d82;
    --text-color: #333333;
    --text-muted: #666666;
    --bg-gray: #f9f9f9;
    --border-color: #eaeaea;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #ffffff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   2. HEADER Y NAVEGACIÓN
   ========================================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

header .logo img {
    height: 50px;
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--primary-color);
    font-weight: 700;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color);
    border: 0;
    padding: 6px;
    background: transparent;
    line-height: 1;
}

/* ==========================================================================
   3. SECCIÓN HERO (VIDEO)
   ========================================================================== */
.hero-video-container {
    background: #0b3446 url("/img/video-poster.webp") center / cover no-repeat;
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.hero-video-container video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    transform: none;
    z-index: 0;
    object-fit: cover;
    pointer-events: none;
}

/* ==========================================================================
   4. SECCIONES GENERALES Y TARJETAS
   ========================================================================== */
.text-center {
    text-align: center;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.section-title p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 40px;
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 86, 179, 0.1);
}

.feature-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background-color: rgba(0, 86, 179, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon-wrapper {
    background-color: var(--primary-color);
}

.feature-icon-wrapper i {
    font-size: 35px;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon-wrapper i {
    color: #ffffff;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Grilla de Colecciones / Productos */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-content h3 {
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   5. CARRUSEL DE LOGOS (INFINITE SCROLL)
   ========================================================================== */
.logo-slider-container {
    overflow: hidden;
    background: #ffffff;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.logo-slider-container::before,
.logo-slider-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
}

.logo-slider-container::before {
    left: 0;
    background: linear-gradient(to right, white 0%, rgba(255,255,255,0) 100%);
}

.logo-slider-container::after {
    right: 0;
    background: linear-gradient(to left, white 0%, rgba(255,255,255,0) 100%);
}

.logo-slider-track {
    display: flex;
    width: calc(200px * 36);
    animation: scroll 40s linear infinite;
}

.logo-slider-track:hover {
    animation-play-state: paused;
}

.logo-slide {
    width: 200px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px;
}

.logo-slide img {
    max-width: 100%;
    max-height: 100%;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.logo-slide img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-200px * 18)); }
}

/* ==========================================================================
   6. BANNER CTA FINAL
   ========================================================================== */
.cta-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    padding: 70px 20px;
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 60px 5% 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid h4 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #ffffff;
}

.footer-grid p {
    color: #b0b0b0;
    font-size: 0.95rem;
}

.footer-grid ul {
    list-style: none;
}

.footer-grid ul li {
    margin-bottom: 10px;
}

.footer-grid ul li a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-grid ul li a:hover {
    color: #ffffff;
}

.footer-grid ul li i {
    margin-right: 8px;
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    border-top: 1px solid #333333;
    padding-top: 20px;
    margin-top: 40px;
    color: #777777;
    font-size: 0.85rem;
}

/* ==========================================================================
   8. WIDGET DE WHATSAPP
   ========================================================================== */
.whatsapp-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.whatsapp-float-btn {
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
    transition: transform 0.3s ease, background-color 0.3s;
    position: relative;
    float: right;
}

.whatsapp-float-btn:hover {
    background-color: #128C7E;
    transform: scale(1.05);
}

.whatsapp-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff0000;
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.whatsapp-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: #e5ddd5;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    display: none; 
    flex-direction: column;
    transform-origin: bottom right;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-chat-window.active {
    display: flex;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.whatsapp-chat-header {
    background-color: #075e54;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
}

.whatsapp-avatar {
    width: 45px;
    height: 45px;
    background-color: #fff;
    color: #075e54;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
}

.whatsapp-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.whatsapp-info p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.whatsapp-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    margin-left: auto;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.whatsapp-close:hover { 
    opacity: 1; 
}

.whatsapp-chat-body {
    padding: 20px;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-size: cover;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.whatsapp-message {
    background-color: white;
    padding: 12px 15px;
    border-radius: 0 10px 10px 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    max-width: 90%;
    margin-bottom: 10px;
}

.whatsapp-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-bottom: 15px solid transparent;
    border-right: 15px solid white;
}

.whatsapp-message p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.whatsapp-time {
    font-size: 10px;
    color: #999;
    float: right;
}

.whatsapp-chat-footer {
    padding: 15px;
    background: #f0f0f0;
    text-align: center;
}

.whatsapp-start-btn {
    display: inline-block;
    background-color: #25d366;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.3s;
    width: 90%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.whatsapp-start-btn:hover {
    background-color: #128C7E;
}

/* ==========================================================================
   9. RESPONSIVE DESIGN (MÓVILES)
   ========================================================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: #ffffff;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 20px 0;
    }

    nav ul.active {
        display: flex;
    }

    .hero-video-container {
        height: 50vh;
        min-height: 350px;
    }
}

@media (max-width: 400px) {
    .whatsapp-chat-window {
        width: min(290px, calc(100vw - 32px));
    }
}

/* ==========================================================================
   PÁGINA: PRODUCTOS (Catálogo)
   ========================================================================== */
.products-section {
    padding: 60px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.products-section .section-title {
    margin-bottom: 40px;
}

/* Homogeneizar las imágenes dentro de las tarjetas del catálogo */
.grid-container .card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.grid-container .card .card-content {
    padding: 20px;
}

.grid-container .card .card-content h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* ==========================================================================
   PÁGINA: SERVICIOS
   ========================================================================== */
.services-section {
    padding: 60px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px 25px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 86, 179, 0.08);
}

.service-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background-color: rgba(0, 86, 179, 0.08);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.service-item:hover .service-icon {
    background-color: var(--primary-color);
    color: #ffffff;
}

.service-details h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.service-details p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Sección Proceso de Trabajo */
.process-section {
    background-color: var(--bg-gray);
    padding: 80px 20px;
}

.process-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto 0;
}

.process-card {
    flex: 1;
    min-width: 280px;
    text-align: center;
    padding: 40px 30px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.process-card:hover {
    transform: translateY(-5px);
}

.process-number {
    width: 70px;
    height: 70px;
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    margin: 0 auto 25px;
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3);
}

.process-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--text-color);
}

.process-card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Contenedor y Botón de CTA General */
.cta-container {
    max-width: 800px;
    margin: 0 auto;
}

.cta-container h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.cta-container p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
}

.btn-cta {
    display: inline-block;
    background-color: #ffffff;
    color: var(--primary-color);
    padding: 15px 40px;
    font-size: 1.05rem;
    font-weight: bold;
    border-radius: 30px;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn-cta:hover {
    transform: scale(1.03);
    background-color: #f1f1f1;
}

/* ==========================================================================
   PÁGINA: NOSOTROS
   ========================================================================== */
.about-section {
    padding: 60px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.about-intro {
    max-width: 800px;
    margin: 0 auto 4rem;
    text-align: center;
}

.about-intro p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.about-intro p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   PÁGINA: CONTACTO
   ========================================================================== */
.contact-section {
    padding: 60px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Alertas de formulario */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 0 auto 30px;
    text-align: center;
    max-width: 800px;
    font-size: 0.95rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Distribución en dos columnas */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: start;
    margin-top: 30px;
}

@media (max-width: 850px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }
}

/* Tarjeta informativa */
.contact-info-card {
    background: var(--bg-gray);
    padding: 35px 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.contact-info-card h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.contact-info-card p {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 0.95rem;
}

.contact-info-card h4 {
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--text-color);
}

.coverage-list {
    list-style: none;
    padding-left: 0;
}

.coverage-list li {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.coverage-list li i {
    color: var(--primary-color);
    margin-right: 8px;
}

.app-promo {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.app-promo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Formulario */
.contact-form-card {
    background: #ffffff;
    padding: 35px 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-color);
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
    outline: none;
}

.form-group textarea {
    resize: vertical;
}

.cf-turnstile-wrapper {
    margin-bottom: 20px;
}

.btn-submit {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 14px 35px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
}

.btn-submit:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Accesibilidad: foco de teclado visible y respeto por movimiento reducido. */
.menu-toggle:focus-visible,
.whatsapp-float-btn:focus-visible,
.whatsapp-close:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid #f4b400;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .logo-slider-track {
        animation: none !important;
        transform: none !important;
    }
}
