body {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── Navbar base ── */
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 6px 4px;
    transition: color 0.2s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    border-radius: 2px;
    transition: width 0.25s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Cliente (verde) */
.nav-customer .nav-link {
    color: rgba(255, 255, 255, 0.75);
}

.nav-customer .nav-link:hover {
    color: #fff;
}

.nav-customer .nav-link::after {
    background: #fff;
}

.nav-customer .nav-link.active {
    color: #fff;
}

.nav-customer .nav-link.active::after {
    width: 100%;
}

/* Admin (rojo oscuro) */
.nav-admin .nav-link {
    color: rgba(255, 255, 255, 0.75);
}

.nav-admin .nav-link:hover {
    color: #fff;
}

.nav-admin .nav-link::after {
    background: #fbbf24;
}

/* Botón logout */
.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Cart badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #fbbf24;
    color: #14532d;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Divider vertical */
.nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
}

/* User pill */
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

/* Mobile menu link */
.mobile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.15s;
}

.mobile-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mobile-link i {
    font-size: 1.15rem;
}

/* ══════════════════════════════════════════
   CORRECCIONES CROSS-BROWSER
══════════════════════════════════════════ */

/* ADVERTENCIA — Safari: position sticky requiere prefijo -webkit- para
   compatibilidad con Safari < 13 y evitar fallos si un ancestro tiene overflow */
nav {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ADVERTENCIA — backdrop-filter: fallback para Firefox < 103.
   Firefox ignora backdrop-filter; el alpha del background actúa como fallback. */
#chatbot-modal>div:first-child {
    background: rgba(0, 0, 0, 0.65);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* INFORMATIVO — Safari: ocultar spin buttons en inputs readonly
   Safari muestra controles de incremento/decremento incluso en inputs readonly. */
input[readonly]::-webkit-inner-spin-button,
input[readonly]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[readonly][type=number] {
    -moz-appearance: textfield;
}

/* INFORMATIVO — line-clamp: asegurar compatibilidad cross-browser.
   Tailwind CDN genera -webkit-line-clamp, pero agregamos el estándar
   por si el CDN no lo incluye. */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

/* ADVERTENCIA — prefers-reduced-motion: respetar la configuración de
   accesibilidad del sistema operativo. Los elementos con animate-bounce
   y animate-pulse dejan de animar cuando el usuario prefiere movimiento reducido.
   Cubre: icono de campana en menu.html, puntos del chatbot, laser del scanner. */
@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;
    }
}

/* INFORMATIVO — input[type=date] placeholder para Safari < 14.1
   Safari antiguo no soporta el date picker nativo y muestra un text input.
   El placeholder indica el formato esperado al usuario. */
input[type="date"]:not(:valid):before {
    content: attr(placeholder);
    color: #9ca3af;
}