/* ============================================================
   pwa.css — Sección app / PWA + modales de instalación
   ============================================================ */

/* --- APP MOVIL --- */
.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.app-images {
    position: relative;
    height: 400px;
}

.phone-mockup {
    position: absolute;
    width: 220px;
    height: 440px;
    background: white;
    border-radius: 30px;
    border: 10px solid #1F2937;
    box-shadow: var(--shadow-lg);
}

.phone-1 {
    left: 40px;
    bottom: -40px;
    transform: rotate(-5deg);
}

.phone-2 {
    right: 40px;
    top: -20px;
    z-index: 2;
    transform: rotate(2deg);
}

.app-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    font-weight: 800;
    line-height: 1.1;
}

.app-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 30px 0 40px;
}

.app-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
}

.app-feature i {
    color: var(--primary);
    font-size: 18px;
    background: #F4EBFF;
    padding: 10px;
    border-radius: 8px;
}

.store-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.store-btn {
    background: black;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    cursor: pointer;
    border: none;
}


/* --- NUEVA SECCIÓN APP MÓVIL (PWA) --- */
.pwa-section {
    background: radial-gradient(circle at 20% 50%, #F5F1FF 0%, #FFFFFF 80%);
    border-radius: 32px;
    padding: 80px 60px;
    margin: 60px auto;
    max-width: 1240px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.pwa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Textos */
.pwa-eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: block;
}

.pwa-title {
    font-size: 56px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.pwa-title span {
    color: var(--primary);
}

.pwa-desc {
    color: var(--text-gray);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 480px;
}

/* Botón Principal */
.pwa-install-btn {
    background-color: var(--primary);
    color: white;
    padding: 16px 32px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
    margin-top: 10px;
    margin-bottom: 40px;
}

.pwa-install-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.4);
}

/* Fila de beneficios (Features) */
.pwa-features-row {
    display: flex;
    gap: 30px;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 30px;
}

.pwa-feat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-feat-icon {
    width: 40px;
    height: 40px;
    background-color: #F4EBFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-feat-icon i {
    color: var(--primary);
    font-size: 16px;
}

.pwa-feat-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    line-height: 1.3;
}

/* --- MOCKUPS DE CELULARES (CONTENEDORES PARA IMÁGENES) --- */
.pwa-visuals {
    position: relative;
    height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.css-phone {
    width: 252px;
    height: 520px;
    /* Se aumentó de 520px a 565px para evitar el recorte inferior */
    border-radius: 44px;
    background: #111827;
    border: 10px solid #111827;
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
}


/* La cámara/notch de arriba */
.css-phone-notch {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 75px;
    height: 20px;
    background: #111827;
    border-radius: 20px;
    z-index: 20;
}

/* Clase para que tu captura se adapte perfecto */

/* La imagen vuelve a ocupar todo el espacio de manera normal */
.phone-screen-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.hero-phone-updated .phone-screen-img {
    object-position: top;
}

.css-phone .phone-screen-img {
    object-position: top;
}

/* Celular 1 (Atrás/Izquierda) */
.phone-1 {
    left: 40px;
    top: 20px;
    transform: rotate(-10deg) scale(0.9) translateZ(-50px);
    z-index: 1;
    box-shadow: -20px 30px 60px rgba(0, 0, 0, 0.15);
}

/* Celular 2 (Frente/Derecha) */
.phone-2 {
    right: 40px;
    top: 40px;
    transform: rotate(5deg) translateZ(50px);
    z-index: 2;
    box-shadow: -10px 20px 50px rgba(139, 92, 246, 0.15), -30px 40px 80px rgba(0, 0, 0, 0.05);
}

/* Elementos decorativos flotantes */
.pwa-deco-star {
    position: absolute;
    top: 60px;
    left: 80px;
    color: #C4B5FD;
    font-size: 20px;
    animation: floatAnim 3s ease-in-out infinite;
}

.pwa-deco-sphere {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #E9D5FF, #8B5CF6);
    right: 30px;
    top: 180px;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
    animation: floatAnim 4s ease-in-out infinite reverse;
}

@keyframes floatAnim {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Responsive para los celulares */
@media (max-width: 1024px) {
    .pwa-visuals {
        height: 450px;
    }

    .phone-1 {
        left: 50%;
        transform: translateX(-65%) rotate(-10deg) scale(0.8);
        top: 20px;
    }

    .phone-2 {
        right: 50%;
        transform: translateX(65%) rotate(5deg) scale(0.9);
        top: 20px;
    }
}

@media (max-width: 600px) {
    .phone-1 {
        transform: translateX(-55%) rotate(-10deg) scale(0.65);
    }

    .phone-2 {
        transform: translateX(45%) rotate(5deg) scale(0.75);
    }
}

.ui-header {
    margin-bottom: 20px;
}

.ui-greeting {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.ui-sub {
    font-size: 10px;
    color: #6B7280;
}

.ui-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.ui-card-title {
    font-size: 10px;
    color: #6B7280;
    font-weight: 600;
    margin-bottom: 4px;
}

.ui-card-value {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 4px;
}

.ui-card-badge {
    font-size: 9px;
    color: #10B981;
    font-weight: 700;
}

.ui-graph {
    width: 100%;
    height: 40px;
    margin-top: 10px;
}

/* Celular 2 (Frente/Derecha - Logo) */
.phone-brand {
    right: 40px;
    top: 40px;
    transform: rotate(5deg) translateZ(50px);
    z-index: 2;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 800;
    box-shadow: -10px 20px 50px rgba(139, 92, 246, 0.4), -30px 40px 80px rgba(0, 0, 0, 0.1);
}

.phone-brand span {
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -1px;
}

.brand-icon {
    background: white;
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Elementos decorativos flotantes */
.pwa-deco-star {
    position: absolute;
    top: 60px;
    left: 80px;
    color: #C4B5FD;
    font-size: 20px;
    animation: floatAnim 3s ease-in-out infinite;
}

.pwa-deco-sphere {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #E9D5FF, #8B5CF6);
    right: 30px;
    top: 180px;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
    animation: floatAnim 4s ease-in-out infinite reverse;
}

@keyframes floatAnim {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .pwa-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .pwa-desc {
        margin: 0 auto 20px auto;
    }

    .pwa-features-row {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pwa-visuals {
        height: 450px;
    }

    .phone-ui {
        left: 50%;
        transform: translateX(-65%) rotate(-10deg) scale(0.8);
    }

    .phone-brand {
        right: 50%;
        transform: translateX(65%) rotate(5deg) scale(0.9);
        top: 20px;
    }
}

@media (max-width: 600px) {
    .pwa-section {
        padding: 50px 20px;
    }

    .pwa-title {
        font-size: 40px;
    }

    .pwa-features-row {
        flex-direction: column;
        align-items: flex-start;
        margin: 0 auto;
        width: max-content;
    }

    .phone-ui {
        transform: translateX(-55%) rotate(-10deg) scale(0.65);
    }

    .phone-brand {
        transform: translateX(45%) rotate(5deg) scale(0.75);
    }
}


/* --- ESTILOS ADICIONALES PARA PWA Y MODAL --- */

/* Botón único de instalación */
.install-btn {
    background-color: var(--primary);
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

.install-btn:hover {
    background-color: var(--primary-hover);
}

/* Overlay del Modal (Fondo oscuro semitransparente) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    /* Por encima del header */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenido del Modal */
.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    padding: 40px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Botón de cerrar X */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.modal-icon-box {
    width: 60px;
    height: 60px;
    background: #F3E8FF;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

.modal-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
}

/* Pasos de instalación */
.installation-steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
}

.installation-steps li {
    position: relative;
    padding-left: 50px;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--text-gray);
    line-height: 1.6;
}

.installation-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    background: #F3E8FF;
    color: var(--primary);
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    font-weight: 700;
    font-size: 14px;
}

.installation-steps li strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Icono de compartir de Safari (específico para iOS) */
.safari-share-icon {
    display: inline-block;
    vertical-align: middle;
    width: 18px;
    height: 22px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" /></svg>') no-repeat center;
    margin: 0 4px;
}

/* Responsive para el modal */
@media (max-width: 640px) {
    .modal-content {
        padding: 30px;
    }

    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* --- NUEVOS ESTILOS APPLE MODAL (TARJETA BLANCA) --- */
.apple-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    /* Fondo oscuro semitransparente */
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.apple-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.apple-modal-content {
    background: #FFFFFF;
    /* Fondo Blanco */
    width: 90%;
    max-width: 380px;
    border-radius: 36px;
    padding: 35px 28px;
    position: relative;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.15);
    color: #111827;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.apple-modal-overlay.active .apple-modal-content {
    transform: translateY(0);
}

/* Botón cerrar "X" */
.apple-modal-close {
    position: absolute;
    top: 25px;
    right: 30px;
    background: none;
    border: none;
    cursor: pointer;
    color: #4b5563;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.apple-modal-close:hover {
    color: #111827;
}

/* Encabezado */
.apple-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 20px;
}

/* Círculo rosa "BI" */
/* Nuevo estilo para el icono real de Biplo */
.apple-app-icon {
    width: 45px;
    height: 45px;
    border-radius: 30%;
    /* Mantiene la forma circular de tu diseño */
    object-fit: cover;
    /* Evita que la imagen se deforme */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Sombra suave para destacar el icono */
}

.apple-app-info h4 {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 2px;
}

.apple-app-info p {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

/* Pasos */
.apple-steps-list {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

.apple-steps-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

/* Círculos con sombra suave */
.apple-step-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background-color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    /* Sombra suave de los círculos */
}

.apple-step-icon svg {
    width: 20px;
    height: 20px;
}

.apple-steps-list li span {
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

/* Botón de redirección "Ir a Biplo" */
.apple-btn-go {
    width: 100%;
    background: none;
    border: none;
    padding: 10px;
    font-size: 16px;
    font-weight: 800;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.apple-btn-go:hover {
    opacity: 0.7;
}

/* ==================================================
   AJUSTE DE TARJETA Y MOCKUPS PARA APP/PWA (MÓVIL) - CORREGIDO
   ================================================== */


@media (max-width: 768px) {

    /* 1. Formato de tarjeta flotante con padding inferior ampliado para evitar cortes */
    .section-panel#seccion-app {
        margin-left: 16px !important;
        margin-right: 16px !important;
        padding: 40px 20px 55px 20px !important;
        /* Relleno inferior aumentado a 55px */
        border-radius: 24px !important;
        margin-top: 400px !important;
        margin-bottom: 40px !important;
        background: radial-gradient(circle at 50% 10%, #F5F1FF 0%, #FFFFFF 100%) !important;
    }

    /* Reestructuración de cuadrícula */
    .pwa-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* 2. OPTIMIZACIÓN DE MOCKUPS Y MARGEN DE SEGURIDAD */
    .pwa-visuals {
        height: 300px !important;
        margin-bottom: 45px !important;
        /* Añadido margen inferior para separar del texto rosa */
    }

    /* Celular 1 (Atrás / Izquierda) */
    .css-phone.phone-1 {
        left: 50% !important;
        top: -55px !important;
        right: auto !important;
        transform: translateX(-80%) rotate(-10deg) scale(0.54) !important;
        z-index: 1 !important;
        box-shadow: -15px 20px 40px rgba(0, 0, 0, 0.12) !important;
    }

    /* Celular 2 (Frente / Derecha) */
    .css-phone.phone-2 {
        left: 50% !important;
        top: -45px !important;
        right: auto !important;
        transform: translateX(-20%) rotate(8deg) scale(0.58) !important;
        z-index: 2 !important;
        box-shadow: -10px 15px 35px rgba(139, 92, 246, 0.15), -20px 30px 60px rgba(0, 0, 0, 0.08) !important;
    }

    /* Ocultamos elementos decorativos secundarios */
    .pwa-deco-star,
    .pwa-deco-sphere {
        display: none !important;
    }

    /* 3. ADAPTACIÓN DE TEXTOS Y ELEMENTOS INTERNOS */
    .pwa-content {
        text-align: left !important;
    }

    .pwa-title {
        font-size: 28px !important;
        line-height: 1.2 !important;
        letter-spacing: -1px !important;
        margin-bottom: 16px !important;
    }

    .pwa-desc {
        font-size: 14px !important;
        line-height: 1.5 !important;
        max-width: 100% !important;
        margin-bottom: 16px !important;
    }

    /* Botón de instalación adaptado */
    .pwa-install-btn {
        width: 100% !important;
        justify-content: center;
        padding: 14px 24px !important;
        font-size: 15px !important;
        margin-top: 10px !important;
        margin-bottom: 30px !important;
    }

    /* ==================================================
       FILA DE BENEFICIOS HORIZONTAL EN MÓVIL (3 COLUMNAS)
       ================================================== */

    /* Forzamos a que los 3 beneficios se alineen lado a lado */
    .pwa-features-row {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        /* 3 columnas iguales */
        gap: 8px !important;
        /* Separación compacta */
        padding-top: 24px !important;
        border-top: 1px solid var(--border) !important;
        width: 100% !important;
    }

    /* Cada ítem se organiza verticalmente: Icono arriba, texto abajo */
    .pwa-feat-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        /* Centrado de icono y texto */
        text-align: center !important;
        gap: 8px !important;
        padding: 0 !important;
    }

    /* Iconos compactos y circulares */
    .pwa-feat-icon {
        width: 36px !important;
        height: 36px !important;
        background-color: #F4EBFF !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .pwa-feat-icon i {
        color: var(--primary) !important;
        font-size: 14px !important;
    }

    /* Tipografía compacta y centrada */
    .pwa-feat-text {
        font-size: 11px !important;
        /* Tamaño legible y discreto para móvil */
        font-weight: 700 !important;
        line-height: 1.3 !important;
        color: var(--text-gray) !important;
        white-space: normal !important;
        /* Permite salto de línea natural */
    }
}

/* ==================================================
   UNIFICACIÓN DE ESTILOS: SECCIÓN APP IGUAL A "QUÉ ES BIPLO"
   ================================================== */

/* Para Escritorio (Computadora) */
#seccion-app {
    background: var(--bg-light) !important;
    /* Fondo plano #F9FAFB */
    box-shadow: none !important;
    /* Sin sombras flotantes */
    border: none !important;
    /* Sin bordes adicionales */
}

/* Para Móviles (Iguala exactamente a .section-panel.what-is) */
@media (max-width: 768px) {
    .section-panel#seccion-app {
        background: var(--bg-light) !important;
        /* Fondo plano #F9FAFB */
        border-radius: 24px !important;
        /* Mismo redondeado de esquina */
        margin: 40px 16px !important;
        /* Mismos márgenes externos */
        border: none !important;
        /* Sin bordes */
        box-shadow: none !important;
        /* Sin sombras */

        /* Ajuste de padding: conserva los 55px inferiores para que los celulares 
   no tapen el texto rosa de abajo */
        padding: 40px 24px 55px 24px !important;
    }
}

@media (max-width: 768px) {

    /* Desplaza los teléfonos hacia arriba en móviles */
    .css-phone.phone-1 {
        top: -120px !important;
        /* Originalmente estaba en -55px */
    }

    .css-phone.phone-2 {
        top: -100px !important;
        /* Originalmente estaba en -45px */
    }
}

@media (max-width: 768px) {

    /* Reduce el espacio vacío debajo de los teléfonos y sube el texto */
    .pwa-visuals {
        height: 240px !important;
        /* Reduce la altura del contenedor (antes 300px) */
        margin-bottom: 50px !important;
        /* Reduce el margen con el texto (antes 45px) */
    }
}

