/* ==========================================================================
   Avodah — checkout y pedido confirmado (prototipo)
   Header simplificado (sin menú: menos distracciones al pagar), formulario
   en tarjetas, resumen lateral, pantalla "Preparando tu pedido" con el
   platito y escena de confirmación (camionetita o platito listo).
   Las ilustraciones las pinta js/checkout.js.
   ========================================================================== */

/* Header simple ---------------------------------------------------------- */
.co-header { position: sticky; top: 0; z-index: 60; background: var(--bg); border-bottom: 1px solid var(--line); }
.co-header__inner { display: flex; align-items: center; gap: 24px; height: 76px; }
.co-header .logo__anim { height: 52px; }
.co-header__secure { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--ok); }
.co-header__secure .ico { font-size: 17px; }
.co-header__help { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.co-header__help strong { color: var(--ink); }
.co-header__help .ico { font-size: 16px; }

/* Encabezado de página --------------------------------------------------- */
.co-page { padding-top: 28px; padding-bottom: var(--space-section); }
.co-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.co-back:hover { color: var(--ink); }
.co-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 14px 0 26px; flex-wrap: wrap; }
.co-title { margin: 0; font: 800 34px/1.1 var(--sans); letter-spacing: -.03em; color: var(--ink); }

.co-steps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.co-steps li { display: inline-flex; align-items: center; gap: 8px; }
.co-steps li + li::before { content: ""; width: 26px; height: 1.5px; margin-right: 2px; background: var(--line); }
.co-steps b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); font-size: 12px; }
.co-steps .is-done b { background: var(--olive-100); border-color: var(--olive-100); color: var(--olive-700); }
.co-steps .is-current { color: var(--ink); }
.co-steps .is-current b { background: var(--olive-700); border-color: var(--olive-700); color: #fff; }
.co-steps .ico { font-size: 13px; stroke-width: 2.4; }

/* Layout ----------------------------------------------------------------- */
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
.co-main { display: grid; gap: 18px; }
.co-card { padding: 26px 28px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.co-card__title { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font: 700 19px/1.2 var(--sans); color: var(--ink); letter-spacing: -.01em; }
.co-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--olive-100); color: var(--olive-700); font-size: 14px; font-weight: 800; }

/* Campos ----------------------------------------------------------------- */
.co-fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px 16px; }
.co-field { display: grid; gap: 6px; grid-column: span 6; }
.co-field--3 { grid-column: span 3; }
.co-field--2 { grid-column: span 2; }
.co-field--4 { grid-column: span 4; }
.co-field label, .co-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.co-field label small { font-weight: 500; color: var(--muted); }
.co-input {
	width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px;
	background: var(--white); color: var(--ink); font: 500 15px/1 var(--sans);
	transition: border-color .15s, box-shadow .15s;
}
select.co-input { appearance: none; padding-right: 40px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%234F514E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 14px center; }
.co-input:hover { border-color: #DCD7CF; }
.co-input:focus { outline: none; border-color: var(--olive-700); box-shadow: 0 0 0 3px rgba(74, 86, 45, .14); }
.co-input[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 3px rgba(154, 59, 46, .1); }
.co-hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.co-hint .ico { font-size: 14px; vertical-align: -2px; margin-right: 4px; color: var(--olive-500); }

/* Tarjetas de opción (método de entrega / pago) -------------------------- */
.co-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.co-options--list { grid-template-columns: 1fr; gap: 10px; }
.co-option { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.co-option:hover { border-color: #DCD7CF; }
.co-option input { position: absolute; opacity: 0; pointer-events: none; }
.co-option__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--sand); color: var(--olive-700); font-size: 22px; }
.co-option__text { display: grid; gap: 2px; min-width: 0; }
.co-option__text strong { font-size: 15px; color: var(--ink); }
.co-option__text small { font-size: 13px; color: var(--muted); }
.co-option__tag { margin-left: auto; padding: 4px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 12px; font-weight: 700; white-space: nowrap; }
.co-option::after { content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #D6D1C8; background: var(--white); transition: border-color .15s, box-shadow .15s; }
.co-option:has(.co-option__tag)::after { display: none; }
.co-option:has(input:checked) { border-color: var(--olive-700); background: #FBFCF7; }
.co-option:has(input:checked)::after { border-color: var(--olive-700); box-shadow: inset 0 0 0 4px var(--white), inset 0 0 0 10px var(--olive-700); }
.co-option:has(input:checked) .co-option__icon { background: var(--olive-700); color: #fff; }
.co-option:has(input:focus-visible) { outline: 2px solid var(--olive-700); outline-offset: 2px; }
.co-options--list .co-option::after { top: 50%; transform: translateY(-50%); right: 18px; }
.co-options--list .co-option { padding-right: 52px; }

.co-panel { margin-top: 20px; }
.co-panel[hidden] { display: none; }

/* Chips (día y horario) -------------------------------------------------- */
.co-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.co-chip { position: relative; }
.co-chip input { position: absolute; opacity: 0; pointer-events: none; }
.co-chip span { display: grid; gap: 1px; min-width: 112px; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.co-chip span b { font-size: 14px; color: var(--ink); }
.co-chip span small { font-size: 12.5px; color: var(--muted); }
.co-chip span:hover { border-color: #DCD7CF; }
.co-chip input:checked + span { border-color: var(--olive-700); background: var(--olive-700); }
.co-chip input:checked + span b, .co-chip input:checked + span small { color: #fff; }
.co-chip input:focus-visible + span { outline: 2px solid var(--olive-700); outline-offset: 2px; }

.co-store { display: flex; gap: 16px; padding: 18px; border-radius: 14px; background: var(--sand); }
.co-store .ico { font-size: 24px; color: var(--olive-700); flex: none; margin-top: 2px; }
.co-store strong { display: block; color: var(--ink); }
.co-store p { margin: 2px 0 0; font-size: 14px; }

.co-cardform { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-top: 14px; }
.co-cardform[hidden] { display: none; }
.co-cardform .co-field { grid-column: auto; }
.co-brands { display: inline-flex; gap: 6px; }
.co-brands span { padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; color: var(--muted); }

/* Resumen ---------------------------------------------------------------- */
.co-summary { position: sticky; top: 100px; padding: 26px 26px 24px; border-radius: 18px; background: var(--hero-bg); }
.co-summary__title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 16px; font: 700 19px/1.2 var(--sans); color: var(--ink); }
.co-summary__title small { font-size: 13px; font-weight: 600; color: var(--muted); }
.co-items { display: grid; gap: 14px; margin: 0 0 18px; padding: 0 0 18px; list-style: none; border-bottom: 1px dashed #E2DAD0; }
.co-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; }
.co-item__img { position: relative; width: 58px; height: 58px; border-radius: 12px; background: var(--white); }
.co-item__img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.co-item__qty { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--olive-700); color: #fff; font-size: 11px; font-weight: 800; }
.co-item__name { font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.co-item__meta { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.co-item__price { font-size: 14px; font-weight: 700; color: var(--ink); }
.co-rows { display: grid; gap: 10px; margin: 0; }
.co-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.co-row dt { color: var(--text); }
.co-row dd { margin: 0; font-weight: 600; color: var(--ink); }
.co-row--free dd { color: var(--ok); }
.co-row--total { margin-top: 6px; padding-top: 14px; border-top: 1px solid #E8E0D5; font-size: 17px; }
.co-row--total dt { font-weight: 700; color: var(--ink); }
.co-row--total dd { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.co-iva { margin: 4px 0 18px; font-size: 12.5px; color: var(--muted); text-align: right; }
.co-submit { height: 54px; font-size: 16px; }
.co-submit[disabled] { opacity: .7; cursor: progress; }
.co-legal { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
.co-legal a { text-decoration: underline; text-underline-offset: 2px; }
.co-trust { display: flex; justify-content: center; gap: 18px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #E8E0D5; font-size: 12.5px; font-weight: 600; color: var(--text); }
.co-trust span { display: inline-flex; align-items: center; gap: 6px; }
.co-trust .ico { font-size: 16px; color: var(--olive-700); }

/* ==========================================================================
   Pantalla "Preparando tu pedido" (platito)
   ========================================================================== */
.co-processing { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.co-processing[hidden] { display: none; }
.co-processing.is-on { opacity: 1; }
.co-processing__box { display: grid; justify-items: center; gap: 6px; text-align: center; transform: translateY(10px); transition: transform .35s var(--ease-out); }
.co-processing.is-on .co-processing__box { transform: none; }
.co-processing__art { width: 240px; height: auto; margin-bottom: 8px; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 32%); mask-image: linear-gradient(transparent, #000 32%); } /* las croquetas aparecen suave desde arriba */
.co-processing__msg { min-height: 1.3em; margin: 0; font: 800 24px/1.25 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.co-processing__msg span { display: inline-block; animation: co-msg .35s var(--ease-out); }
.co-processing small { font-size: 13.5px; color: var(--muted); }
@keyframes co-msg { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Platito: croquetas que caen y montón que sube */
.bowl .kib { animation: bowl-fall 1.05s cubic-bezier(.55, 0, .85, .4) infinite; opacity: 0; }
.bowl .kib:nth-child(2) { animation-delay: .15s; }
.bowl .kib:nth-child(3) { animation-delay: .3s; }
.bowl .kib:nth-child(4) { animation-delay: .45s; }
.bowl .kib:nth-child(5) { animation-delay: .6s; }
.bowl .kib:nth-child(6) { animation-delay: .75s; }
.bowl .kib:nth-child(7) { animation-delay: .9s; }
.bowl .kib > * { transform-box: fill-box; transform-origin: center; animation: bowl-spin 1.05s linear infinite; animation-delay: inherit; }
.bowl__mound { animation: bowl-fill 3.2s var(--ease-out) forwards; }
.bowl__body { transform-box: fill-box; transform-origin: 50% 100%; animation: bowl-plop 1.05s ease-in-out infinite; }
@keyframes bowl-fall {
	0% { opacity: 0; transform: translateY(-70px); }
	12% { opacity: 1; }
	85% { opacity: 1; }
	100% { opacity: 0; transform: translateY(78px); }
}
@keyframes bowl-spin { to { transform: rotate(320deg); } }
@keyframes bowl-fill { from { transform: translateY(34px); } to { transform: translateY(5px); } }
@keyframes bowl-plop { 0%, 70%, 100% { transform: none; } 82% { transform: scale(1.025, .975); } }

/* ==========================================================================
   Pedido confirmado
   ========================================================================== */
.ok-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 34px 44px; border-radius: 24px; background: var(--hero-bg); overflow: hidden; }
.ok-scene { position: relative; aspect-ratio: 16 / 10; border-radius: 18px; background: var(--white); overflow: hidden; }
.ok-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ok-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 13px; font-weight: 700; }
.ok-eyebrow .ico { font-size: 16px; stroke-width: 2; }
.ok-title { margin: 14px 0 12px; font: 800 38px/1.08 var(--sans); letter-spacing: -.03em; color: var(--ink); }
.ok-lead { margin: 0; font-size: 16px; line-height: 1.6; }
.ok-lead strong { color: var(--ink); }
.ok-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.ok-copy > * { animation: co-msg .5s var(--ease-out) both; }
.ok-copy > :nth-child(2) { animation-delay: .08s; }
.ok-copy > :nth-child(3) { animation-delay: .16s; }
.ok-copy > :nth-child(4) { animation-delay: .24s; }

.ok-track { display: grid; grid-template-columns: repeat(4, 1fr); margin: 28px 0 0; padding: 0; list-style: none; }
.ok-track li { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.ok-track li::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.ok-track li:first-child::before { display: none; }
.ok-track b { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); font-size: 15px; }
.ok-track .is-done { color: var(--ink); }
.ok-track .is-done::before { background: var(--olive-700); }
.ok-track .is-done b { border-color: var(--olive-700); background: var(--olive-700); color: #fff; }
.ok-track .is-next b { border-color: var(--olive-700); color: var(--olive-700); }
.ok-track .ico { font-size: 15px; stroke-width: 2.2; }

.ok-grid { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 18px; margin-top: 22px; align-items: start; }
.ok-card { padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; }
.ok-card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 700 16px/1.2 var(--sans); color: var(--ink); }
.ok-card h2 .ico { font-size: 19px; color: var(--olive-700); }
.ok-card p { margin: 0 0 6px; font-size: 14.5px; }
.ok-card p strong { color: var(--ink); }
.ok-card .ok-note { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--info-bg); color: var(--info); font-size: 13.5px; }
.ok-card .co-items { margin-bottom: 14px; padding-bottom: 14px; }

/* Escena: camionetita que llega */
.truck-scene .road { animation: road-move .35s linear 4; }
.truck-scene .truck { animation: truck-in 1.5s cubic-bezier(.22, .9, .3, 1.08) both; }
.truck-scene .truck__body { transform-box: fill-box; transform-origin: 50% 100%; animation: truck-bob .2s ease-in-out 5 alternate, truck-squash .4s ease-out 1.45s; }
.truck-scene .wheel { transform-box: fill-box; transform-origin: center; animation: wheel-spin 1.5s cubic-bezier(.22, .9, .3, 1) both; }
.truck-scene .speed { animation: speed-out 1.5s ease-in both; }
.truck-scene .puff { transform-box: fill-box; transform-origin: center; opacity: 0; animation: puff 0.7s ease-out 1.35s both; }
.truck-scene .burst { transform-box: fill-box; transform-origin: center bottom; opacity: 0; animation: burst .6s cubic-bezier(.34, 1.56, .64, 1) 1.55s both; }
.truck-scene .burst--2 { animation-delay: 1.7s; }
.truck-scene .burst--3 { animation-delay: 1.85s; }
@keyframes truck-in { from { transform: translateX(-330px); } to { transform: none; } }
@keyframes truck-bob { to { transform: translateY(-2.5px); } }
@keyframes truck-squash { 0% { transform: none; } 35% { transform: scale(1.02, .96); } 70% { transform: scale(.99, 1.02); } 100% { transform: none; } }
@keyframes wheel-spin { from { transform: rotate(-900deg); } to { transform: none; } }
@keyframes road-move { to { transform: translateX(-28px); } }
@keyframes speed-out { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes puff { from { opacity: .8; transform: scale(.4); } to { opacity: 0; transform: translateX(-14px) scale(1.4); } }
@keyframes burst { from { opacity: 0; transform: translateY(10px) scale(.3); } to { opacity: 1; transform: none; } }

/* Escena: platito listo (recoger en tienda) */
.ready-scene .bowl__body { transform-box: fill-box; transform-origin: 50% 100%; animation: ready-hop .7s cubic-bezier(.34, 1.56, .64, 1) .2s both; }
.ready-scene .check { transform-box: fill-box; transform-origin: center; animation: burst .55s cubic-bezier(.34, 1.56, .64, 1) .75s both; }
.ready-scene .burst { transform-box: fill-box; transform-origin: center bottom; animation: burst .6s cubic-bezier(.34, 1.56, .64, 1) 1s both; }
.ready-scene .burst--2 { animation-delay: 1.15s; }
@keyframes ready-hop { 0% { transform: translateY(30px) scale(.9); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }

/* Barra de demo ---------------------------------------------------------- */
.co-demo { position: fixed; left: 50%; bottom: 18px; z-index: 130; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: var(--shadow-pop); transform: translateX(-50%); }
.co-demo span { padding: 0 10px 0 12px; font-weight: 700; opacity: .7; }
.co-demo a, .co-demo button { padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; }
.co-demo a:hover, .co-demo button:hover { background: rgba(255, 255, 255, .12); }
.co-demo .is-on { background: #fff; color: var(--ink); }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1060px) {
	.co-grid { grid-template-columns: 1fr; }
	.co-summary { position: static; }
	.ok-hero { grid-template-columns: 1fr; padding: 28px; }
	.ok-grid { grid-template-columns: 1fr 1fr; }
	.ok-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
	.co-header__inner { height: 64px; gap: 12px; }
	.co-header .logo__anim { height: 42px; }
	.co-header__help { display: none; }
	.co-title, .ok-title { font-size: 28px; }
	.co-steps { display: none; }
	.co-card { padding: 20px 18px 22px; }
	.co-options { grid-template-columns: 1fr; }
	.co-field--3, .co-field--2, .co-field--4 { grid-column: span 6; }
	.co-cardform { grid-template-columns: 1fr 1fr; }
	.co-cardform .co-field:first-child { grid-column: 1 / -1; }
	.ok-hero { padding: 18px; }
	.ok-grid { grid-template-columns: 1fr; }
	.ok-track li { font-size: 11.5px; }
	.co-demo { left: 12px; right: 12px; transform: none; justify-content: center; flex-wrap: wrap; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.bowl *, .truck-scene *, .ready-scene *, .ok-copy > *, .co-processing__msg span { animation: none !important; }
	.bowl .kib { opacity: 0; }
	.bowl__mound { transform: translateY(5px); }
	.truck-scene .burst, .ready-scene .burst { opacity: 1; }
	.truck-scene .speed { opacity: 0; }
	.co-processing, .co-processing__box { transition: none; }
}
