/* ===================== TIENDA — carrito, cuentas, checkout ===================== */

/* Botón "+ Agregar" inyectado en cada fila .pl */
.pl-add {
  flex: 0 0 auto;
  margin-left: 8px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--ember-soft), var(--ember));
  color: #2a1206; font-size: 1.35rem; font-weight: 800; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(255,90,31,.32);
  transition: transform .12s, box-shadow .12s, background .12s;
}
/* Filas sin botón "+": reservan el mismo espacio que ocupa el botón en las
   demás filas (padding base 9px + gap 6px + margen 8px + botón 34px = 57px)
   para que el precio quede alineado con el resto de precios. */
.pl[data-no-cart] { padding-right: 57px; }

.pl-add:hover { transform: scale(1.1); box-shadow: var(--ember-glow); }
.pl-add:active { transform: scale(.94); }
.pl-add.added { background: #1E8E3E; color: #fff; }

/* Botón flotante del carrito (abajo-izquierda, para no chocar con WhatsApp) */
.cart-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 90;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--brasa); color: #fff;
  border: none; cursor: pointer;
  padding: 13px 18px; border-radius: 999px;
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: .95rem;
  box-shadow: 0 8px 24px rgba(197,14,10,.45);
  transition: transform .15s;
}
.cart-fab:hover { transform: translateY(-2px) scale(1.03); }
.cart-fab svg { width: 22px; height: 22px; fill: #fff; }
.cart-fab .cart-count {
  min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--maiz); color: #2a1d00; border-radius: 999px;
  font-size: .8rem; font-weight: 800; display: grid; place-items: center;
}
.cart-fab.empty { display: none; }

/* Botón de cuenta en el header */
.acct-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1.5px solid rgba(255,255,255,.4);
  padding: 9px 16px; border-radius: 999px;
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: .82rem;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.acct-btn:hover { background: rgba(255,255,255,.22); }
.acct-btn svg { width: 16px; height: 16px; fill: currentColor; }
@media (max-width: 1150px) { .acct-btn .acct-label { display: none; } .acct-btn { padding: 9px 11px; } }

/* ===================== Overlays / drawer / modales ===================== */
.ep-overlay {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(10,5,4,.6); backdrop-filter: blur(3px);
  display: none;
}
.ep-overlay.open { display: block; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 131;
  width: min(420px, 100%);
  background: var(--hueso); color: var(--ink);
  box-shadow: -18px 0 50px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer header {
  position: static; background: var(--brasa-deep); color: #fff;
  padding: 18px 20px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: none;
}
.cart-drawer header h3 { font-family: 'Bricolage Grotesque','Inter',sans-serif; font-size: 1.25rem; }
.ep-x {
  background: rgba(255,255,255,.16); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; cursor: pointer; line-height: 1;
}
.ep-x:hover { background: var(--ember); }
.cart-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.cart-empty { text-align: center; color: var(--muted); padding: 50px 10px; }

.cart-item { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-name { font-weight: 600; font-size: .95rem; line-height: 1.25; }
.cart-item .ci-price { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty button {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 1.1rem; font-weight: 800; line-height: 1;
  color: var(--brasa); display: grid; place-items: center;
}
.qty button:hover { background: var(--brasa); color: #fff; border-color: var(--brasa); }
.qty .q { min-width: 20px; text-align: center; font-weight: 700; }
.ci-sub { font-family: 'Anton', sans-serif; font-size: 1.05rem; color: var(--brasa); white-space: nowrap; }
.ci-remove {
  flex: 0 0 auto;
  background: #fdecea; border: 1.5px solid #f3b6b2; color: var(--brasa);
  cursor: pointer; font-size: 1.15rem; line-height: 1;
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.ci-remove:hover { background: var(--brasa); color: #fff; border-color: var(--brasa); }
.ci-remove:active { transform: scale(.92); }

.cart-foot { border-top: 2px solid var(--line); padding: 16px 18px 20px; background: #fff; }
.cart-total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cart-total-row .lbl { font-weight: 700; }
.cart-total-row .val { font-family: 'Anton', sans-serif; font-size: 1.7rem; color: var(--brasa); }
.cart-total-row .val::before { content: "S/ "; font-size: .6em; color: var(--muted); }
.btn-block { display: block; width: 100%; text-align: center; justify-content: center; }
.btn-link { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .85rem; text-decoration: underline; margin-top: 8px; width: 100%; }
.btn-link:hover { color: var(--brasa); }

/* Modal centrado (auth, checkout, historial) */
.ep-modal {
  position: fixed; inset: 0; z-index: 132;
  display: none; place-items: center; padding: 20px;
}
.ep-modal.open { display: grid; }
.ep-modal-card {
  position: relative; background: var(--surface); color: var(--ink);
  width: min(460px, 100%); max-height: 88vh; overflow-y: auto;
  border-radius: 18px; padding: 26px 24px; box-shadow: var(--shadow-md);
}
.ep-modal-card.wide { width: min(560px, 100%); }
.ep-modal-card h3 { font-family: 'Bricolage Grotesque','Inter',sans-serif; font-size: 1.5rem; color: var(--brasa-deep); margin-bottom: 4px; }
.ep-modal-card .sub { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.ep-modal-x { position: absolute; top: 12px; right: 14px; background: #f0e6d6; border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; cursor: pointer; color: var(--ink); }
.ep-modal-x:hover { background: var(--brasa); color: #fff; }

/* Tabs (login/registro) */
.ep-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--hueso-2); padding: 5px; border-radius: 12px; }
.ep-tab { flex: 1; padding: 10px; border: none; background: none; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--muted); }
.ep-tab.active { background: #fff; color: var(--brasa); box-shadow: var(--shadow-sm); }

/* Formularios */
.ep-field { margin-bottom: 13px; }
.ep-field label { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 5px; color: var(--ink-soft); }
.ep-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: .95rem; background: #fff; color: var(--ink);
}
.ep-input:focus { outline: none; border-color: var(--ember); }
textarea.ep-input { resize: vertical; min-height: 60px; }

/* Campo de contraseña con ojo para mostrar/ocultar */
.ep-pass { position: relative; }
.ep-pass .ep-input { padding-right: 46px; }
.ep-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font-size: 1.15rem; line-height: 1;
  padding: 6px; border-radius: 8px; opacity: .85; transition: background .12s, opacity .12s;
}
.ep-eye:hover { opacity: 1; background: rgba(0,0,0,.06); }

.ep-alert { padding: 11px 14px; border-radius: 10px; font-size: .88rem; margin-bottom: 14px; }
.ep-alert.err { background: #fdecea; color: #9b1c17; border: 1px solid #f5c6c3; }
.ep-alert.ok  { background: #e7f6ec; color: #1a7a3c; border: 1px solid #bfe6cd; }

/* Datos de la cuenta en checkout (nombre + correo, solo lectura) */
.co-cuenta { background: var(--hueso); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; display: flex; flex-direction: column; }
.co-cuenta:empty { display: none; }
.co-cuenta .co-lbl { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.co-cuenta b { font-size: 1rem; color: var(--ink); }
.co-cuenta .co-mail { font-size: .85rem; color: var(--muted); }

/* Resumen de checkout */
.co-summary { background: var(--hueso); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.co-line { display: flex; justify-content: space-between; font-size: .9rem; padding: 4px 0; }
.co-line.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 8px; font-weight: 800; font-size: 1.05rem; color: var(--brasa); }

/* Historial */
.hist-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fff; }
.hist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.hist-code { font-weight: 800; color: var(--brasa-deep); }
.hist-date { font-size: .8rem; color: var(--muted); }
.hist-badge { display: inline-block; font-size: .68rem; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 5px; background: #e7f6ec; color: #1a7a3c; }
.hist-items { font-size: .86rem; color: var(--ink-soft); margin: 4px 0; }
.hist-foot { display: flex; justify-content: space-between; font-size: .86rem; margin-top: 6px; }
.hist-total { font-family: 'Anton', sans-serif; font-size: 1.15rem; color: var(--brasa); }
.hist-total::before { content: "S/ "; font-size: .62em; color: var(--muted); }

/* Toast */
.ep-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  z-index: 200; background: var(--carbon); color: #fff;
  padding: 14px 22px; border-radius: 12px; box-shadow: var(--shadow-md);
  font-weight: 600; font-size: .92rem; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; max-width: 90vw; text-align: center;
}
.ep-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Selector de sabor (variantes) */
.var-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.var-opt {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 15px 18px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.var-price { color: var(--brasa); font-weight: 800; font-size: .95rem; white-space: nowrap; }
.var-price::before { content: ""; }
.var-opt:hover { border-color: var(--ember); background: #fff7f2; transform: translateY(-1px); }
.var-opt:hover .var-price { color: var(--ember); }
.var-opt:active { transform: scale(.99); }

/* Selector múltiple (combos: torres de alitas) */
.combo-opts { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.combo-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
}
.combo-name { font-weight: 700; font-size: .98rem; }
.combo-counter { text-align: center; font-weight: 800; color: var(--muted); margin-bottom: 12px; font-size: .92rem; }
.combo-counter.full { color: #1a7a3c; }

/* Menú de cuenta (dropdown) */
.acct-menu {
  position: fixed; z-index: 133; background: #fff; color: var(--ink);
  border-radius: 12px; box-shadow: var(--shadow-md); padding: 6px; min-width: 180px;
  display: none;
}
.acct-menu.open { display: block; }
.acct-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 11px 12px; border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 600; color: var(--ink);
}
.acct-menu button:hover { background: var(--hueso); color: var(--brasa); }
.acct-menu .acct-email { padding: 8px 12px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }
