/* MiPlato — menú público. Mobile-first, liviano, sin fuentes externas. */
.mp-public { background: #fff; padding-bottom: 5.5rem; }
.mp-wrap { max-width: 980px; margin: 0 auto; padding: 0 1rem; }

/* Portada */
/* Altura proporcional al ancho: ~16:9 en el celular, más baja en pantallas anchas (máx. 400 px). */
.mp-hero {
    height: clamp(210px, 56vw, 400px); background: linear-gradient(135deg, #13203d 0%, #1b2b52 50%, #0b4aa2 100%);
    background-size: cover; background-position: center; position: relative;
}
.mp-hero-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,.25)); }

/* Comercio */
.mp-store { position: relative; margin-top: -40px; }
.mp-store-top { display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; }
.mp-logo-img {
    width: 76px; height: 76px; border-radius: 18px; object-fit: contain; background: #fff;
    border: 3px solid #fff; box-shadow: 0 4px 14px rgba(28,25,23,.15); flex-shrink: 0;
}
.mp-logo-fallback { display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: var(--mp-primary); background: var(--mp-primary-soft); }
.mp-store-id { min-width: 0; }
.mp-store h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .2rem; line-height: 1.15; }
.mp-state { display: inline-block; font-size: .78rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; }
.mp-state.is-open { background: #dcfce7; color: #166534; }
.mp-state.is-closed { background: #fee2e2; color: #991b1b; }
.mp-desc { color: var(--mp-muted); margin: .7rem 0 .4rem; font-size: .92rem; }
.mp-facts { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.mp-facts li { font-size: .8rem; background: var(--mp-bg); border-radius: 999px; padding: .2rem .65rem; }
.mp-store-actions { display: flex; gap: 1rem; margin: .6rem 0 .2rem; }
.mp-link-btn { background: none; border: 0; padding: 0; color: var(--mp-primary-dark); font-weight: 600; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }

/* Categorías y búsqueda */
.mp-cats {
    position: sticky; top: 0; z-index: 20; background: #fff; display: flex; gap: .4rem; overflow-x: auto;
    padding: .7rem 0; margin-top: .6rem; border-bottom: 1px solid var(--mp-line); scrollbar-width: none;
}
.mp-cats::-webkit-scrollbar { display: none; }
.mp-cats a {
    flex-shrink: 0; text-decoration: none; color: var(--mp-ink); font-size: .85rem; font-weight: 600;
    padding: .35rem .8rem; border-radius: 999px; background: var(--mp-bg);
}
.mp-cats a.is-active { background: var(--mp-ink); color: #fff; }
.mp-cats a.has-icon { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .85rem .25rem .3rem; }
.mp-cats a.has-icon img { width: 26px; height: 26px; border-radius: 50%; background: #fff; padding: 1px; }
.mp-search { margin: .75rem 0 .25rem; }
.mp-search input { width: 100%; border: 1px solid var(--mp-line); border-radius: 12px; padding: .6rem .9rem; font-size: .95rem; background: var(--mp-bg); }
.mp-search input:focus { outline: 2px solid #7aa3dd; background: #fff; }

/* Productos */
.mp-cat { scroll-margin-top: 64px; padding-top: .6rem; }
.mp-cat h2 { font-size: 1.05rem; font-weight: 700; margin: .7rem 0 .2rem; display: flex; align-items: center; gap: .5rem; }
.mp-cat h2 img { width: 34px; height: 34px; flex-shrink: 0; }
.mp-item {
    display: flex; gap: .8rem; width: 100%; text-align: left; background: none; border: 0;
    border-bottom: 1px solid var(--mp-line); padding: .85rem 0; align-items: flex-start; color: inherit;
}
.mp-item:active { background: var(--mp-bg); }
.mp-item.is-out { opacity: .55; cursor: not-allowed; }
.mp-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.mp-item-name { font-weight: 650; font-size: .98rem; line-height: 1.25; }
.mp-item-desc { color: var(--mp-muted); font-size: .84rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mp-item-price { font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; }
.mp-item-img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--mp-bg); }
.mp-badge { font-size: .68rem; font-weight: 700; background: var(--mp-primary-soft); color: var(--mp-primary-dark); padding: .08rem .4rem; border-radius: 6px; vertical-align: middle; }
.mp-out { font-size: .72rem; font-weight: 700; color: #991b1b; background: #fee2e2; padding: .05rem .4rem; border-radius: 6px; margin-left: .3rem; }
.mp-empty, .mp-noresults { text-align: center; color: var(--mp-muted); padding: 2.5rem 1rem; }

/* Barra del carrito */
.mp-cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom)); background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0)); }
.mp-cartbar button {
    display: flex; align-items: center; gap: .75rem; width: 100%; max-width: 688px; margin: 0 auto; border: 0;
    background: var(--mp-primary); color: #fff; font-weight: 700; padding: .85rem 1rem; border-radius: 14px;
    box-shadow: 0 8px 24px rgba(11,74,162,.35);
}
.mp-cartbar button span:nth-child(2) { flex: 1; text-align: left; }
.mp-cart-count { background: rgba(255,255,255,.25); border-radius: 8px; padding: .05rem .5rem; min-width: 1.8rem; text-align: center; }

/* Modal de producto */
.mp-pm-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; margin-bottom: .75rem; }
.mp-group { border-top: 1px solid var(--mp-line); padding-top: .75rem; margin-top: .75rem; }
.mp-group-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
.mp-group-head strong { font-size: .95rem; }
.mp-group-head small { color: var(--mp-muted); font-size: .75rem; }
.mp-group-head .is-req { color: var(--mp-primary-dark); font-weight: 700; }
.mp-opt { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; font-size: .92rem; }
.mp-opt input { width: 1.15rem; height: 1.15rem; accent-color: var(--mp-primary); flex-shrink: 0; }
.mp-opt span { flex: 1; }
.mp-opt em { font-style: normal; color: var(--mp-muted); font-size: .85rem; }
.mp-opt.is-out { opacity: .5; }
.mp-qty { display: flex; align-items: center; gap: .2rem; border: 1px solid var(--mp-line); border-radius: 12px; padding: .15rem; }
.mp-qty button { width: 2.2rem; height: 2.2rem; border: 0; background: var(--mp-bg); border-radius: 9px; font-size: 1.2rem; font-weight: 700; line-height: 1; }
.mp-qty span { min-width: 1.8rem; text-align: center; font-weight: 700; }

/* Carrito y checkout */
.mp-cart-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.mp-cart-list li { display: flex; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--mp-line); align-items: flex-start; }
.mp-cart-list .mp-cl-text { flex: 1; min-width: 0; font-size: .9rem; }
.mp-cart-list .mp-cl-text small { display: block; color: var(--mp-muted); }
.mp-cart-list .mp-cl-price { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.mp-cart-list .mp-qty button { width: 1.8rem; height: 1.8rem; font-size: 1rem; }
.mp-legend { font-size: .95rem; font-weight: 700; margin-bottom: .5rem; }
.mp-seg { display: flex; gap: .5rem; }
.mp-seg label { flex: 1; border: 1.5px solid var(--mp-line); border-radius: 12px; padding: .6rem; text-align: center; font-weight: 600; font-size: .9rem; cursor: pointer; }
.mp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.mp-seg label:has(input:checked) { border-color: var(--mp-primary); background: var(--mp-primary-soft); color: var(--mp-primary-dark); }
.mp-pay { display: flex; flex-direction: column; gap: .4rem; }
.mp-pay label { display: flex; gap: .6rem; align-items: flex-start; border: 1.5px solid var(--mp-line); border-radius: 12px; padding: .6rem .75rem; cursor: pointer; font-size: .92rem; font-weight: 600; }
.mp-pay label:has(input:checked) { border-color: var(--mp-primary); background: var(--mp-primary-soft); }
.mp-pay input { margin-top: .2rem; accent-color: var(--mp-primary); }
.mp-pay small { display: block; font-weight: 400; color: var(--mp-muted); font-size: .8rem; }
.mp-field-error { color: #b91c1c; font-size: .8rem; }
.mp-field-error:empty { display: none; }
.mp-totals { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; margin: 0; font-size: .92rem; }
.mp-totals dt { font-weight: 400; color: var(--mp-muted); }
.mp-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mp-totals .mp-total { font-weight: 700; color: var(--mp-ink); font-size: 1.05rem; }

/* Seguimiento */
.mp-track { max-width: 560px; margin: 0 auto; padding: 1.25rem 1rem; }
.mp-track-card { border: 1px solid var(--mp-line); border-radius: 16px; padding: 1.1rem; margin-bottom: 1rem; }
.mp-steps { list-style: none; padding: 0; margin: .5rem 0 0; }
.mp-steps li { position: relative; padding: 0 0 .9rem 1.6rem; color: var(--mp-muted); font-size: .92rem; }
.mp-steps li::before { content: ""; position: absolute; left: .25rem; top: .3rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--mp-line); }
.mp-steps li::after { content: ""; position: absolute; left: .55rem; top: 1.05rem; bottom: 0; width: 2px; background: var(--mp-line); }
.mp-steps li:last-child::after { display: none; }
.mp-steps li.is-done { color: var(--mp-ink); }
.mp-steps li.is-done::before { background: var(--mp-ok); }
.mp-steps li.is-current { color: var(--mp-ink); font-weight: 700; }
.mp-steps li.is-current::before { background: var(--mp-primary); box-shadow: 0 0 0 4px var(--mp-primary-soft); }
.mp-big-status { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }

.mp-footer { text-align: center; font-size: .75rem; color: var(--mp-muted); padding: 2rem 1rem 1rem; }
.mp-footer a { color: inherit; font-weight: 700; text-decoration: none; }
.mp-footer a span { color: var(--mp-primary); }

/* Avisos del seguimiento (cliente) */
.mp-track-alerts { max-width: 560px; margin: 0 auto; padding: 1rem 1rem 0; }
.mp-alert-btn { width: 100%; display: flex; align-items: center; gap: .75rem; text-align: left; border: 2px solid var(--mp-primary); background: var(--mp-primary-soft); color: var(--mp-ink); border-radius: 16px; padding: .7rem .9rem; }
.mp-alert-btn .mp-alert-ico { font-size: 1.6rem; line-height: 1; }
.mp-alert-btn.is-on { border-color: #15803d; background: #dcfce7; }
.mp-track-flash { animation: mpFlash 1.2s ease-out 2; }
@keyframes mpFlash { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.55); } 100% { box-shadow: 0 0 0 14px rgba(21,128,61,0); } }

/* Calificación (seguimiento) */
.mp-stars { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.mp-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mp-stars label { font-size: 2.1rem; line-height: 1; color: #d6dbe4; cursor: pointer; transition: color .1s, transform .1s; }
.mp-stars label:hover, .mp-stars label:hover ~ label, .mp-stars input:checked ~ label { color: #f5b301; }
.mp-stars input:focus-visible + label { outline: 2px solid var(--mp-primary); border-radius: 4px; }
.mp-stars-show { font-size: 1.5rem; color: #f5b301; letter-spacing: .1em; }
.mp-stars-show span { color: #d6dbe4; }
.mp-rating { display: inline-flex; align-items: center; gap: .2rem; font-weight: 700; font-size: .85rem; color: var(--mp-ink); }
.mp-rating::before { content: "★"; color: #f5b301; }
.mp-rating small { color: var(--mp-muted); font-weight: 400; }

/* Productos en tarjetas */
.mp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: .5rem 0 1rem; }
@media (min-width: 576px) { .mp-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.mp-card { position: relative; display: flex; flex-direction: column; text-align: left; background: #fff; border: 1px solid var(--mp-line); border-radius: 14px; padding: .55rem .6rem .7rem; color: inherit; transition: box-shadow .15s, transform .15s, border-color .15s; }
.mp-card:hover { box-shadow: 0 8px 20px rgba(19,32,61,.1); transform: translateY(-1px); border-color: #cfd7e3; }
.mp-card:active { transform: none; }
.mp-card.is-out { opacity: .6; cursor: not-allowed; }
.mp-card-img { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; border-radius: 10px; background: var(--mp-bg); overflow: hidden; margin-bottom: .55rem; }
.mp-card-img img { width: 100%; height: 100%; object-fit: contain; }
.mp-card-img img.mp-card-ph { width: 46%; height: 46%; opacity: .55; }
.mp-card-badge { position: absolute; top: .35rem; left: .35rem; }
.mp-card-out { position: absolute; bottom: .35rem; left: .35rem; background: #fff; }
.mp-card-name { font-weight: 650; font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.mp-card-price { font-weight: 800; font-size: 1rem; margin-top: auto; padding-top: .45rem; font-variant-numeric: tabular-nums; }
.mp-card-add { position: absolute; right: .55rem; bottom: .6rem; width: 30px; height: 30px; border-radius: 50%; background: var(--mp-primary); color: #fff; font-weight: 700; font-size: 1.15rem; line-height: 30px; text-align: center; box-shadow: 0 3px 8px rgba(11,74,162,.35); }
.mp-card.is-out .mp-card-add { display: none; }
