/* Importar tipografía Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* Reset básico */
* {
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
}

/* Colores INSSA */
:root {
    --inssa-fondo: #e6e4e0;
    --inssa-negro: #000000;
    --inssa-amarillo: #ffef00; /* Amarillo eléctrico */
    --inssa-texto: #333333;
    --white: #ffffff;
    --panel-oscuro: #0a0a0a;
    --panel-secundario: #151515;
    --texto-suave-oscuro: rgba(255, 255, 255, 0.72);
    
    /* Variable para el radio de las esquinas (puntas redondas) */
    --borde-suave: 20px; /* Ajusta este número si quieres más o menos redondeado */
}

body {
    background-color: var(--inssa-fondo);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--inssa-texto);
    position: relative;
    overflow-x: hidden;
    padding: 12px;
}

body.modal-open {
    overflow: hidden;
}

body.menu-open {
    overflow: hidden;
}

.site-topbar {
    width: min(96vw, 1600px);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 12px;
    z-index: 20;
}

.site-logo {
    width: 118px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    justify-self: start;
}

.site-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.floating-nav {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.54);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
}

.floating-nav a {
    color: var(--inssa-negro);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    padding: 12px 14px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.floating-nav a:hover,
.floating-nav a:focus-visible {
    background: var(--inssa-amarillo);
    color: var(--inssa-negro);
    outline: none;
}

.floating-nav .nav-account {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-account svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.menu-toggle {
    display: none;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--inssa-negro);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    position: relative;
    z-index: 35;
}

.menu-toggle span {
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.24s ease, opacity 0.2s ease;
}

.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.cap-wrapper {
    width: 100%;
    max-width: min(96vw, 1600px);
    padding: 34px 34px 90px;
    text-align: center;
    position: relative;
    z-index: 1;
    background:
        radial-gradient(circle at top right, rgba(255, 239, 0, 0.12), transparent 22%),
        linear-gradient(180deg, #050505 0%, #101010 100%);
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.2);
}

/* Encabezado */
.cap-header {
    padding: 46px 40px 14px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.brand-bar {
    display: none;
    align-items: center;
    gap: 18px;
    width: fit-content;
    margin: 0 auto;
}

.brand-mark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--white);
    color: var(--inssa-amarillo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.9rem;
    letter-spacing: 0.04em;
}

.brand-copy {
    text-align: left;
}

.brand-copy h1 {
    font-weight: 700;
    font-size: 2.6rem;
    color: var(--white);
    margin-bottom: 2px;
    line-height: 1;
}

.brand-copy p {
    font-size: 1.2rem;
    color: var(--texto-suave-oscuro);
}

/* Buscador Grande y Centrado (CON PUNTAS REDONDAS) */
.search-container {
    position: relative;
    max-width: 670px;
    margin: 18px auto 24px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: #7c7a76;
}

.search-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#cap-search {
    width: 100%;
    padding: 16px 24px 16px 56px;
    font-size: 1.05rem;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    
    /* Esquinas redondeadas suaves */
    border-radius: 999px; /* Redondeado completo para el buscador */
    
    outline: none;
    transition: 0.3s;
    font-weight: 400;
    color: var(--white);
}

#cap-search:focus {
    border-color: var(--inssa-amarillo);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

#cap-search::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

/* Barra de Navegación */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 12px;
    gap: 15px;
    min-height: 20px;
    padding: 0 8px;
}

/* Botón Volver (CON PUNTAS REDONDAS) */
#btn-volver {
    padding: 10px 22px;
    border: none;
    background: var(--white);
    color: var(--inssa-negro);
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: 0.3s;
    
    /* Esquinas redondeadas suaves */
    border-radius: 999px;
}

#btn-volver:hover {
    background: var(--inssa-amarillo);
    color: var(--inssa-negro);
}

#breadcrumb {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.58);
    text-transform: none;
    font-size: 1.05rem;
}

#breadcrumb .crumb-current {
    color: var(--white);
    font-weight: 700;
}

.hero-divider {
    width: 100%;
    height: 3px;
    background: var(--inssa-amarillo);
    margin-bottom: 60px;
    border-radius: 999px;
}

.section-intro {
    padding: 0 28px 0;
    margin-bottom: 34px;
    color: var(--white);
}

.section-intro h2 {
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    line-height: 0.96;
    color: var(--white);
    margin-bottom: 14px;
    letter-spacing: -0.04em;
}

.section-intro p {
    font-size: 1.02rem;
    color: var(--texto-suave-oscuro);
    max-width: 560px;
    margin: 0 auto;
}

.intro-subtitle {
    padding: 0 28px;
    margin: 0 auto 38px;
    text-align: center;
    font-size: 1.02rem;
    color: var(--texto-suave-oscuro);
    max-width: 620px;
}

.lineas-header {
    max-width: 1520px;
    margin: 0 auto 32px;
    padding: 0 28px;
    text-align: left;
}

.lineas-header h2 {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 1;
    color: var(--white);
    margin-bottom: 10px;
    letter-spacing: -0.04em;
}

.lineas-header p {
    font-size: 1rem;
    color: var(--texto-suave-oscuro);
}

/* Grillas Centradas */
.cap-grid-cuadrada, .cap-grid-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 42px;
    justify-content: center;
}

.cap-grid-segmentos {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 28px 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

#nivel-lineas,
#nivel-maquinas {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 28px 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

/* Tarjetas Estilo INSSA (CON PUNTAS REDONDAS Y BORDE INFERIOR AMARILLO) */
.cat-card-square, .cap-card {
    background: var(--panel-secundario);
    overflow: hidden;
    transition: 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    
    /* Esquinas redondeadas suaves para la tarjeta */
    border-radius: var(--borde-suave);
    
    /* Efecto de subrayado amarillo al pasar el ratón */
    border-bottom: 5px solid transparent; 
}

.video-item {
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cat-card-square:hover, .cap-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 22px 42px rgba(0,0,0,0.26);
    border-bottom: 5px solid var(--inssa-amarillo);
}

.segment-card {
    position: relative;
    min-height: 278px;
    overflow: hidden;
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    background-size: cover;
    background-position: center;
}

.segment-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2);
}

.horeca-card {
    background-image: url('img/HORECA.jpg');
}

.vending-card {
    background-image: url('img/VENDINGG.jpg');
}

.varios-card {
    background-image: url('img/VARIOS.png');
}

.segment-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.82) 100%);
}

.segment-content {
    position: absolute;
    inset: auto 30px 30px 30px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    z-index: 1;
    text-align: left;
}

.segment-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--inssa-amarillo);
    color: var(--inssa-negro);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.segment-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.segment-text h3 {
    color: var(--white);
    font-size: 2.15rem;
    line-height: 1;
    margin-bottom: 8px;
}

.segment-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.02rem;
    line-height: 1.35;
    max-width: 250px;
}

.linea-card {
    border: none;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.linea-card:hover {
    border-bottom-color: transparent;
}

.linea-image-container {
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
    overflow: hidden;
}

.linea-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.granizados-cover img {
    object-position: center 58%;
}

.linea-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 24px;
    text-align: left;
}

.linea-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--inssa-amarillo);
    color: var(--inssa-negro);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.linea-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.linea-copy h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.linea-copy p {
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.4;
    margin-bottom: 10px;
}

.linea-copy span {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.52);
}

/* Contenedor de Imágenes */
.cat-image-container {
    width: 100%;
    aspect-ratio: 1/1; /* Cuadrado perfecto */
    background: var(--white);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Redondeado para la imagen también */
    border-top-left-radius: var(--borde-suave);
    border-top-right-radius: var(--borde-suave);
}

.cat-image-container img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain; /* Foto completa sin cortar */
}

.cat-info {
    padding: 24px;
    text-align: center;
}

.cat-info h3 {
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--white);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.cat-info p {
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    line-height: 1.5;
}

/* Ajuste de Videos */
.cap-grid-videos {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    padding: 0 28px 20px;
}

.cap-grid-videos.centered-videos {
    grid-template-columns: repeat(auto-fit, minmax(320px, 380px));
    justify-content: center;
    max-width: 860px;
    margin: 0 auto;
}

.cap-grid-videos.reels-mode {
    grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
    justify-content: center;
    max-width: 1180px;
    margin: 0 auto;
    gap: 28px;
}

.cap-card .cat-info h3 { text-transform: none; } /* Títulos de videos normales */

.video-frame iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    pointer-events: none;

    /* Redondeado para el video también */
    border-top-left-radius: var(--borde-suave);
    border-top-right-radius: var(--borde-suave);
}

.video-frame {
    position: relative;
    cursor: pointer;
}

.reel-card {
    background: transparent;
    border: none;
    box-shadow: none;
}

.reel-card:hover {
    border-bottom-color: transparent;
    box-shadow: none;
    transform: translateY(-6px);
}

.reel-card .video-frame iframe {
    aspect-ratio: 9 / 16;
    border-radius: 28px;
}

.reel-card .video-frame {
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
    background: #000;
}

.reel-card .cat-info {
    display: none;
}

.video-open-button {
    position: absolute;
    left: 16px;
    bottom: 16px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    padding: 10px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.video-open-button:hover {
    background: var(--inssa-amarillo);
    color: var(--inssa-negro);
    transform: translateY(-1px);
}

.video-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 999;
}

.video-modal[aria-hidden='false'] {
    display: flex;
}

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(3px);
}

.video-modal-dialog {
    position: relative;
    width: min(1100px, 100%);
    background: #111;
    color: var(--white);
    border-radius: 24px;
    padding: 20px 20px 16px;
    z-index: 1;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.video-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.video-modal-dialog h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 56px 14px 0;
    text-align: left;
}

.video-modal-frame iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 16px;
}

.video-modal-dialog.reel-modal {
    width: min(520px, 100%);
}

.video-modal-dialog.reel-modal .video-modal-frame iframe {
    aspect-ratio: 9 / 16;
}

.site-footer {
    margin: 86px auto 0;
    padding: 62px 58px 36px;
    color: var(--white);
    background: #222222;
    border-radius: 38px;
    text-align: left;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
}

.footer-brand {
    width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand img {
    width: 128px;
    height: auto;
    display: block;
}

.footer-menu {
    display: grid;
    gap: 18px;
    justify-items: center;
    text-align: center;
}

.footer-menu a {
    color: var(--inssa-amarillo);
    font-size: 1.32rem;
    line-height: 1;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

.footer-locations {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
}

.footer-locations article {
    min-width: 0;
    position: relative;
}

.footer-locations h3 {
    color: var(--inssa-amarillo);
    font-size: 1.25rem;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.footer-locations p {
    min-height: 52px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    line-height: 1.22;
    font-weight: 700;
    margin-bottom: 14px;
}

.footer-locations a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 10px 14px;
    border-radius: 6px;
    color: #0069ff;
    background: #f6f6f6;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.footer-map {
    width: 100%;
    aspect-ratio: 1 / 1.28;
    overflow: hidden;
    background: #d7eee2;
    margin-bottom: 12px;
}

.footer-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.footer-bottom {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 70px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.42);
}

.footer-legal,
.footer-social {
    display: flex;
    align-items: center;
    gap: 34px;
    flex-wrap: wrap;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--inssa-amarillo);
    border-radius: 9px;
    color: var(--inssa-amarillo);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover,
.footer-social a:focus-visible {
    background: var(--inssa-amarillo);
    color: var(--inssa-negro);
    outline: none;
    transform: translateY(-2px);
}

.footer-social svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.footer-social a[aria-label='Instagram'] svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

@media (max-width: 1200px) {
    body {
        padding: 18px 14px;
    }

    .site-topbar {
        width: min(97vw, 1280px);
    }

    .floating-nav {
        padding: 12px 18px;
    }

    .floating-nav a {
        padding: 11px 10px;
    }

    .cap-wrapper {
        max-width: min(97vw, 1280px);
        padding: 24px 24px 32px;
        border-radius: 30px;
    }

    .cap-header {
        padding: 36px 28px 12px;
    }

    .section-intro {
        padding: 0 24px;
        margin-bottom: 28px;
    }

    .section-intro h2 {
        font-size: clamp(2.4rem, 5.5vw, 4rem);
    }

    .cap-grid-segmentos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 24px 16px;
        gap: 24px;
    }

    #nivel-lineas,
    #nivel-maquinas {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 24px 16px;
        gap: 24px;
    }

    .cap-grid-videos {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        padding: 0 24px 16px;
        gap: 24px;
    }

    .site-footer {
        padding: 52px 38px 34px;
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .footer-brand {
        width: 100%;
        gap: 34px;
    }

    .footer-locations {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin: 34px 0 0;
    }
}

@media (max-width: 980px) {
    .site-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .site-logo {
        width: 112px;
        height: auto;
        flex: 0 0 auto;
        position: relative;
        z-index: 110;
    }

    .floating-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        width: 100vw;
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 30px;
        padding: 126px 32px 72px;
        border-radius: 0;
        background:
            linear-gradient(152deg, var(--inssa-amarillo) 0 19%, transparent 19.2% 100%),
            linear-gradient(152deg, transparent 0 52%, var(--inssa-amarillo) 52.2% 76%, transparent 76.2% 100%),
            var(--inssa-fondo);
        box-shadow: none;
        backdrop-filter: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px);
        overflow-y: auto;
        transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s ease;
    }

    .menu-open .floating-nav {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .floating-nav a {
        font-size: clamp(2.6rem, 11vw, 4.2rem);
        font-weight: 700;
        padding: 0;
        border-radius: 0;
        text-align: center;
        line-height: 1.05;
    }

    .floating-nav a:hover,
    .floating-nav a:focus-visible {
        background: transparent;
    }

    .floating-nav .nav-account {
        width: auto;
        height: auto;
        margin-top: 2px;
    }

    .nav-account svg {
        width: 44px;
        height: 44px;
    }

    .menu-toggle {
        display: inline-flex;
        z-index: 110;
    }

    .cap-wrapper {
        padding: 14px 14px 24px;
        border-radius: 34px;
    }

    .cap-header {
        padding: 28px 24px 8px;
    }

    .cap-grid-segmentos {
        grid-template-columns: 1fr;
        max-width: 540px;
    }

    #nivel-lineas,
    #nivel-maquinas {
        grid-template-columns: 1fr;
        padding: 0 24px;
    }

    .cap-grid-videos {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        padding: 0 24px;
        gap: 24px;
    }

    .cap-grid-videos.centered-videos {
        grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
        max-width: 760px;
    }

    .nav-bar {
        padding: 0;
    }

    .lineas-header {
        padding: 0 24px;
    }

    .segment-card {
        min-height: 290px;
    }

    .lineas-header h2 {
        font-size: clamp(2.2rem, 7vw, 3.4rem);
    }

    .site-footer {
        border-radius: 30px;
    }

    .footer-brand {
        width: 100%;
        gap: 24px;
    }

    .footer-menu {
        grid-template-columns: repeat(4, max-content);
        gap: 16px 22px;
    }

    .footer-locations {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 42px 28px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 12px;
        align-items: flex-start;
        gap: 12px;
    }

    .site-topbar {
        width: 100%;
        position: sticky;
        top: 8px;
        align-items: center;
        background: rgba(230, 228, 224, 0.86);
        margin: -12px -12px 0;
        padding: 24px 32px;
        width: calc(100% + 24px);
        backdrop-filter: blur(10px);
    }

    .menu-open .site-topbar {
        background: transparent;
        backdrop-filter: none;
    }

    .site-logo {
        width: 102px;
        height: auto;
    }

    .menu-toggle {
        width: 58px;
        height: 58px;
    }

    .floating-nav a {
        font-size: clamp(2.5rem, 12vw, 3.6rem);
    }

    .cap-wrapper {
        border-radius: 26px;
        padding: 10px 10px 20px;
        max-width: 100%;
    }

    .brand-bar {
        margin: 0 auto;
    }

    .brand-copy h1 {
        font-size: 2.1rem;
    }

    .brand-copy p {
        font-size: 1rem;
    }

    .search-container {
        margin-top: 4px;
        margin-bottom: 14px;
    }

    .hero-divider {
        margin-bottom: 22px;
    }

    .section-intro {
        margin-bottom: 22px;
        padding: 0 18px 0;
    }

    .section-intro h2 {
        font-size: 2.7rem;
    }

    .section-intro p {
        font-size: 1rem;
    }

    .intro-subtitle {
        padding: 0 18px;
        margin-bottom: 20px;
        font-size: 0.98rem;
    }

    .lineas-header {
        margin-bottom: 24px;
        padding: 0 18px;
    }

    .lineas-header p {
        font-size: 1rem;
    }

    .lineas-header h2 {
        font-size: 2.2rem;
    }

    .segment-content {
        inset: auto 16px 16px 16px;
        gap: 12px;
    }

    .segment-icon {
        width: 38px;
        height: 38px;
    }

    .segment-icon svg {
        width: 21px;
        height: 21px;
    }

    .segment-text h3 {
        font-size: 1.6rem;
    }

    .segment-text p {
        font-size: 0.92rem;
        line-height: 1.3;
    }

    .cap-grid-segmentos,
    #nivel-lineas,
    #nivel-maquinas {
        gap: 16px;
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100%;
    }

    .segment-card {
        aspect-ratio: 16 / 9;
        min-height: 0;
        width: 100%;
    }

    .cap-grid-videos {
        grid-template-columns: 1fr;
        padding: 0 16px;
        gap: 18px;
    }

    .cap-grid-videos.centered-videos {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .cap-grid-videos.reels-mode {
        grid-template-columns: repeat(auto-fit, minmax(170px, 220px));
        gap: 18px;
        padding: 0 12px;
    }

    .linea-info {
        padding: 16px;
        gap: 12px;
    }

    .linea-icon {
        width: 36px;
        height: 36px;
    }

    .linea-copy h3 {
        font-size: 1.02rem;
    }

    .linea-copy p {
        font-size: 0.9rem;
    }

    .linea-copy span {
        font-size: 0.82rem;
    }

    .cap-card {
        min-width: 0;
    }

    .cat-info {
        padding: 16px;
    }

    .cat-info h3 {
        font-size: 1.05rem;
        line-height: 1.3;
    }

    .cat-info p {
        font-size: 0.92rem;
    }

    .video-modal {
        padding: 12px;
    }

    .video-modal-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        overflow: auto;
        padding: 16px 16px 12px;
        border-radius: 18px;
    }

    .video-modal-dialog h3 {
        font-size: 1rem;
        margin-right: 48px;
    }

    .video-open-button {
        left: 12px;
        bottom: 12px;
        padding: 9px 14px;
        font-size: 0.85rem;
    }

    .video-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }

    .video-modal-dialog.reel-modal {
        width: min(380px, 100%);
    }

    .site-footer {
        margin-top: 52px;
        padding: 58px 26px 32px;
        border-radius: 28px 28px 0 0;
    }

    .footer-brand {
        place-items: center;
        text-align: center;
    }

    .footer-brand img {
        width: 138px;
    }

    .footer-menu {
        grid-template-columns: 1fr;
        gap: 4px;
        justify-items: center;
    }

    .footer-menu a {
        font-size: 1.38rem;
        line-height: 1.15;
    }

    .footer-locations {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 44px 22px;
        margin-top: 76px;
    }

    .footer-locations h3 {
        margin-bottom: 18px;
        font-size: 1.18rem;
        text-align: center;
    }

    .footer-locations p {
        min-height: 56px;
        margin-bottom: 14px;
        font-size: 1rem;
        line-height: 1.12;
    }

    .footer-map {
        aspect-ratio: 1 / 1.9;
        margin-bottom: 0;
    }

    .footer-locations a {
        position: absolute;
        left: 10px;
        top: 116px;
        min-height: 34px;
        padding: 8px 11px;
        font-size: 0.8rem;
        z-index: 1;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: row;
        margin-top: 56px;
        padding-top: 22px;
    }

    .footer-legal {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .footer-social {
        gap: 12px;
    }
}

@media (max-width: 420px) {
    body {
        padding: 8px;
    }

    .site-topbar {
        gap: 8px;
        margin: -8px -8px 0;
        padding: 22px 28px;
        width: calc(100% + 16px);
    }

    .site-logo {
        width: 86px;
        height: auto;
    }

    .menu-toggle {
        width: 52px;
        height: 52px;
    }

    .menu-toggle span {
        width: 22px;
    }

    .floating-nav {
        gap: 26px;
    }

    .floating-nav a {
        font-size: clamp(2.25rem, 12vw, 3rem);
    }

    .cap-wrapper {
        border-radius: 20px;
        padding: 8px 8px 18px;
    }

    .cap-header {
        padding: 24px 14px 6px;
    }

    .section-intro {
        padding: 0 10px;
        margin-bottom: 18px;
    }

    .section-intro h2 {
        font-size: 2.25rem;
    }

    .section-intro p {
        font-size: 0.92rem;
    }

    .intro-subtitle {
        padding: 0 10px;
        margin-bottom: 16px;
        font-size: 0.9rem;
    }

    .search-container {
        margin-bottom: 10px;
    }

    #cap-search {
        padding: 14px 18px 14px 48px;
        font-size: 0.96rem;
    }

    .search-icon {
        left: 16px;
        width: 18px;
        height: 18px;
    }

    #btn-volver {
        padding: 9px 16px;
        font-size: 0.82rem;
    }

    #breadcrumb {
        font-size: 0.88rem;
    }

    .hero-divider {
        margin-bottom: 10px;
    }

    .cap-grid-segmentos,
    #nivel-lineas,
    #nivel-maquinas,
    .cap-grid-videos {
        padding-left: 6px;
        padding-right: 6px;
    }

    .segment-card {
        border-radius: 18px;
    }

    .segment-text h3 {
        font-size: 1.35rem;
        margin-bottom: 4px;
    }

    .segment-text p {
        font-size: 0.88rem;
    }

    .segment-content {
        inset: auto 12px 12px 12px;
    }

    .video-open-button {
        left: 10px;
        bottom: 10px;
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    .site-footer {
        padding: 50px 18px 24px;
        border-radius: 24px 24px 0 0;
    }

    .footer-menu a {
        font-size: 1.18rem;
    }

    .footer-locations {
        gap: 42px 18px;
    }

    .footer-locations h3 {
        font-size: 1.08rem;
    }

    .footer-locations p {
        font-size: 0.92rem;
    }

    .footer-locations a {
        top: 108px;
        width: auto;
        max-width: calc(100% - 20px);
    }

    .footer-legal,
    .footer-social {
        gap: 16px;
    }

    .footer-legal a {
        font-size: 0.82rem;
    }
}
