/* =========================================================
   Mi pedido · mini-carrito (web v5) — se carga en TODAS las páginas, después de v5.css y home-ui.css.
   Panel lateral amplio con fotos grandes (pantalla completa en móvil). Lo crea js/carrito.js.
   1. Base  2. Fotos y vacío (compartidos con pedido.html)  3. Mini-carrito  4. Móvil
   ========================================================= */
:root {
  --cp-acento-txt: #8F5A22;          /* mostaza oscuro, AA sobre blanco y crema */
  --cp-linea: rgba(31, 26, 21, .1);
  --cp-borde: rgba(31, 26, 21, .16);
  --cp-error: #B3261E;
}

/* ---------- 1. Base ---------- */
.visualmente-oculto { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html:has(dialog.mc[open]) { overflow: hidden; }
.mc [hidden] { display: none !important; }
.wa-ico { width: 21px; height: 21px; flex: none; }
/* Al agregar una zona, el carrito del header late una vez (en todas las páginas) */
.nav__resumen--pulso { animation: mc-pulso .6s var(--curva); }
.nav__resumen--pulso .nav__contador { animation: mc-salto .6s var(--curva); }
@keyframes mc-pulso { 0% { box-shadow: 0 0 0 0 rgba(206, 137, 59, .45); } 100% { box-shadow: 0 0 0 12px rgba(206, 137, 59, 0); } }
@keyframes mc-salto { 0%, 100% { transform: none; } 40% { transform: scale(1.35); } }

/* ---------- 2. Fotos y estado vacío ---------- */
.mc-item__foto, .pd-item__foto { position: relative; display: block; overflow: hidden; flex: none; background: var(--crema-2); }
.mc-item__foto img, .pd-item__foto img { width: 100%; height: 100%; object-fit: cover; }
.foto-vacia { display: grid; place-items: center; width: 100%; height: 100%; color: var(--cp-acento-txt); }
.foto-vacia .lucide { width: 40%; height: 40%; max-width: 32px; max-height: 32px; }
.vacio { display: flex; flex-direction: column; align-items: center; text-align: center; }
.vacio__icono { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--acento-suave); color: var(--cp-acento-txt); }
.vacio__icono .lucide { width: 26px; height: 26px; }
.vacio__t { margin-top: 18px; font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -0.03em; }
.vacio__ctas { display: grid; gap: 10px; width: 100%; max-width: 300px; margin-top: 22px; }
.vacio__cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: var(--r-pildora); background: var(--acento); color: var(--blanco); font-size: 15px; font-weight: 600; transition: background-color .2s var(--curva-hover); }
.vacio__cta:hover { background: var(--acento-hondo); }
.vacio__cta--b { background: var(--blanco); color: var(--texto); }
.vacio__cta--b:hover { background: var(--crema-2); }
.vacio__cta .lucide { width: 18px; height: 18px; }

/* ---------- 3. Mini-carrito: panel lateral derecho amplio ---------- */
dialog.mc { position: fixed; inset: 0 0 0 auto; width: min(500px, 100vw); height: 100dvh; margin: 0; padding: 0; border: 0; max-width: none; max-height: none; background: transparent; color: var(--texto); overflow: visible; transform: translateX(100%); transition: transform .32s var(--curva); }
dialog.mc.abierto { transform: none; }
dialog.mc::backdrop { background: rgba(31, 26, 21, 0); transition: background-color .3s var(--curva); }
dialog.mc.abierto::backdrop { background: rgba(31, 26, 21, .4); }
.mc :focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.mc__marco { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--blanco); }
.mc__cab { display: flex; align-items: center; gap: 10px; flex: none; min-height: 72px; padding: 10px 16px 10px 28px; border-bottom: 1px solid var(--cp-linea); }
.mc__titulo { display: flex; align-items: center; gap: 8px; margin-right: auto; font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -0.03em; outline: none; }
.mc__n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: var(--r-pildora); background: var(--acento-suave); color: var(--cp-acento-txt); font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.mc__n:empty { display: none; }
.mc__cerrar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--crema); transition: background-color .2s var(--curva-hover); }
.mc__cerrar:hover { background: var(--crema-2); }
.mc__cerrar .lucide { width: 20px; height: 20px; }
.mc__cuerpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 28px; background: var(--crema); }
.mc__items { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.mc-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 1fr auto; gap: 0 16px; padding: 10px; border-radius: 18px; background: var(--blanco); }
.mc-item__foto { grid-row: 1 / 3; width: 104px; height: 104px; border-radius: 12px; }
.mc-item__info { align-self: start; padding-top: 6px; min-width: 0; }
.mc-item__zona { font-size: 16.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.mc-item__meta { margin-top: 4px; color: var(--texto-60); font-size: 13.5px; line-height: 1.3; }
.mc-item__precio { grid-column: 2; grid-row: 2; align-self: end; padding-bottom: 6px; font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.mc-item__quitar { grid-column: 3; grid-row: 1; align-self: start; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--texto-60); transition: background-color .2s var(--curva-hover), color .2s var(--curva-hover); }
.mc-item__quitar:hover { background: var(--crema); color: var(--cp-error); }
.mc-item__quitar .lucide { width: 18px; height: 18px; }
.mc__vacio { padding: 64px 0 36px; }
.mc__pie { flex: none; display: grid; gap: 14px; padding: 18px 28px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--cp-linea); background: var(--blanco); }
.mc__total { display: flex; align-items: baseline; justify-content: space-between; }
.mc__total span { color: var(--texto-60); font-size: 14.5px; }
.mc__total b { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.mc__ir { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 22px; border-radius: var(--r-pildora); background: var(--acento); color: var(--blanco); font-size: 16px; font-weight: 600; transition: background-color .2s var(--curva-hover); }
.mc__ir:hover { background: var(--acento-hondo); }
.mc__ir .lucide { width: 18px; height: 18px; transition: transform .25s var(--curva-hover); }
.mc__ir:hover .lucide { transform: translateX(3px); }

/* ---------- 4. Móvil: pantalla completa ---------- */
@media (max-width: 760px) {
  dialog.mc { width: 100vw; }
  .mc__cab { min-height: 64px; padding-left: 20px; }
  .mc__cuerpo { padding: 14px 16px; }
  .mc-item { gap: 0 14px; }
  .mc-item__foto { width: 92px; height: 92px; }
  .mc__pie { padding-inline: 20px; }
}
@media (max-width: 380px) {
  .mc-item__foto { width: 80px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.mc, dialog.mc::backdrop { transition: none !important; }
  .nav__resumen--pulso, .nav__resumen--pulso .nav__contador { animation: none; }
}
