/* ═══ sitio.gt V7.39 — El carrito al instante ═══
   La hoja sobre la página (teléfono: desde abajo, con su asa; computadora: a la derecha) y el carrito nuevo, el mismo en la
   hoja y en /carrito/. Tokens del sistema vigente: Manrope, porcelana, tarjetas blancas de dos sombras, jade de acento,
   obsidiana para pagar y el verde de WhatsApp solo para WhatsApp. Toques de 44 px y letras desde 12 px. */

.ct-sheet, .ct, .ct-snack, .ct-page {
  --ct-ink: #101828; --ct-txt: #344054; --ct-mut: #667085; --ct-mut2: #98A2B3;
  --ct-bg: #F2F4F7; --ct-card: #FFFFFF; --ct-line: rgba(16,24,40,.08); --ct-fill: rgba(16,24,40,.05);
  --ct-jade: var(--jade, #0B7A5C); --ct-jade-rgb: var(--jade-rgb, 11,122,92); --ct-jade-d: #075E46; --ct-jade-l: #E6F4EF;
  --ct-wa: #25D366; --ct-wa-d: #1EBE5A; --ct-obs: #101828; --ct-amber: #B54708;
  --ct-r: 20px; --ct-r-s: 14px;
  --ct-sh: 0 1px 2px rgba(16,24,40,.05), 0 0 0 .5px rgba(16,24,40,.07);
  --ct-font: var(--fb, var(--fd, "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif));
  --ct-disp: var(--fd, var(--ct-font));
}
.ct *, .ct *::before, .ct *::after, .ct-sheet *, .ct-sheet *::before, .ct-sheet *::after { box-sizing: border-box; }
html.ct-lock, html.ct-lock body { overflow: hidden !important; }

/* ───────── La hoja ───────── */
.ct-sheet { position: fixed; inset: 0; z-index: 9980; display: flex; align-items: flex-end; justify-content: center; font-family: var(--ct-font); color: var(--ct-txt); }
.ct-sheet[hidden] { display: none; }
.ct-scrim { position: absolute; inset: 0; background: rgba(16,24,40,.44); opacity: 0; transition: opacity .24s ease; -webkit-tap-highlight-color: transparent; }
.ct-sheet.is-on .ct-scrim { opacity: 1; }
.ct-panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 560px;
  height: calc(100% - 44px); max-height: 100%; height: calc(100dvh - 44px);
  background: var(--ct-bg); border-radius: 24px 24px 0 0; outline: none;
  box-shadow: 0 -18px 50px -10px rgba(16,24,40,.28);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.ct-sheet.is-on .ct-panel { transform: translateY(0); }
.ct-panel.is-drag { transition: none; }
.ct-grab { flex: 0 0 auto; height: 22px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.ct-grab i { display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(16,24,40,.18); }
.ct-head { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 0 12px 10px 18px; touch-action: none; }
.ct-head-t { flex: 1; min-width: 0; }
.ct-head h2 { margin: 0; font: 800 21px/1.15 var(--ct-disp); letter-spacing: -.02em; color: var(--ct-ink); }
.ct-head-sub { margin: 3px 0 0; font-size: 13.5px; color: var(--ct-mut); }
.ct-x { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(16,24,40,.06); color: var(--ct-ink); cursor: pointer; }
.ct-x:hover { background: rgba(16,24,40,.1); }
.ct-scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 12px 0; }
.ct-sheet :focus-visible, .ct :focus-visible { outline: 3px solid rgba(var(--ct-jade-rgb), .38); outline-offset: 2px; }
.ct-panel:focus-visible { outline: none; }
@media (min-width: 1024px) {
  .ct-sheet { align-items: stretch; justify-content: flex-end; }
  .ct-panel { max-width: 440px; height: 100%; border-radius: 24px 0 0 24px; transform: translateX(100%); box-shadow: -18px 0 50px -10px rgba(16,24,40,.28); }
  .ct-sheet.is-on .ct-panel { transform: translateX(0); }
  .ct-grab { height: 14px; cursor: default; } .ct-grab i { display: none; }
  .ct-head { padding-top: 6px; touch-action: auto; }
}
@media (prefers-reduced-motion: reduce) { .ct-scrim, .ct-panel { transition: none; } }

/* Aviso dentro del carrito («Quitaste… Deshacer») */
.ct-toast { position: absolute; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 5; display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 32px); margin: 0 auto;
  padding: 10px 10px 10px 16px; border-radius: 14px; background: rgba(16,24,40,.97); color: #fff; font: 600 14px/1.35 var(--ct-font);
  box-shadow: 0 14px 34px -12px rgba(16,24,40,.5); transform: translateY(12px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.ct-toast.is-on { transform: translateY(0); opacity: 1; pointer-events: auto; }
.ct-toast span { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ct-toast button { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #7FDDBE; font: 800 14px var(--ct-font); cursor: pointer; }
.ct-toast-page { position: fixed; bottom: calc(var(--nav-h, 68px) + 92px + env(safe-area-inset-bottom)); }

/* «Agregado al carrito · Ver carrito» */
.ct-snack { position: fixed; left: 50%; bottom: calc(var(--nav-h, 68px) + 14px + env(safe-area-inset-bottom)); z-index: 820; display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100% - 24px); padding: 6px 6px 6px 12px; border-radius: 16px; background: rgba(16,24,40,.97); color: #fff;
  font: 700 14px/1.3 var(--ct-font); box-shadow: 0 16px 36px -12px rgba(16,24,40,.55); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .22s ease; }
.ct-snack.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.ct-snack-ic { flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--ct-jade); color: #fff; }
.ct-snack-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ct-snack-t b, .ct-snack-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-snack-t small { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.72); }
.ct-snack-go { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; background: #fff; color: var(--ct-ink) !important; font-weight: 800; text-decoration: none !important; }
@media (min-width: 1024px) { .ct-snack { bottom: 24px; } }

/* Esqueleto (solo la primera vez) */
.ct-is-sk { padding-top: 2px; }
.ct-sk-card { background: var(--ct-card); border-radius: var(--ct-r); box-shadow: var(--ct-sh); padding: 14px; margin: 0 0 12px; }
.ct-sk-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ct-sk-line { display: grid; grid-template-columns: 72px 1fr; gap: 12px; margin-bottom: 14px; }
.ct-sk-line span { display: grid; gap: 8px; align-content: start; }
.ct-sk { display: block; border-radius: 8px; background: linear-gradient(90deg, #EAECF0 0%, #F4F5F7 50%, #EAECF0 100%); background-size: 200% 100%; animation: ct-sk 1.2s linear infinite; }
.ct-sk-dot { width: 40px; height: 40px; border-radius: 50%; } .ct-sk-t { width: 46%; height: 16px; }
.ct-sk-img { width: 72px; height: 72px; border-radius: 14px; } .ct-sk-a { width: 82%; height: 14px; } .ct-sk-b { width: 40%; height: 12px; } .ct-sk-c { width: 60%; height: 34px; border-radius: 12px; }
.ct-sk-btn { height: 50px; border-radius: 14px; }
@keyframes ct-sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ct-sk { animation: none; } }

/* ───────── El carrito (hoja y página) ───────── */
.ct { font-family: var(--ct-font); font-size: 15px; line-height: 1.45; color: var(--ct-txt); }
html body .ct a, html body .ct a:hover, html body .ct a:visited { color: inherit; text-decoration: none; } /* el tema pinta de jade todos los enlaces */
html body .ct .ct-name, html body .ct .ct-store-a { color: var(--ct-ink); }
.ct-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ct-store { background: var(--ct-card); border-radius: var(--ct-r); box-shadow: var(--ct-sh); margin: 0 0 12px; overflow: hidden; }
.ct-store.is-gone { display: none; }
.ct-store-h { padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--ct-line); }
.ct-store-a { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ct-ink); }
.ct-dot { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px var(--ct-line); }
.ct-dot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ct-dot span { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; font: 800 16px var(--ct-disp); }
.ct-store-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct-store-n { font: 800 15.5px/1.25 var(--ct-disp); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-store-ship { font-size: 12.5px; color: var(--ct-mut); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-store-go { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; color: var(--ct-mut2); }
.ct-seller { display: block; margin: 2px 0 0 50px; font-size: 12px; color: var(--ct-mut); }
.ct-free { padding: 9px 14px 10px; background: var(--ct-jade-l); color: var(--ct-jade-d); font-size: 13px; font-weight: 650; }
.ct-free-t { display: flex; align-items: center; gap: 6px; } .ct-free-t b { font-weight: 800; }
.ct-free-bar { display: block; height: 5px; margin-top: 7px; border-radius: 3px; background: rgba(var(--ct-jade-rgb), .16); overflow: hidden; }
.ct-free-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--ct-jade); transition: width .3s ease; }
.ct-free.is-done .ct-free-bar { display: none; }

.ct-lines { list-style: none; margin: 0; padding: 0; }
.ct-line { display: grid; grid-template-columns: 72px 1fr; column-gap: 12px; row-gap: 8px; padding: 14px 14px 12px; }
.ct-line + .ct-line { border-top: 1px solid var(--ct-line); }
.ct-line.is-gone { display: none; }
.ct-img { width: 72px; height: 72px; border-radius: var(--ct-r-s); overflow: hidden; display: grid; place-items: center; background: var(--ct-bg); color: var(--ct-mut2); }
.ct-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ct-info { min-width: 0; display: flex; flex-direction: column; }
.ct-name { color: var(--ct-ink); font: 700 15px/1.3 var(--ct-disp); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ct-meta { margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--ct-mut); display: flex; flex-direction: column; }
.ct-unit { margin-top: 2px; font-size: 13px; color: var(--ct-mut); }
.ct-low { color: var(--ct-amber); font-weight: 700; }
.ct-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; } /* a lo ancho, debajo de la foto: cabe desde 320 */
.ct-qty { display: inline-flex; align-items: center; height: 44px; border-radius: 13px; background: var(--ct-card); box-shadow: inset 0 0 0 1px rgba(16,24,40,.14); }
.ct-qb { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--ct-ink); cursor: pointer; border-radius: 13px; padding: 0; }
.ct-qb:disabled { color: var(--ct-mut2); cursor: default; }
.ct-qb .ct-qb-rm { color: #B42318; display: grid; } .ct-qb .ct-qb-mn { display: grid; } .ct-qb [hidden] { display: none; }
.ct-qn { min-width: 26px; text-align: center; font: 800 15.5px var(--ct-disp); color: var(--ct-ink); }
.ct-solo { font-size: 13px; color: var(--ct-mut); font-weight: 700; padding: 0 4px; }
.ct-rm { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--ct-mut); font: 700 13px var(--ct-font); cursor: pointer; }
.ct-rm:hover { color: #B42318; }
.ct-lt { margin-left: auto; font: 800 15.5px var(--ct-disp); color: var(--ct-ink); white-space: nowrap; }
.ct-line.is-pending .ct-lt { opacity: .55; }
.ct-note { padding: 0 14px 10px; font-size: 13px; }
.ct-note p { margin: 0 0 6px; }

.ct-store-f { padding: 12px 14px 14px; border-top: 1px solid var(--ct-line); display: grid; gap: 10px; }
.ct-store-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ct-store-sum span { font-size: 13.5px; color: var(--ct-mut); font-weight: 600; }
.ct-store-sum b { font: 800 18px var(--ct-disp); color: var(--ct-ink); letter-spacing: -.01em; }
.ct-wa { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 16px; border-radius: 14px; background: var(--ct-wa); color: #fff !important;
  font: 800 16px var(--ct-disp); box-shadow: 0 10px 22px -12px rgba(37,211,102,.95); transition: transform .12s ease, background .15s ease; }
.ct-wa:hover { background: var(--ct-wa-d); }
.ct-wa:active { transform: scale(.985); }
.ct-nowa { margin: 0; font-size: 13px; color: var(--ct-mut); }
.ct-sent { margin: 0; padding: 9px 12px; border-radius: 12px; background: var(--ct-jade-l); color: var(--ct-jade-d); font-size: 13px; font-weight: 650; }

/* Resumen */
.ct-sum { background: var(--ct-card); border-radius: var(--ct-r); box-shadow: var(--ct-sh); padding: 14px 16px; margin: 0 0 12px; }
.ct-sum-h { margin: 0 0 6px; font: 800 16px var(--ct-disp); color: var(--ct-ink); }
.ct-sum-rows { margin: 0; }
.ct-sum-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.ct-sum-rows dt { color: var(--ct-mut); } .ct-sum-rows dd { margin: 0; color: var(--ct-ink); font-weight: 700; text-align: right; }
.ct-sum-rows .is-off dd { color: var(--ct-jade); }
.ct-sum-total { margin-top: 4px; padding-top: 10px !important; border-top: 1px solid var(--ct-line); }
.ct-sum-total dt { color: var(--ct-ink) !important; font-weight: 800; } .ct-sum-total dd { font: 800 18px var(--ct-disp); }
.ct-link { display: inline-flex; align-items: center; min-height: 44px; margin: -13px 0; padding: 0 6px; background: none; border: 0; color: var(--ct-jade); font: 700 13px var(--ct-font); cursor: pointer; vertical-align: middle; }
.ct-coupon { margin-top: 8px; }
.ct-coupon summary { display: flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; color: var(--ct-jade); font-weight: 700; font-size: 14px; }
.ct-coupon summary::-webkit-details-marker { display: none; }
.ct-coupon-f { display: flex; gap: 8px; margin: 2px 0 6px; }
.ct-coupon-f input { flex: 1; min-width: 0; height: 46px; padding: 0 12px; border: 1px solid rgba(16,24,40,.16); border-radius: 12px; font: 600 15px var(--ct-font); text-transform: uppercase; background: #fff; color: var(--ct-ink); }
.ct-fine { margin: 8px 0 0; font-size: 12.5px; color: var(--ct-mut); line-height: 1.45; }

/* Botones */
.ct-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 0; border-radius: 13px; font: 800 15px var(--ct-disp); cursor: pointer; text-decoration: none; }
.ct-btn-pri { background: var(--ct-jade); color: #fff !important; }
.ct-btn-line { background: var(--ct-card); color: var(--ct-ink) !important; box-shadow: inset 0 0 0 1px rgba(16,24,40,.16); }
.ct-btn-pay { background: var(--ct-obs); color: #fff !important; min-height: 50px; padding: 0 18px; box-shadow: 0 10px 22px -12px rgba(16,24,40,.8); }

/* La barra del total: una sola, abajo */
.ct-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
.ct-bar-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ct-bar-t span { font-size: 12px; color: var(--ct-mut); font-weight: 700; }
.ct-bar-t b { font: 800 20px var(--ct-disp); color: var(--ct-ink); letter-spacing: -.01em; }
.ct-bar-t small { font-size: 12px; color: var(--ct-mut); }
.ct-sheet .ct-bar { position: sticky; bottom: 0; margin: 4px -12px 0; background: rgba(242,244,247,.86); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); border-top: 1px solid var(--ct-line); }

/* Vacío y error */
.ct-empty { text-align: center; padding: 26px 18px 18px; }
.ct-empty-ic { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 22px; background: var(--ct-card); box-shadow: var(--ct-sh); color: var(--ct-jade); }
.ct-empty-h { margin: 14px 0 6px; font: 800 20px var(--ct-disp); color: var(--ct-ink); }
.ct-empty p { margin: 0 auto 16px; max-width: 34ch; color: var(--ct-mut); font-size: 14px; }
.ct-empty-acts { display: grid; gap: 10px; max-width: 320px; margin: 0 auto; }
.ct-err { text-align: center; padding: 30px 18px; color: var(--ct-mut); } .ct-err p { margin: 0 0 12px; }

/* ───────── La página /carrito/ ───────── */
#sitio-app .ct-page { box-sizing: border-box; max-width: 1160px; margin: 0 auto; padding: 8px 16px calc(150px + env(safe-area-inset-bottom)); font-family: var(--ct-font); color: var(--ct-txt); }
.ct-page-h { padding: 12px 2px 16px; }
.ct-page-t { margin: 0; font: 800 30px/1.12 var(--ct-disp); letter-spacing: -.03em; color: var(--ct-ink); }
.ct-page-sub { margin: 6px 0 0; color: var(--ct-mut); font-size: 14.5px; }
.ct-page .ct-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h, 68px) + env(safe-area-inset-bottom)); z-index: 290; padding-bottom: 10px;
  background: rgba(255,255,255,.88); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); border-top: 1px solid var(--ct-line); box-shadow: 0 -10px 30px -18px rgba(16,24,40,.35); }
.ct-page .ct-saved { margin-top: 18px; }
@media (min-width: 1024px) {
  .ct-page .ct-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
  .ct-page .ct-side { position: sticky; top: 96px; }
  .ct-page .ct-bar { position: static; padding: 0; margin: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ct-page .ct { position: relative; }
  .ct-page .ct-side + .ct-bar, .ct-page .ct-cols + .ct-bar { position: sticky; bottom: 24px; max-width: 360px; margin: 0 0 0 auto; padding: 14px 16px; background: var(--ct-card); border-radius: var(--ct-r); box-shadow: var(--ct-sh); }
  .ct-toast-page { bottom: 32px; }
}
