/**
 * SEMID PERÚ - Reglas Responsivas Maestras (100% Responsive)
 * Adaptación fluida y probada para todas las pantallas y dispositivos:
 * Ultra-wide (1440px+), Desktops (1200px), Tablets (991px, 768px),
 * Smartphones estándar (576px), Smartphones compactos (480px)
 * y Ultra-compactos (360px - 320px).
 */

/* ==========================================================================
   0. RESET Y SEGURIDAD RESPONSIVA GLOBAL
   ========================================================================== */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Evitar desbordes de texto y títulos largos */
h1, h2, h3, h4, h5, h6,
.hero-title, .section-title,
.semid-section-title, .contacto-hero-title,
.servicios-hero-title, .nosotros-hero-title,
.hero-amb-title {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Media fluida garantizada */
img, video, canvas, picture {
    max-width: 100%;
    height: auto;
}

iframe {
    max-width: 100%;
}

/* ==========================================================================
   1. PANTALLAS GRANDES Y ULTRA-WIDE (>= 1441px)
   ========================================================================== */
@media (min-width: 1441px) {
    .semid-container {
        max-width: 1360px;
    }
}

/* ==========================================================================
   2. DESKTOPS MEDIANOS Y LAPTOPS (<= 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
    /* Inicio */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .hero-title {
        font-size: 2.85rem;
    }

    .hero-grid {
        gap: 2.5rem;
    }

    .dual-layout-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-card-content {
        max-width: 65%;
    }

    /* Nosotros */
    .nosotros-hero-grid,
    .qs-grid-2col,
    .mv-grid-2col {
        gap: 2.5rem;
    }

    /* Servicios */
    .catalogo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .especialidades-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Ambulancias */
    .hero-amb-grid,
    .amb-tipos-grid {
        gap: 2rem;
    }

    .equipamiento-cards-row {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Contacto */
    .form-medios-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .ubicacion-grid-2col {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .accesos-cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .acceso-card {
        grid-template-columns: 1.4fr 0.6fr;
    }
}

/* ==========================================================================
   3. TABLETS Y PANTALLAS PEQUEÑAS (<= 991px)
   ========================================================================== */
@media (max-width: 991px) {
    :root {
        --navbar-height: 72px;
        --container-padding: 1.25rem;
    }

    /* Topbar compacto */
    .semid-topbar-right .topbar-item {
        display: none; /* Oculta dirección larga en tablet */
    }

    /* Menú Desktop a Hamburguesa Móvil */
    .semid-nav,
    .semid-header-actions .btn {
        display: none !important;
    }

    .semid-burger-btn {
        display: flex !important;
    }

    /* Padding de secciones en tablet */
    .section-padding {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    /* Heroes (Inicio, Nosotros, Servicios, Ambulancias, Contacto) */
    .hero-section,
    .nosotros-hero-section,
    .servicios-hero-section,
    .hero-amb-section,
    .contacto-hero {
        padding-top: 3.5rem;
        padding-bottom: 4.5rem;
    }

    .hero-grid,
    .nosotros-hero-grid,
    .servicios-hero-grid,
    .hero-amb-grid {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 2.5rem;
    }

    .hero-title,
    .nosotros-hero-title,
    .servicios-hero-title,
    .hero-amb-title,
    .contacto-hero-title {
        font-size: 2.45rem;
        line-height: 1.18;
    }

    .hero-visual-wrapper {
        margin-top: 2rem;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        position: relative;
    }

    .hero-ambulance-card {
        width: 100%;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 16px 36px rgba(10, 20, 50, 0.35);
        border: 1.5px solid rgba(255, 255, 255, 0.16);
    }

    .hero-ambulance-card img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }

    .hero-floating-callout {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        margin-top: 0;
        background: #18286A;
        border: 1.5px solid rgba(255, 255, 255, 0.2);
        border-radius: 16px;
        padding: 1rem 1.35rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        box-shadow: 0 12px 30px rgba(10, 20, 50, 0.4);
        box-sizing: border-box;
    }

    .nosotros-hero-visual,
    .hero-amb-visual {
        margin-top: 1rem;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }

    /* Sección ¿Por qué elegirnos? */
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    /* Nosotros */
    .qs-grid-2col,
    .mv-grid-2col {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .certificaciones-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Servicios */
    .amb-destacadas-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .proceso-steps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Ambulancias */
    .amb-tipos-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .comparativa-multimedia-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        min-width: 0;
        width: 100%;
    }

    .ambulancias-comparativa-col,
    .ambulancias-multimedia-col {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        margin-top: 0;
    }

    .cotizacion-advisor-grid {
        grid-template-columns: 1fr;
    }

    .cotizacion-advisor-col {
        min-height: 280px;
        order: -1;
    }

    /* Contacto */
    .contacto-hero-inner {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .hero-contacto-panorama-layer {
        display: none;
    }

    .contacto-hero-content {
        max-width: 100%;
        width: 100%;
    }

    .contacto-hero-mobile-card {
        display: block;
        position: relative;
        width: 100%;
        margin: 1.5rem 0 1.75rem 0;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
        border: 1.5px solid rgba(255, 255, 255, 0.18);
        background: #090f2b;
    }

    .contacto-hero-mobile-card::after {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: linear-gradient(
            180deg,
            rgba(9, 15, 43, 0.08) 0%,
            transparent 45%,
            rgba(9, 15, 43, 0.55) 100%
        );
    }

    .contacto-hero-mobile-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9.2;
        max-height: 250px;
        display: block;
        object-fit: cover;
        object-position: center;
    }

    .mobile-card-badge {
        position: absolute;
        top: 0.85rem;
        left: 0.85rem;
        z-index: 3;
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        background: rgba(9, 15, 43, 0.78);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 9999px;
        padding: 0.38rem 0.8rem;
        font-size: 0.74rem;
        font-weight: 700;
        color: #FFFFFF;
        letter-spacing: 0.02em;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    }

    .live-status-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #10B981;
        box-shadow: 0 0 8px #10B981;
        animation: pulseStatus 2s infinite ease-in-out;
    }

    .contacto-hero-benefits {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
        max-width: 100%;
        width: 100%;
    }

    .contacto-benefit-pill {
        width: 100%;
        padding: 0.85rem 1rem;
        backdrop-filter: blur(8px);
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.14);
    }

    .contacto-faq-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Footer */
    .semid-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

/* ==========================================================================
   4. SMARTPHONES GRANDES Y TABLETS PEQUEÑAS (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --navbar-height: 70px;
        --container-padding: 1.15rem;
    }

    /* Inputs en iOS: mínimo 16px para prevenir zoom automático indeseado */
    input, select, textarea {
        font-size: 16px !important;
    }

    /* Topbar móvil */
    .semid-topbar-left .topbar-item:nth-child(2),
    .semid-topbar-left .topbar-item:nth-child(3) {
        display: none; /* En móvil dejamos solo "Atención 24/7" y teléfonos en enlace */
    }

    .semid-topbar-inner {
        justify-content: space-between;
    }

    /* Spacing general de sección */
    .section-padding {
        padding-top: 3.25rem;
        padding-bottom: 3.25rem;
    }

    .section-padding-sm {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    /* Tipografía de títulos */
    .hero-title,
    .nosotros-hero-title,
    .servicios-hero-title,
    .hero-amb-title,
    .contacto-hero-title {
        font-size: 2.15rem;
    }

    .section-title,
    .semid-section-title,
    .quienes-title,
    .catalogo-title,
    .ubicacion-title {
        font-size: 1.85rem;
    }

    .hero-desc,
    .nosotros-hero-desc,
    .servicios-hero-desc,
    .contacto-hero-desc {
        font-size: 0.98rem;
    }

    /* Hero Inicio - Características 24/7 / Médicos / Unidades en tarjetas estilizadas */
    .hero-features {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 1.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.16);
        width: 100%;
    }

    .hero-feature-item {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 14px;
        backdrop-filter: blur(8px);
        width: 100%;
    }

    .hero-feature-icon {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #8CEADF;
    }

    .hero-feature-title {
        font-size: 0.92rem;
        color: #FFFFFF;
        line-height: 1.2;
    }

    .hero-feature-sub {
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.75);
    }

    .hero-section {
        padding-bottom: 6rem; /* Espacio para que la curva inferior no corte los elementos */
    }

    .hero-visual-wrapper {
        margin-top: 2rem;
        margin-bottom: 1.5rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .hero-floating-callout {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        margin-top: 0;
        background: #18286A;
        border: 1.5px solid rgba(255, 255, 255, 0.22);
        border-radius: 16px;
        padding: 1rem 1.25rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        box-shadow: 0 14px 32px rgba(10, 20, 50, 0.45);
        box-sizing: border-box;
    }

    .callout-info {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
    }

    .callout-phone-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        white-space: nowrap;
        font-size: 0.84rem;
        padding: 0.45rem 0.95rem;
    }

    .ambulancias-hero-benefits {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
    }

    .section-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }

    /* Grids en móvil */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* Banner contacto */
    .contact-banner-card {
        padding: 2.2rem 1.5rem;
        min-height: auto;
    }

    .contact-card-content {
        max-width: 100%;
    }

    .contact-doctor-visual {
        display: none;
    }

    .contact-footer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    /* Nosotros en móvil */
    .quienes-grid {
        grid-template-columns: 1fr;
    }

    .quienes-esencia-card {
        grid-column: span 1;
    }

    .nosotros-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .nosotros-stat-item:not(:last-child)::after {
        display: none;
    }

    .historia-timeline-horizontal {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding-left: 2rem;
        position: relative;
    }

    .historia-timeline-horizontal::before {
        top: 0;
        bottom: 0;
        left: 14px;
        right: auto;
        width: 3px;
        height: 100%;
    }

    .timeline-step {
        position: relative;
    }

    .timeline-node {
        position: absolute;
        left: -2rem;
        top: 0;
        margin-bottom: 0;
    }

    .certificaciones-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Servicios en móvil */
    .servicios-hero-benefits-grid {
        grid-template-columns: 1fr;
    }

    .servicios-cards-grid,
    .catalogo-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .especialidades-grid {
        grid-template-columns: 1fr;
    }

    .proceso-steps-grid {
        grid-template-columns: 1fr;
    }

    .amb-info-panel,
    .servicios-cta-card {
        padding: 2.2rem 1.5rem;
    }

    .amb-panel-title,
    .servicios-cta-title {
        font-size: 1.85rem;
    }

    .amb-benefits-row {
        grid-template-columns: 1fr;
    }

    .servicios-cta-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.85rem;
    }

    .servicios-cta-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Ambulancias en móvil */
    .ambulancias-hero-inner {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .ambulancias-hero-content {
        max-width: 100%;
        width: 100%;
    }

    .hero-mobile-media-card {
        display: block;
        width: 100%;
        margin: 1.5rem 0 1.75rem 0;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
        border: 1.5px solid rgba(255, 255, 255, 0.18);
        background: rgba(255, 255, 255, 0.05);
    }

    .hero-mobile-img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }

    .ambulancias-hero-benefits {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
        max-width: 100%;
        width: 100%;
    }

    .hero-benefit-pill {
        width: 100%;
        padding: 0.85rem 1rem;
        backdrop-filter: blur(8px);
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.14);
    }

    .equipamiento-cards-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Tabla Comparativa: scroll táctil fluido con ancho mínimo e indicador */
    .table-scroll-hint {
        display: inline-flex;
    }

    .comparativa-multimedia-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        min-width: 0;
        width: 100%;
    }

    .ambulancias-comparativa-col,
    .ambulancias-multimedia-col {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        margin-top: 0;
    }

    .comparativa-table-container {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
        position: relative;
    }

    .comparativa-table {
        min-width: 480px;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    /* Columna de características fija para que nunca se pierda el contexto al hacer swipe */
    .comparativa-table th.th-feature,
    .comparativa-table td.td-feature {
        position: sticky;
        left: 0;
        z-index: 2;
        background-color: #FFFFFF;
        box-shadow: 3px 0 8px rgba(0, 0, 0, 0.06);
        min-width: 150px;
        max-width: 180px;
    }

    .comparativa-table thead th.th-feature {
        background: #181c62;
        z-index: 4;
    }

    .comparativa-table tbody tr:nth-child(even) td.td-feature {
        background-color: #F9FBFE;
    }

    .comparativa-table tbody tr:hover td.td-feature {
        background-color: #EDF4FF;
    }

    .comparativa-table th.th-type {
        min-width: 95px;
    }

    .galeria-nav-btn,
    .lightbox-nav-btn {
        display: none;
    }

    .galeria-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .tipo-card-actions {
        grid-template-columns: 1fr;
    }

    /* Hero Contacto en móvil */
    .contacto-hero-inner {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .contacto-hero-content {
        max-width: 100%;
        width: 100%;
    }

    .contacto-hero-mobile-card {
        display: block;
        position: relative;
        width: 100%;
        margin: 1.25rem 0 1.5rem 0;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
        border: 1.5px solid rgba(255, 255, 255, 0.18);
        background: #090f2b;
    }

    .contacto-hero-mobile-card::after {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: linear-gradient(
            180deg,
            rgba(9, 15, 43, 0.08) 0%,
            transparent 45%,
            rgba(9, 15, 43, 0.55) 100%
        );
    }

    .contacto-hero-mobile-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9.2;
        max-height: 220px;
        display: block;
        object-fit: cover;
        object-position: center;
    }

    .contacto-hero-benefits {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        width: 100%;
    }

    .contacto-benefit-pill {
        width: 100%;
        padding: 0.8rem 0.85rem;
        backdrop-filter: blur(8px);
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 14px;
        gap: 0.75rem;
    }

    .contacto-benefit-pill .benefit-pill-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .contacto-benefit-pill .benefit-pill-text {
        min-width: 0;
    }

    .contacto-benefit-pill .benefit-pill-text strong {
        font-size: 0.82rem;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .contacto-benefit-pill .benefit-pill-text span {
        font-size: 0.72rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Contacto en móvil */
    .form-row-dual {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }

    .medios-grid-2x2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .medio-card-horario {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .formulario-card-wrapper {
        padding: 2rem 1.25rem;
    }

    .acceso-card {
        grid-template-columns: 1fr;
    }

    .acceso-media-col {
        aspect-ratio: 16 / 9;
    }

    /* Footer */
    .semid-footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .semid-footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Botón Flotante de WhatsApp optimizado para pulgar */
    .semid-whatsapp-float {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 50px;
        height: 50px;
    }

    .semid-whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}

/* ==========================================================================
   5. SMARTPHONES ESTÁNDAR Y COMPACTOS (<= 576px)
   ========================================================================== */
@media (max-width: 576px) {
    :root {
        --navbar-height: 68px;
        --container-padding: 1rem;
    }

    .hero-title,
    .nosotros-hero-title,
    .servicios-hero-title,
    .hero-amb-title,
    .contacto-hero-title {
        font-size: 1.95rem;
    }

    .section-title,
    .semid-section-title {
        font-size: 1.65rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .nosotros-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero-cta-group,
    .contacto-hero-actions,
    .hero-amb-actions,
    .nosotros-hero-actions,
    .contact-actions-row {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .hero-cta-group .btn,
    .contacto-hero-actions .btn,
    .hero-amb-actions .btn,
    .nosotros-hero-actions .btn,
    .contact-actions-row .btn {
        width: 100%;
        justify-content: center;
    }

    .certificaciones-grid {
        grid-template-columns: 1fr;
    }

    .equipamiento-cards-row {
        grid-template-columns: 1fr;
    }

    .ambulancias-hero-benefits {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        width: 100%;
    }

    .multimedia-subcards-row {
        grid-template-columns: 1fr;
    }

    .comparativa-table {
        min-width: 440px;
    }

    .comparativa-table th,
    .comparativa-table td {
        padding: 0.65rem 0.55rem;
        font-size: 0.82rem;
    }

    .comparativa-table th.th-feature,
    .comparativa-table td.td-feature {
        min-width: 135px;
        max-width: 155px;
        font-size: 0.8rem;
        padding-left: 0.75rem;
    }

    .comparativa-table th.th-type {
        min-width: 85px;
    }

    .comparativa-footnote {
        font-size: 0.78rem;
        line-height: 1.45;
    }

    .ambulancias-advisory-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 0.85rem;
    }

    .advisory-info {
        align-items: center;
    }

    .btn-advisory {
        width: 100%;
        justify-content: center;
    }

    .cotizacion-info-col {
        padding: 2rem 1.25rem;
    }

    .map-floating-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
        left: 0.85rem;
        right: 0.85rem;
        bottom: 0.85rem;
        padding: 0.75rem 1rem;
    }

    .btn-map-external {
        width: 100%;
        justify-content: center;
    }

    .map-iframe {
        min-height: 340px;
    }
}

/* ==========================================================================
   6. SMARTPHONES ULTRA-COMPACTOS (<= 380px e iPhone SE / Galaxy Fold 320-360px)
   ========================================================================== */
@media (max-width: 380px) {
    :root {
        --container-padding: 0.85rem;
        --navbar-height: 64px;
    }

    .semid-logo-img {
        height: 36px;
        max-width: 155px;
    }

    .hero-title,
    .nosotros-hero-title,
    .servicios-hero-title,
    .hero-amb-title,
    .contacto-hero-title {
        font-size: 1.75rem;
    }

    .section-title,
    .semid-section-title {
        font-size: 1.45rem;
    }

    .btn {
        padding: 0.7rem 1.1rem;
        font-size: 0.86rem;
    }

    .semid-topbar {
        font-size: 0.72rem;
    }

    .topbar-social-link {
        width: 24px;
        height: 24px;
    }

    .topbar-social-link svg {
        width: 12px;
        height: 12px;
    }

    .semid-pill-tag,
    .section-tag {
        font-size: 0.72rem;
        padding: 0.3rem 0.65rem;
    }

    .semid-whatsapp-float {
        bottom: 1rem;
        right: 1rem;
        width: 46px;
        height: 46px;
    }

    .semid-whatsapp-float svg {
        width: 24px;
        height: 24px;
    }

    .formulario-card-wrapper {
        padding: 1.5rem 0.95rem;
    }

    .comparativa-table {
        min-width: 400px;
    }

    .comparativa-table th.th-feature,
    .comparativa-table td.td-feature {
        min-width: 120px;
        max-width: 135px;
        font-size: 0.75rem;
        padding-left: 0.6rem;
    }

    .comparativa-table th.th-type {
        min-width: 75px;
        padding: 0.6rem 0.35rem;
    }

    .comparativa-table th.th-type .type-main {
        font-size: 0.8rem;
    }

    .comparativa-table th.th-type .type-sub {
        font-size: 0.62rem;
    }

    .table-scroll-hint {
        font-size: 0.72rem;
        padding: 0.35rem 0.75rem;
    }

    .comparativa-footnote {
        font-size: 0.72rem;
    }

    .map-brand-marker strong {
        font-size: 0.82rem;
    }

    .map-brand-marker span {
        font-size: 0.7rem;
    }

    .contacto-hero-benefits {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .footer-bottom-links a {
        font-size: 0.78rem;
    }
}

/* ==========================================================================
   7. ACCESIBILIDAD Y MOVIMIENTO REDUCIDO
   ========================================================================== */
@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;
    }
}
