/* ==========================================================================
   Inicio — "Entrega y pago" v4 (filas compactas)
   ========================================================================== */
.hoi3 {
  --hoi-bg-panel: linear-gradient(160deg, #1a1a1f 0%, #121215 100%);
  --hoi-card: #1d1d22;
  --hoi-muted: rgba(255, 255, 255, 0.05);
  --hoi-border: rgba(255, 255, 255, 0.09);
  --hoi-border-strong: rgba(255, 255, 255, 0.18);
  --hoi-fg: #f5f5f7;
  --hoi-fg-2: rgba(255, 255, 255, 0.76);
  --hoi-muted-fg: rgba(255, 255, 255, 0.5);
  --hoi-accent: #ffa200;
  --hoi-accent-soft: rgba(255, 162, 0, 0.12);
  --hoi-accent-fg: #1a1203;
  --hoi-ok: #4ade80;
  --hoi-ok-soft: rgba(74, 222, 128, 0.12);
  --hoi-bad: #f87171;
  --hoi-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  position: relative;
  padding: 88px 0;
}
html[data-theme="day"] .hoi3 {
  --hoi-bg-panel: linear-gradient(160deg, #ffffff 0%, #fafafb 100%);
  --hoi-card: #ffffff;
  --hoi-muted: #f4f4f6;
  --hoi-border: #e7e7ec;
  --hoi-border-strong: #d0d0d8;
  --hoi-fg: #111114;
  --hoi-fg-2: #3f3f46;
  --hoi-muted-fg: #71717a;
  --hoi-accent-soft: #fff4dc;
  --hoi-ok: #15803d;
  --hoi-ok-soft: #dcfce7;
  --hoi-bad: #b91c1c;
  --hoi-shadow: 0 24px 60px rgba(17, 17, 20, 0.08);
}
.hoi3-wrap { max-width: 1160px; margin: 0 auto; }

/* ---------- Encabezado ---------- */
.hoi3-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.hoi3-kicker { display: block; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hoi-accent); margin-bottom: 10px; }
.hoi3-title { margin: 0; font-size: clamp(2.4rem, 4.6vw, 3.6rem); line-height: 0.95; color: var(--hoi-fg); }
.hoi3-head__side { display: flex; flex-wrap: wrap; gap: 8px; }
/* Título centrado; "Pedidos abiertos" al final, debajo del recuadro */
.hoi3-head--center { justify-content: center; text-align: center; }
.hoi3-head--center .hoi3-title { font-size: clamp(2.8rem, 6.4vw, 5rem); }
.hoi3-head--center .hoi3-kicker { font-size: 1rem; }
.hoi3-foot { justify-content: center; margin-top: 22px; }
.hoi3-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--hoi-border); background: var(--hoi-muted);
  font-size: 0.9rem; font-weight: 600; color: var(--hoi-fg-2);
}
.hoi3-pill strong { color: var(--hoi-fg); font-weight: 800; }
.hoi3-pill--open { border-color: color-mix(in srgb, var(--hoi-ok) 40%, transparent); background: var(--hoi-ok-soft); color: var(--hoi-ok); font-weight: 800; }
.hoi3-pill--closed { border-color: color-mix(in srgb, var(--hoi-bad) 40%, transparent); background: color-mix(in srgb, var(--hoi-bad) 12%, transparent); color: var(--hoi-bad); font-weight: 800; }
.hoi3-pill__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hoi3-pill--open .hoi3-pill__dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid currentColor; animation: hoi3-ping 2s ease-out infinite;
}
@keyframes hoi3-ping { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.7); opacity: 0; } }

/* ---------- Panel con filas ---------- */
.hoi3-panel {
  position: relative; overflow: hidden;
  padding: 10px 30px; border-radius: 28px;
  border: 1px solid var(--hoi-border); background: var(--hoi-bg-panel);
  box-shadow: var(--hoi-shadow);
}
.hoi3-panel::before {
  content: ""; position: absolute; top: -160px; right: -120px; width: 380px; height: 380px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 162, 0, .13), transparent 70%);
  pointer-events: none;
}
.hoi3-row {
  position: relative;
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px;
  padding: 26px 0;
}
.hoi3-row + .hoi3-row { border-top: 1px dashed var(--hoi-border-strong); }
/* Paso centrado en su fila: ícono grande con el número en la esquina */
.hoi3-row__label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; align-self: stretch;
}
.hoi3-row__icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; margin-bottom: 10px; border-radius: 22px;
  background: var(--hoi-accent-soft); color: var(--hoi-accent);
  border: 1px solid rgba(255, 162, 0, .3);
  box-shadow: 0 10px 26px rgba(255, 162, 0, .12);
}
html[data-theme="day"] .hoi3-row__icon { color: #b45309; border-color: rgba(180, 83, 9, .25); }
.hoi3-row__num {
  position: absolute; top: -9px; right: -9px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--hoi-accent); color: var(--hoi-accent-fg);
  font-size: 0.9rem; font-weight: 900; box-shadow: 0 0 0 4px var(--hoi-card-bg, #1c1b20);
}
.hoi3-row__title { margin: 0; font-size: 1.3rem; font-weight: 900; line-height: 1.15; letter-spacing: -0.01em; color: var(--hoi-fg); }
.hoi3-row__label small { font-size: 0.85rem; color: var(--hoi-muted-fg); }
/* Tarjetas de la misma fila con la misma altura; "Ver detalles" siempre al fondo para que queden a la par. */
.hoi3-row__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }

/* ---------- Tarjeta ---------- */
.hoi3-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px; border-radius: 20px;
  border: 1px solid var(--hoi-border); background: var(--hoi-card);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.hoi3-card:hover { border-color: color-mix(in srgb, var(--hoi-accent) 45%, transparent); transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0, 0, 0, .28); }
html[data-theme="day"] .hoi3-card:hover { box-shadow: 0 16px 34px rgba(17, 17, 20, .08); }
.hoi3-card.is-soon { opacity: .6; }
.hoi3-card__glow {
  position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s ease; pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 162, 0, .10), transparent 70%);
}
.hoi3-card:hover .hoi3-card__glow { opacity: 1; }

.hoi3-card__head { display: flex; align-items: center; gap: 12px; }
.hoi3-card__icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 13px;
  background: var(--hoi-accent-soft); color: var(--hoi-accent);
  border: 1px solid color-mix(in srgb, var(--hoi-accent) 30%, transparent);
  transition: background .25s ease, color .25s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
}
.hoi3-card__icon svg { width: 21px; height: 21px; }
.hoi3-card:hover .hoi3-card__icon { background: var(--hoi-accent); color: var(--hoi-accent-fg); transform: rotate(-6deg) scale(1.05); }
.hoi3-card__title { flex: 1; min-width: 0; margin: 0; font-size: 1.15rem; font-weight: 900; line-height: 1.2; letter-spacing: -0.01em; color: var(--hoi-fg); }
.hoi3-badge {
  flex: none; padding: 4px 10px; border-radius: 999px;
  background: var(--hoi-muted); border: 1px solid var(--hoi-border-strong);
  font-size: 0.75rem; font-weight: 800; color: var(--hoi-fg-2);
}

.hoi3-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hoi3-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: var(--hoi-muted); border: 1px solid var(--hoi-border);
  font-size: 0.8rem; font-weight: 700; color: var(--hoi-fg-2);
}
.hoi3-chip--good { background: var(--hoi-ok-soft); border-color: transparent; color: var(--hoi-ok); }
.hoi3-chip--strong { background: var(--hoi-accent-soft); border-color: transparent; color: var(--hoi-accent); }
html[data-theme="day"] .hoi3-chip--strong { color: #b45309; }
/* "+ comisión" en morado, como en el checkout */
.hoi3-chip--fee { background: rgba(168, 85, 247, .16); border-color: transparent; color: #c084fc; }
html[data-theme="day"] .hoi3-chip--fee { background: rgba(147, 51, 234, .1); color: #7e22ce; }

/* Pago en línea: a lo ancho, con las marcas aceptadas */
.hoi3-card--wide { grid-column: 1 / -1; }
.hoi3-brands .ckp-row__icons { display: flex; flex-wrap: wrap; gap: 6px; }
.hoi3-brands .ckp-badge { width: 44px; height: 29px; display: block; border-radius: 5px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }

.hoi3-card__lead { margin: 0; font-size: 0.97rem; line-height: 1.55; color: var(--hoi-fg-2); }

/* Datos a la vista (envío Didi/Uber): recuadro similar al de "próxima entrega" */
.hoi3-facts {
  list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 8px;
  border-radius: 14px; background: var(--hoi-accent-soft); border: 1px solid rgba(255, 162, 0, .22);
}
.hoi3-facts li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: start; font-size: 0.88rem; line-height: 1.45; color: var(--hoi-fg-2); }
.hoi3-facts li svg { margin-top: 3px; color: var(--hoi-accent); }
html[data-theme="day"] .hoi3-facts { border-color: rgba(180, 83, 9, .2); }
html[data-theme="day"] .hoi3-facts li svg { color: #b45309; }
.hoi3-schedule > * { margin: 0 !important; }

/* Ver detalles */
.hoi3-more { margin-top: auto; padding-top: 2px; }
.hoi3-more summary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; margin-left: -4px; border-radius: 999px;
  font-size: 0.86rem; font-weight: 800; color: var(--hoi-accent);
  cursor: pointer; list-style: none; user-select: none;
  transition: background .2s ease;
}
html[data-theme="day"] .hoi3-more summary { color: #b45309; }
.hoi3-more summary::-webkit-details-marker, .hoi3-more summary::marker { display: none; content: ""; }
.hoi3-more summary:hover { background: var(--hoi-accent-soft); }
.hoi3-more summary:focus-visible { outline: 2px solid var(--hoi-accent); outline-offset: 2px; }
.hoi3-more summary svg { transition: transform .25s ease; }
.hoi3-more[open] summary svg { transform: rotate(180deg); }
.hoi3-more__close, .hoi3-more[open] .hoi3-more__open { display: none; }
.hoi3-more[open] .hoi3-more__close { display: inline; }
.hoi3-more__list {
  display: flex; flex-direction: column; gap: 8px;
  margin: 8px 0 0; padding: 14px 14px 14px 16px; list-style: none;
  border-radius: 14px; background: var(--hoi-muted);
}
.hoi3-more[open] .hoi3-more__list { animation: hoi3-in .3s ease both; }
.hoi3-more__list li { position: relative; padding-left: 16px; font-size: 0.9rem; line-height: 1.5; color: var(--hoi-fg-2); }
.hoi3-more__list li::before {
  content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--hoi-accent);
}
.hoi3-more__list li.is-note { color: var(--hoi-ok); font-weight: 600; }
.hoi3-more__list li.is-note::before { background: var(--hoi-ok); }
@keyframes hoi3-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Aparición al hacer scroll */
.hoi3-js .hoi3-card { opacity: 0; transform: translateY(16px); }
.hoi3-js .hoi3-card.is-in {
  opacity: 1; transform: none;
  transition: opacity .55s ease, transform .55s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .25s ease;
  transition-delay: var(--d, 0ms), var(--d, 0ms), 0s, 0s;
}
.hoi3-js .hoi3-card.is-in:hover { transform: translateY(-3px); transition-delay: 0s; }
.hoi3-js .hoi3-card.is-soon.is-in { opacity: .6; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hoi3-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hoi3-row__label { flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; text-align: left; }
  .hoi3-row__icon { width: 52px; height: 52px; margin-bottom: 0; border-radius: 16px; }
  .hoi3-row__icon svg { width: 24px; height: 24px; }
  .hoi3-row__num { width: 22px; height: 22px; font-size: 0.75rem; top: -7px; right: -7px; }
  .hoi3-row__label small { margin-left: auto; }
}
@media (max-width: 640px) {
  .hoi3 { padding: 64px 0; }
  .hoi3-head { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .hoi3-head__side { justify-content: center; }
  .hoi3-panel { padding: 4px 16px; border-radius: 22px; }
  .hoi3-row { padding: 20px 0; }
  .hoi3-row__title { font-size: 1.12rem; }
  .hoi3-row__cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hoi3-card { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .hoi3 *, .hoi3 *::before, .hoi3 *::after { animation: none !important; transition: none !important; }
  .hoi3-js .hoi3-card { opacity: 1; transform: none; }
}
