/* ==========================================================
   RESPONSIVE.CSS — Graphic Line Print
   Ajustes compartidos para TODAS las páginas.

   Va SIEMPRE DE ÚLTIMO en el <head>, después de
   style.css / style_services.css / *_style.css:

       <link rel="stylesheet" href="responsive.css">

   Al cargarse de último, sus reglas ganan sobre las de
   los demás archivos cuando tienen la misma especificidad.
   ========================================================== */


/* ==========================================================
   1. BASE GLOBAL — aplica en todas las pantallas
   ========================================================== */

/* box-sizing: border-box hace que padding y border se cuenten
   DENTRO del width declarado. Sin esto, un elemento con
   width:100% + padding:20px mide 100% + 40px y se desborda.
   Era la causa del desborde de .column-group en index.html. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Evita cualquier scroll horizontal accidental.
   Se usa `clip` y no `hidden` porque `hidden` rompería
   el position: sticky del footer y el fixed del header. */
html,
body {
    overflow-x: clip;
}

/* Ninguna imagen, video o iframe puede desbordar su contenedor */
img,
video,
iframe {
    max-width: 100%;
}

/* Palabras muy largas (URLs, emails) no rompen el layout en móvil */
h1, h2, h3, h4, p, li, a, span {
    overflow-wrap: break-word;
}

/* Respeta a quien pidió menos animación en su sistema operativo */
@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;
    }
}


/* ==========================================================
   2. MENÚ HAMBURGUESA — activo en ≤ 900px
   El botón .nav-toggle ya existía en el HTML pero estaba
   en display:none y sin JS. Aquí se activa de verdad.
   Requiere el navbar.js actualizado.
   ========================================================== */
@media (max-width: 900px) {

    /* La navbar se mantiene en fila: logo a la izquierda,
       hamburguesa a la derecha. NO flex-direction: column. */
    .navbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
    }

    .nav-toggle {
        display: flex;
        /* 44x44 es el mínimo recomendado para tocar con el dedo */
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    /* Los enlaces pasan a ser un panel desplegable bajo la navbar.
       position: absolute funciona porque .navbar es fixed. */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 16px 16px;
        background: rgba(11, 17, 32, 0.97);
        backdrop-filter: blur(12px);
        border-top: 3px solid var(--cyan);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);

        /* Oculto por defecto, sin display:none para poder animar */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    }

    .nav-links.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Cada enlace ocupa toda la fila: área de toque cómoda */
    .nav-links a {
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: 0 6px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav-links a:last-child {
        border-bottom: 0;
    }

    /* El subrayado animado es un efecto de mouse: estorba en móvil */
    .nav-links > a:not(.nav-cta)::after {
        display: none;
    }

    .logo-img,
    .nav-logo img {
        height: 48px;
        width: auto;
    }
}


/* ==========================================================
   3. TABLET (≤ 900px) — resto de ajustes
   ========================================================== */
@media (max-width: 900px) {

    /* ----- Galería vertical de index: 750px fijos son
       demasiado alto en tablet. Se libera la altura. ----- */
    .project-container {
        height: auto;
        margin: 40px 20px;
    }
    .project-gallery {
        aspect-ratio: 4 / 3;
        min-width: 0;
    }
    .column-group {
        gap: 14px;
        padding: 14px;
    }
    .mover {
        gap: 14px;
    }
    .mover img {
        height: 210px;
    }

    /* ----- Secciones de services.html que estaban en fila ----- */
    .wraps {
        flex-direction: column;
        padding: 30px 20px;
    }
    .logos-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .logos-content-image {
        justify-content: center;
    }
    .signs-image-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* ----- Galería window tint: el hover-expand no existe
       en touch. Se convierte en carrusel deslizable. ----- */
    .window-tint-gallery {
        width: 100%;
        max-width: 100%;
        height: auto;
        justify-content: flex-start;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px;
    }
    .window-tint-gallery img {
        width: 280px;
        flex: 0 0 280px;
        height: 360px;
        opacity: 1;
        border-radius: 14px;
        scroll-snap-align: center;
    }

    /* ----- Footer: de 4 columnas a 1 columna centrada -----
       El efecto slideout (sticky) se desactiva porque el
       footer apilado es más alto que la pantalla. */
    footer {
        position: static;
    }
    .footer-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 28px;
        padding: 30px 20px 10px;
    }
    .footer-logo {
        height: 110px;
    }
    .footer-links,
    .footer-contact,
    .footer-social {
        margin-left: 0;
        align-items: center;
    }
    .footer-contact {
        max-width: 100%;
    }
    .footer-contact p {
        justify-content: center;
    }
    .footer-contact p span {
        flex: 0 1 auto;
        text-align: left;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}


/* ==========================================================
   4. MÓVIL (≤ 640px)
   ========================================================== */
@media (max-width: 640px) {

    /* ----- Héroes -----
       svh = "small viewport height": la altura real disponible
       cuando la barra de direcciones del navegador está visible.
       Con 100vh el contenido queda cortado en iOS/Android. */
    .hero {
        min-height: 100svh;
        padding: calc(var(--nav-h) + 1.5rem) 1.2rem 3rem;
    }
    .hero-marks {
        display: none;   /* decorativo, roba ancho en pantallas chicas */
    }
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Héroes de las páginas de servicio (prefijos lt-, wt-, mr-, lg-) */
    .lt-hero,
    .wt-hero,
    .mr-hero,
    .lg-hero {
        min-height: 66svh;
    }

    /* ----- Galería de proyectos: 2 columnas en vez de 3 ----- */
    .project-container {
        margin: 30px 15px;
    }
    .project-gallery {
        aspect-ratio: auto;
        height: 460px;
    }
    .column-group {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
    /* La tercera columna se oculta: en 360px de ancho
       tres columnas quedan demasiado angostas */
    .column-group .image-column:nth-child(3) {
        display: none;
    }
    .mover {
        gap: 12px;
    }
    .mover img {
        height: 190px;
    }

    /* ----- Contacto rápido (franja cyan) ----- */
    .contacto-rapido {
        flex-direction: column;
        text-align: center;
        padding: 18px 15px 5px;
    }
    .contacto-rapido-text h3 {
        font-size: 20px;
        margin: 8px 0 0;
    }
    .contacto-rapido-text p {
        font-size: 16px;
        margin: 8px 0 0;
    }
    .contacto-rapido-button {
        padding: 12px 0 20px;
    }

    /* ----- About Us y Contact Us ----- */
    #about-us {
        padding: 60px 20px 40px;
    }
    #contact-us {
        padding: 60px 20px;
    }
    .contact-info {
        padding: 25px 20px;
        min-width: 0;
    }
    .contact-content {
        gap: 30px;
    }
    .contact-map,
    .contact-map iframe {
        min-height: 260px;
    }

    /* ----- Carrusel About Us: flechas más tocables ----- */
    .gallery-arrow {
        width: 44px;
        height: 44px;
    }

    /* ----- services.html ----- */
    .services-container {
        padding: 25px 15px;
        gap: 20px;
    }
    .services-header h1 {
        font-size: 28px;
    }
    .services-header p {
        font-size: 15px;
    }
    .services-box {
        flex-direction: column;
        gap: 26px;
        padding: 26px 22px 50px;
    }
    .services-spanish h2,
    .services-english h2 {
        font-size: 19px;
    }
    .services-spanish p,
    .services-english p {
        gap: 14px;
        font-size: 15px;
    }
    .service-icon {
        width: 30px;
        height: 30px;
    }

    .window-tint {
        padding: 0 15px;
    }
    .window-tint h2 {
        font-size: 22px;
        text-align: center;
    }
    .window-tint-gallery img {
        width: 240px;
        flex-basis: 240px;
        height: 300px;
    }

    .wraps {
        padding: 25px 15px;
    }
    .wraps-content {
        gap: 30px;
    }
    .wraps-text-box {
        padding: 26px 20px;
    }
    .wraps-text-box h2 {
        font-size: 24px;
    }
    .wraps-text-box p {
        font-size: 15px;
    }
    .wraps-images {
        flex: 1 1 100%;
        width: 100%;
        max-width: 320px;
    }

    /* ----- Signs: de fila desbordada a cuadrícula 2x2 ----- */
    .signs-content {
        padding: 25px 15px;
        margin: 0 15px;
    }
    .signs-text-box h2 {
        font-size: 24px;
        text-align: center;
    }
    .signs-text-box p {
        font-size: 15px;
    }
    .signs-image-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    /* Los cortes diagonales (clip-path) se ven mal en tamaño
       pequeño y desperdician área visible: en móvil van rectas */
    .imagen1, .imagen2, .imagen3, .imagen4 {
        width: 100%;
        clip-path: none;
        border-radius: 14px;
    }

    .logos {
        padding: 25px 15px;
    }
    .logos-content {
        padding: 25px 15px;
    }
    .logos-content-text h2 {
        font-size: 30px;
    }
    .logos-content-text p {
        font-size: 18px;
    }
    .logos-content-image img {
        width: 100%;
        max-width: 300px;
    }
    .logos .whatsapp-button {
        justify-content: center;
    }

    /* ----- Botón flotante de WhatsApp: que no tape el footer ----- */
    .whatsapp-float {
        width: 54px;
        height: 54px;
        right: 14px;
        bottom: 14px;
    }
}


/* ==========================================================
   5. ÁREAS DE TOQUE — solo en dispositivos sin mouse
   `pointer: coarse` = el dedo. Así el escritorio conserva
   sus tamaños compactos y solo el móvil recibe el aumento.
   El mínimo recomendado (WCAG / Apple / Google) es 44x44px.
   ========================================================== */
@media (pointer: coarse) {

    .gallery-dot {
        width: 12px;
        height: 12px;
        /* El punto se ve pequeño pero el área táctil es de 44px */
        padding: 22px;
        background-clip: content-box;
    }

    .social-button,
    .back-to-top,
    .atribuciones {
        min-width: 44px;
        min-height: 44px;
    }

    /* Enlaces del footer, breadcrumb y menús de texto:
       display:flex + min-height agranda el área sin mover el diseño */
    .footer-links a,
    .footer-social-link,
    .legal-toc a,
    .breadcrumb a,
    .wt-breadcrumb a,
    .lt-breadcrumb a,
    .mr-breadcrumb a,
    .lg-breadcrumb a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    /* Los inputs de los simuladores CSS-only (VLT, día/noche,
       color de camiseta) miden 13x13: imposibles de acertar */
    .wt-vlt-label,
    .lt-toggle-option,
    .mr-swatch,
    .lg-app-label {
        min-height: 44px;
    }

    /* Sin mouse no hay hover: los efectos que dependían de él
       se dejan siempre en su estado visible */
    .window-tint-gallery img,
    .gallery-slide img {
        opacity: 1;
    }
}


/* ==========================================================
   6. MÓVIL PEQUEÑO (≤ 380px)
   ========================================================== */
@media (max-width: 380px) {
    .nav-logo span {
        font-size: 0.8rem;
    }
    .logo-img,
    .nav-logo img {
        height: 42px;
    }
    .window-tint-gallery img {
        width: 210px;
        flex-basis: 210px;
    }
    .column-group {
        gap: 10px;
        padding: 10px;
    }
    .mover img {
        height: 165px;
    }
}
