/* ============================================================
   Once punto Once — Estilos principales
   ============================================================ */

/* ── Base ── */
body {
    font-family: 'Inter', sans-serif;
    min-height: max(884px, 100dvh);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ── Padding inferior en mobile para el bottom nav ── */
@media (max-width: 767px) {
    main, footer {
        padding-bottom: 80px;
    }
}

/* ============================================================
   Scroll animations
   ============================================================ */
.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.animated {
    opacity: 1;
}

/* ============================================================
   Bottom Nav — app-style
   ============================================================ */
#bottom-nav {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(241, 245, 249, 0.9);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.08);
    /* Safe area para iPhone con notch */
    padding-bottom: env(safe-area-inset-bottom, 8px);
}

#bottom-nav a {
    position: relative;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#bottom-nav a:active {
    transform: scale(0.9);
}

/* Píldora de fondo activo */
#bottom-nav a .nav-pill {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 32px;
    background: #197fe6;
    border-radius: 10px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
    opacity: 0;
    z-index: 0;
}

#bottom-nav a.active .nav-pill {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
}

#bottom-nav a .nav-icon,
#bottom-nav a .nav-label {
    position: relative;
    z-index: 1;
}

/* Ícono activo: relleno blanco */
#bottom-nav a.active .nav-icon {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    color: #fff !important;
}

#bottom-nav a.active .nav-label {
    color: #197fe6;
    font-weight: 700;
}

/* Indicador puntito superior */
#bottom-nav a.active::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #197fe6;
    border-radius: 50%;
}

/* Salto al hacer clic activo */
#bottom-nav a.active {
    transform: translateY(-2px);
}

/* Ripple tap animation */
@keyframes navTap {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.85) translateY(-1px); }
    70%  { transform: scale(1.08) translateY(-3px); }
    100% { transform: scale(1)   translateY(-2px); }
}

#bottom-nav a.just-tapped {
    animation: navTap 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ============================================================
   WhatsApp Chat Widget
   ============================================================ */
#wa-panel {
    transform-origin: bottom right;
    transform: scale(0.85) translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

#wa-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* WA brand gradient header */
.wa-header {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
}

/* Custom select arrow */
#wa-motivo {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2325D366' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

/* Chat bubble */
.wa-bubble {
    background: #e9fbe4;
    border-radius: 18px 18px 18px 4px;
}

/* Typing dots animation */
@keyframes waDot {
    0%, 60%, 100% { transform: translateY(0);    opacity: .4; }
    30%            { transform: translateY(-4px); opacity: 1;  }
}

.wa-dot {
    animation: waDot 1.2s ease-in-out infinite;
}

.wa-dot:nth-child(2) { animation-delay: .2s; }
.wa-dot:nth-child(3) { animation-delay: .4s; }

/* Float button pulse ring */
#wa-fab-btn .wa-ping {
    animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}

@keyframes ping {
    75%, 100% { transform: scale(1.9); opacity: 0; }
}

/* Mobile: WhatsApp sube para no tapar el bottom nav */
@media (max-width: 767px) {
    #wa-fab-btn { bottom: 84px; }
    #wa-panel   {
        bottom: 160px;
        right: 16px;
        width: calc(100vw - 32px);
        max-width: 360px;
    }
}
