/* Panabordados — ajustes responsive y accesibilidad (todas las páginas) */

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

html {
    scroll-padding-top: 5rem;
}

@media (min-width: 1280px) {
    html {
        scroll-padding-top: 5.5rem;
    }
}

img,
video,
canvas {
    max-width: 100%;
}

/* Volver a index#catalogo desde páginas de catálogo */
a.btn-catalog-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.65rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(0, 0, 0, 0.16);
    color: #171717;
    background: #ffffff;
    transition: border-color 0.2s ease, background 0.2s ease;
}

a.btn-catalog-back:hover {
    border-color: rgba(30, 58, 143, 0.45);
    background: rgba(0, 0, 0, 0.02);
}

a.btn-catalog-back:focus-visible {
    outline: 2px solid #1e3a8f;
    outline-offset: 2px;
}

/* Evita zoom automático en iOS al enfocar caminos con fuente muy pequeña */
@media (max-width: 639px) {

    input,
    textarea,
    select {
        font-size: 1rem !important;
    }
}

/* Toasts (p. ej. index): no sobresalen del viewport ni quedan bajo notch */
.toast {
    max-width: min(22rem, calc(100vw - 2.5rem));
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
    .toast {
        max-width: 24rem;
        right: 2rem;
        bottom: 2rem;
    }
}

/* Botón flotante WA: respeta área segura en móvil */
a.wa-float-btn {
    bottom: max(1.25rem, calc(env(safe-area-inset-bottom, 0px) + 0.75rem)) !important;
    left: max(1rem, calc(env(safe-area-inset-left, 0px) + 0.75rem)) !important;
}

/* Usuarios que piden menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .animate-marquee {
        animation: none !important;
        transform: none !important;
    }

    .animate-float,
    .spin-slow {
        animation: none !important;
    }
}
