:root {
    --naranja: #f73401;
    --naranja-oscuro: #d42c00;
    --naranja-suave: #fff0ea;
    --alto-pestanas: 64px;
    --abajo-seguro: env(safe-area-inset-bottom, 0px);
}

html { -webkit-tap-highlight-color: transparent; }
body {
    background: #f6f6f7;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}
.marca { color: var(--naranja) !important; font-weight: 800; letter-spacing: -.5px; }
.btn-naranja { background: var(--naranja); border-color: var(--naranja); color: #fff; font-weight: 600; }
.btn-naranja:hover, .btn-naranja:focus, .btn-naranja:active { background: var(--naranja-oscuro) !important; border-color: var(--naranja-oscuro) !important; color: #fff !important; }
.text-naranja { color: var(--naranja); }
.btn { border-radius: .75rem; }
.btn:active { transform: scale(.97); }
.card { border: 0; border-radius: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card-header { border-radius: 1rem 1rem 0 0 !important; }
.form-control, .form-select { border-radius: .75rem; }
.form-control:focus, .form-select:focus { border-color: #ffb08f; box-shadow: 0 0 0 .2rem rgba(247,52,1,.15); }
.form-check-input:checked { background-color: var(--naranja); border-color: var(--naranja); }
.nav-pills .nav-link { border-radius: 999px; color: #333; background: #fff; }
.nav-pills .nav-link.active { background: var(--naranja); }
.min-w-0 { min-width: 0; }

/* Encabezado y pestañas inferiores tipo app */
.barra-app { padding-top: env(safe-area-inset-top, 0px); }
.pestanas {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    display: flex; justify-content: space-around;
    height: calc(var(--alto-pestanas) + var(--abajo-seguro));
    padding-bottom: var(--abajo-seguro);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #ececec;
}
.pestanas a {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: #8a8a8f; text-decoration: none; font-size: .7rem; font-weight: 600;
}
.pestanas a i { font-size: 1.35rem; line-height: 1; transition: transform .15s; }
.pestanas a.activa { color: var(--naranja); }
.pestanas a.activa i { transform: translateY(-1px) scale(1.08); }
.pestanas .burbuja {
    position: absolute; top: 6px; left: 54%; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: #e5242b; color: #fff; font-size: .65rem; line-height: 18px; text-align: center;
}
@media (max-width: 767.98px) {
    body.con-pestanas { padding-bottom: calc(var(--alto-pestanas) + var(--abajo-seguro) + .5rem); }
}
@media (min-width: 768px) and (max-width: 991.98px) {
    body.panel.con-pestanas { padding-bottom: calc(var(--alto-pestanas) + var(--abajo-seguro) + .5rem); }
}

/* Aviso para instalar la app */
.instalar-app {
    position: fixed; left: .75rem; right: .75rem; z-index: 1045;
    bottom: calc(var(--alto-pestanas) + var(--abajo-seguro) + .75rem);
    display: flex; align-items: center; gap: .75rem; padding: .75rem;
    background: #fff; border-radius: 1rem; box-shadow: 0 .5rem 2rem rgba(0,0,0,.18);
    animation: subir .3s ease-out;
}
.instalar-app.d-none { display: none !important; }
.instalar-app img { width: 44px; height: 44px; border-radius: 10px; }
@media (min-width: 768px) { .instalar-app { left: auto; right: 1.5rem; bottom: 1.5rem; width: 380px; } }
@keyframes subir { from { transform: translateY(20px); opacity: 0; } }

.contenedor-aviso { bottom: calc(var(--alto-pestanas) + var(--abajo-seguro) + .5rem); z-index: 1090; }
@media (min-width: 768px) { .contenedor-aviso { bottom: 1rem; } }

/* Portada y búsqueda */
.hero {
    background: linear-gradient(135deg, #f73401 0%, #ff7a2e 100%);
    color: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 .5rem 1.5rem rgba(247,52,1,.25);
}
.hero .form-control, .hero .form-select { border: 0; }
@media (max-width: 575.98px) {
    .hero { border-radius: 0 0 1.5rem 1.5rem; margin: -1rem -.75rem 1rem; }
    .hero h1 { font-size: 1.35rem; }
}

.chips { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem .1rem .5rem; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: .25rem;
    width: 76px; padding: .6rem .25rem; border-radius: 1rem; background: #fff; color: #333; text-decoration: none;
    font-size: .72rem; font-weight: 600; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.chip .emoji { font-size: 1.6rem; line-height: 1; }
.chip.activo { background: var(--naranja); color: #fff; }

/* Tarjetas de negocio y productos */
.tarjeta-negocio { transition: box-shadow .15s, transform .1s; }
.tarjeta-negocio:hover { box-shadow: 0 .5rem 1rem rgba(0,0,0,.08); }
.tarjeta-negocio:active { transform: scale(.985); }
.logo-negocio { width: 72px; height: 72px; object-fit: cover; border-radius: 1rem; flex-shrink: 0; }
.logo-grande { width: 110px; height: 110px; object-fit: cover; border-radius: 1.25rem; }
.logo-mini { width: 48px; height: 48px; object-fit: cover; border-radius: .75rem; flex-shrink: 0; font-size: 1.2rem; }
.foto-producto { width: 88px; height: 88px; object-fit: cover; border-radius: .75rem; flex-shrink: 0; }
.foto-vacia {
    display: flex; align-items: center; justify-content: center;
    background: var(--naranja-suave); color: var(--naranja); font-size: 1.6rem;
}
.patrocinado { box-shadow: 0 0 0 2px #ffd2bf; background: #fffaf7; }
.etiqueta-patrocinado { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--naranja); font-weight: 700; }

.mapa { height: 340px; border-radius: 1rem; z-index: 0; }
.mapa-alto { height: 60vh; min-height: 380px; border-radius: 1rem; z-index: 0; }

.boton-carrito {
    position: fixed; left: 50%; transform: translateX(-50%); z-index: 1035;
    bottom: calc(1rem + var(--abajo-seguro));
    border-radius: 999px; padding-left: 1.5rem; padding-right: 1.5rem;
    box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.25); white-space: nowrap;
}
.boton-carrito:active { transform: translateX(-50%) scale(.97); }
@media (max-width: 767.98px) {
    .boton-carrito { bottom: calc(var(--alto-pestanas) + var(--abajo-seguro) + .75rem); width: calc(100% - 1.5rem); }
}

/* Listas estilo ajustes de app */
.lista-app { border-radius: 1rem; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.lista-app .list-group-item { border-left: 0; border-right: 0; }
.avatar {
    width: 76px; height: 76px; border-radius: 50%; background: var(--naranja-suave); color: var(--naranja);
    display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
}

/* Modales como hoja inferior en celular */
@media (max-width: 575.98px) {
    .modal-dialog-centered { align-items: flex-end; min-height: 100%; margin: 0; }
    .modal-dialog-centered .modal-content { border-radius: 1.25rem 1.25rem 0 0; border: 0; padding-bottom: var(--abajo-seguro); }
    .modal.fade .modal-dialog-centered { transform: translateY(40px); }
    .modal.show .modal-dialog-centered { transform: none; }
}

.pasos-ruta { max-height: 50vh; overflow: auto; }
.pasos-ruta li { padding: .5rem 0; border-bottom: 1px solid #eee; }

/* Panel */
.lateral { width: 240px; min-height: calc(100vh - 57px); }
.lateral .nav-link { color: #333; border-radius: .75rem; padding: .6rem .9rem; }
.lateral .nav-link.active, .lateral .nav-link:hover { background: var(--naranja-suave); color: var(--naranja); }
.contenido-panel { min-width: 0; }

.pedido-nuevo { box-shadow: inset 5px 0 0 var(--naranja), 0 1px 3px rgba(0,0,0,.06); animation: parpadeo 1.2s ease-in-out 3; }
@keyframes parpadeo { 50% { background: var(--naranja-suave); } }

.estado-linea { display: flex; gap: .25rem; }
.estado-linea span { flex: 1; height: 6px; border-radius: 3px; background: #e5e5e5; }
.estado-linea span.hecho { background: var(--naranja); }

/* Abierta como app instalada */
.modo-app body { user-select: none; -webkit-user-select: none; }
.modo-app input, .modo-app textarea { user-select: text; -webkit-user-select: text; }

.logo-barra { height: 40px; width: auto; display: block; }
@media (max-width: 575.98px) { .logo-barra { height: 34px; } }
@media (max-width: 991.98px) { .mapa-cerca { height: 42vh; min-height: 260px; } }

/* Pantallas de entrar / crear cuenta */
.cuenta-pantalla { max-width: 460px; margin: 0 auto; }
.cuenta-pantalla.ancho { max-width: 680px; }
.cuenta-hero {
    position: relative; overflow: hidden; color: #fff; padding: 2rem 1.25rem 3.5rem;
    background: radial-gradient(circle at 20% 10%, #ff8a3d 0%, transparent 45%), linear-gradient(140deg, #f73401 0%, #ff6a1a 60%, #ff9a3d 100%);
    border-radius: 1.5rem;
}
@media (max-width: 575.98px) { .cuenta-hero { border-radius: 0 0 2rem 2rem; margin: -1rem -.75rem 0; } }
.logo-pastilla {
    background: #fff; border-radius: 1.25rem; padding: .7rem 1.1rem; width: fit-content; max-width: 85%;
    box-shadow: 0 .75rem 2rem rgba(0,0,0,.18); animation: aparecer .5s ease-out;
}
.logo-pastilla img { height: 56px; width: auto; display: block; max-width: 100%; object-fit: contain; }
.flota { position: absolute; font-size: 1.8rem; opacity: .35; animation: flotar 6s ease-in-out infinite; }
.flota.f1 { left: 6%; top: 18%; }
.flota.f2 { right: 8%; top: 12%; animation-delay: -1.5s; }
.flota.f3 { left: 12%; bottom: 14%; animation-delay: -3s; }
.flota.f4 { right: 12%; bottom: 20%; animation-delay: -4.5s; }
@keyframes flotar { 50% { transform: translateY(-10px) rotate(8deg); } }
@keyframes aparecer { from { transform: scale(.9); opacity: 0; } }

.segmento {
    position: relative; z-index: 2; display: flex; gap: .25rem; width: fit-content; margin-top: -1.6rem;
    padding: .3rem; background: #fff; border-radius: 999px; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.12);
}
.segmento a { padding: .55rem 1.4rem; border-radius: 999px; color: #555; font-weight: 600; text-decoration: none; transition: background .2s; }
.segmento a.activo { background: var(--naranja); color: #fff; box-shadow: 0 .25rem .75rem rgba(247,52,1,.35); }

.cuenta-tarjeta { margin-top: 1rem; border-radius: 1.5rem; box-shadow: 0 .75rem 2rem rgba(0,0,0,.08); animation: subir .35s ease-out; }
.cuenta-hero + .cuenta-tarjeta, .cuenta-hero + .beneficios { margin-top: -1.75rem; position: relative; z-index: 2; }

.beneficios { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; }
.beneficios div {
    flex: 1; max-width: 140px; background: #fff; border-radius: 1rem; padding: .6rem .4rem; text-align: center;
    font-size: .75rem; font-weight: 600; box-shadow: 0 .25rem 1rem rgba(0,0,0,.06);
}
.beneficios span { display: block; font-size: 1.4rem; }

.campo-app { display: flex; align-items: stretch; background: #f6f6f7; border-radius: 1rem; border: 2px solid transparent; transition: border-color .2s, background .2s; }
.campo-app:focus-within { border-color: var(--naranja); background: #fff; }
.campo-app.con-error { border-color: #dc3545; }
.campo-icono { display: flex; align-items: center; padding: 0 .25rem 0 1rem; font-size: 1.2rem; color: #999; }
.campo-app:focus-within .campo-icono { color: var(--naranja); }
.campo-app .form-control, .campo-app .form-select { background: transparent; border: 0; box-shadow: none !important; border-radius: 1rem; }
.campo-app .form-floating > label { color: #888; }
.campo-ver { border: 0; color: #888; padding: 0 1rem; }

.boton-grande { padding-top: .9rem; padding-bottom: .9rem; font-size: 1.05rem; box-shadow: 0 .5rem 1.25rem rgba(247,52,1,.3); }

.fuerza { height: 6px; border-radius: 3px; background: #eee; overflow: hidden; margin-top: -.5rem; }
.fuerza span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }
.fuerza[data-nivel="1"] span { width: 25%; background: #dc3545; }
.fuerza[data-nivel="2"] span { width: 50%; background: #fd7e14; }
.fuerza[data-nivel="3"] span { width: 75%; background: #ffc107; }
.fuerza[data-nivel="4"] span { width: 100%; background: #198754; }

.tarjeta-negocio-cta {
    display: flex; align-items: center; gap: .9rem; margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 1.25rem;
    color: #fff; text-decoration: none; background: linear-gradient(135deg, #222 0%, #3b3b3b 100%);
    box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.15);
}
.tarjeta-negocio-cta:hover { color: #fff; }

.paso { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.paso span {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--naranja); color: #fff; font-size: .9rem;
}
.plan-opcion {
    display: block; position: relative; cursor: pointer; padding: 1rem; border-radius: 1.25rem; background: #f6f6f7;
    border: 2px solid transparent; transition: all .2s;
}
.plan-opcion input { position: absolute; opacity: 0; }
.plan-opcion .precio { font-size: 1.6rem; font-weight: 800; color: var(--naranja); }
.plan-opcion .precio small { font-size: .85rem; color: #777; font-weight: 500; }
.plan-opcion .marca-plan { color: #ccc; font-size: 1.3rem; }
.plan-opcion:has(input:checked) { border-color: var(--naranja); background: var(--naranja-suave); box-shadow: 0 .5rem 1.25rem rgba(247,52,1,.15); }
.plan-opcion:has(input:checked) .marca-plan { color: var(--naranja); }
