@media (max-width: 768px) {

    .btn,
    .btn-lg,
    .producto-btn,
    .pricing-button-home,
    .boton-portada-borde,
    .gate-btn {
        padding: 12px 24px !important;
        font-size: 0.95rem !important;
        width: 100% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 50px !important;
        white-space: normal;
        margin-bottom: 10px;
    }

    .d-flex.gap-3.flex-wrap .btn {
        margin-bottom: 8px;
        width: 100% !important;
        flex: 1 1 100%;
    }


    .navbar {
        position: relative;
        justify-content: flex-end !important;
        min-height: 60px;
        width: 100%;
    }

    .navbar-brand {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 0 !important;
        max-width: 60%;
        display: flex;
        justify-content: center;
        z-index: 10;
        top: 5px;
    }

    .navbar-toggler {
        margin-left: auto !important;
        z-index: 20;
        border: none !important;
        padding: 5px !important;
    }

    .site-header {
        overflow: visible !important;
    }

    .navbar-collapse {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #ffffff !important;
        padding: 25px 20px !important;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
        border-top: 1px solid #f1f5f9 !important;
        z-index: 998 !important;
        max-height: 85vh;
        overflow-y: auto;
    }

    .navbar-collapse.show {
        display: block !important;
        animation: slideDownMenu 0.3s ease forwards;
        visibility: visible !important;
        opacity: 1 !important;
    }

    @keyframes slideDownMenu {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-item {
        margin-bottom: 5px;
        width: 100%;
    }

    .nav-link-custom {
        display: block;
        padding: 14px 0 !important;
        font-size: 1.05rem;
        border-bottom: 1px solid #f8fafc;
        width: 100%;
        color: #1e293b !important;
        text-align: center;
    }

    html body .nav-link-clientes {
        border: none !important;
        background: transparent !important;
        color: #334155 !important;
        font-weight: 500 !important;
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 14px 0 !important;
    }

    html body .btn-menu-presupuesto,
    html body .btn-solicitar-pro {
        display: block !important;
        width: 100% !important;
        margin-top: 25px !important;
        background: #02273E !important;
        color: #fff !important;
        padding: 16px !important;
        border-radius: 50px !important;
        font-weight: 700 !important;
        text-transform: uppercase;
        letter-spacing: 1px;
        text-align: center;
    }


    .modal-dialog {
        margin: 10px !important;
        width: auto !important;
        max-width: 100% !important;
    }

    .modal-content {
        border-radius: 15px !important;
        overflow: hidden !important;
        max-width: 95vw !important;
    }

    .modal-body button[type="submit"],
    #serviceForm button[type="submit"],
    .wpcf7-submit {
        width: 100% !important;
        display: block !important;
        float: none !important;
        margin: 20px 0 0 0 !important;
    }

    .modal-footer {
        display: flex !important;
        flex-direction: column;
        width: 100% !important;
    }


    /* Portada - Reducir espacio en blanco */
    .altura-minima-portada {
        min-height: auto !important;
        padding-top: 50px !important;
        padding-bottom: 20px !important;
    }

    .espaciado-portada {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Sección de productos */
    .seccion-productos-overlap {
        margin-top: 0 !important;
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
        background-color: #f8fafc !important;
    }

    /* ====== SWIPER PRODUCTOS - CENTRADO FORZADO EN MÓVIL ====== */

    /* SOLUCIÓN DEFIN ITIVA: Escapar del contenedor Bootstrap */
    .seccion-productos-overlap .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow-x: hidden !important;
    }

    /* Breakout: Forzar que el swiper ocupe todo el ancho del viewport */
    .swiper-productos {
        width: 100vw !important;
        position: relative !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        padding: 40px 0 !important;
        overflow: visible !important;
    }

    /* Wrapper - CRÍTICO: No forzar display flex, dejar que Swiper lo maneje */
    .swiper-productos .swiper-wrapper {
        align-items: center !important;
        padding: 0 !important;
    }

    /* Slides - Ancho fijo para cálculo correcto de Swiper */
    .swiper-productos .swiper-slide {
        width: 280px !important;
        max-width: 280px !important;
        min-width: 280px !important;
        flex-shrink: 0 !important;
        opacity: 0.5 !important;
        transform: scale(0.88) !important;
        transition: all 0.35s ease !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .swiper-productos .swiper-slide-active {
        opacity: 1 !important;
        transform: scale(1) !important;
        z-index: 10 !important;
    }

    .swiper-productos .producto-card {
        padding: 20px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    .swiper-productos .producto-imagen-wrapper {
        height: 140px !important;
    }

    .swiper-productos .producto-titulo {
        font-size: 1.1rem !important;
        margin-bottom: 10px !important;
    }

    .swiper-productos .producto-precio {
        font-size: 1.4rem !important;
    }

    .swiper-productos .producto-features li {
        font-size: 0.8rem !important;
        margin-bottom: 5px !important;
    }

    /* Flechas de navegación del carousel */
    .swiper-button-prev-prod,
    .swiper-button-next-prod {
        width: 42px !important;
        height: 42px !important;
        background-color: rgba(2, 39, 62, 0.9) !important;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 20 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin-top: 0 !important;
        opacity: 0.85 !important;
        transition: all 0.3s ease !important;
    }

    .swiper-button-prev-prod:active,
    .swiper-button-next-prod:active {
        opacity: 1 !important;
        transform: translateY(-50%) scale(1.05) !important;
    }

    .swiper-button-prev-prod {
        left: 5px !important;
    }

    .swiper-button-next-prod {
        right: 5px !important;
    }

    .swiper-button-prev-prod i,
    .swiper-button-next-prod i {
        color: #ffffff !important;
        font-size: 1.1rem !important;
    }
}


@media (max-width: 480px) {
    .altura-minima-portada {
        min-height: 65vh !important;
    }

    /* Tarjetas ligeramente más pequeñas en pantallas muy pequeñas */
    .swiper-productos .swiper-slide {
        width: 260px !important;
        max-width: 260px !important;
    }

    /* Flechas con más margen interno en pantallas pequeñas */
    .swiper-button-prev-prod,
    .swiper-button-next-prod {
        width: 40px !important;
        height: 40px !important;
    }

    .swiper-button-prev-prod {
        left: 3px !important;
    }

    .swiper-button-next-prod {
        right: 3px !important;
    }

    .swiper-button-prev-prod i,
    .swiper-button-next-prod i {
        font-size: 1rem !important;
    }

    /* ====== BOTONES DE PRODUCTOS - ALINEACIÓN PERFECTA EN MÓVIL ====== */
    .swiper-productos .producto-card .d-flex.gap-2 {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin-top: auto !important;
    }

    .swiper-productos .producto-btn-secundario,
    .swiper-productos .producto-btn {
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        padding: 12px 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.875rem !important;
        font-weight: 600 !important;
        border-radius: 25px !important;
        text-decoration: none !important;
        white-space: nowrap !important;
        transition: all 0.3s ease !important;
    }

    .swiper-productos .producto-btn-secundario {
        flex: 0 0 auto !important;
        min-width: 110px !important;
        border: 2px solid #e5e7eb !important;
        background: white !important;
        color: #374151 !important;
    }

    .swiper-productos .producto-btn {
        flex: 1 1 auto !important;
        min-width: 120px !important;
    }

    .btn,
    .btn-lg {
        font-size: 0.9rem !important;
        padding: 10px 20px !important;
    }
}