:root {
  --bg:        #faf8f4;
  --surface:   #ffffff;
  --border:    #e8e2d8;
  --border2:   #d4ccc0;
  --accent:    #c8411a;
  --accent-h:  #a83312;
  --gold:      #b8860b;
  --text:      #1a1614;
  --muted:     #8a7e74;
  --green:     #2d7a4f;
  --light:     #f0ebe3;
  --shadow:    0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 14px; line-height: 1.5; min-height: 100vh; }

/* HEADER */
header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.brand { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 700; letter-spacing: -0.5px; }
.brand em { color: var(--accent); font-style: italic; }
.cart-btn { display: none; align-items: center; gap: 8px; background: var(--text); color: white; border: none; border-radius: 8px; padding: 8px 14px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.cart-btn:hover { background: #333; }
.cart-badge { background: var(--accent); color: white; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600; }

/* STEPS */
.steps-bar { display: flex; align-items: center; justify-content: center; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border); gap: 0; }
.step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.step.active { color: var(--accent); }
.step.done   { color: var(--green); }
.step-num { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.step.done .step-num   { background: var(--green);  border-color: var(--green);  color: white; }
.step.active .step-num { background: var(--accent); border-color: var(--accent); color: white; }
.step-line { width: 28px; height: 1px; background: var(--border2); margin: 0 4px; }
.step-line.done { background: var(--green); }

/* MAIN */
main { max-width: 660px; margin: 0 auto; padding: 24px 16px 100px; }

/* SCREENS */
.screen { display: none; flex-direction: column; gap: 18px; }
.screen.active { display: flex; }

/* CARD */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.card-header { padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.card-title { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.card-sub { color: var(--muted); font-size: 12px; }
.card-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }

/* FIELDS */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.field input { border: 1.5px solid var(--border2); border-radius: 8px; padding: 10px 14px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); transition: border-color 0.2s; outline: none; }
.field input:focus { border-color: var(--accent); background: white; }
.field input.error { border-color: #e84040; }
.field-hint  { font-size: 11px; color: var(--muted); }
.field-error { font-size: 11px; color: #e84040; display: none; }
.field-error.show { display: block; }

/* BUTTONS */
.btn-primary { background: var(--accent); color: white; border: none; border-radius: 10px; padding: 13px 24px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s; width: 100%; }
.btn-primary:hover     { background: var(--accent-h); }
.btn-primary:disabled  { background: var(--border2); cursor: not-allowed; }
.btn-secondary { background: var(--light); color: var(--text); border: 1px solid var(--border2); border-radius: 10px; padding: 11px 20px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.2s; width: 100%; }
.btn-secondary:hover { background: var(--border); }

/* SECCIÓN CARDS */
.seccion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; }
.seccion-card { border: 2px solid var(--border2); border-radius: 12px; padding: 22px 14px; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s; background: var(--bg); }
.seccion-card:hover { border-color: var(--accent); background: #fff8f5; transform: translateY(-2px); }
.seccion-card.selected { border-color: var(--accent); background: #fff3ee; }
.seccion-icon { font-size: 34px; margin-bottom: 8px; }
.seccion-nombre { font-family: 'Fraunces', serif; font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.seccion-desc { font-size: 11px; color: var(--muted); }

/* BÚSQUEDA */
.search-wrap { position: relative; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.search-input { width: 100%; border: 1.5px solid var(--border2); border-radius: 10px; padding: 10px 14px 10px 38px; font-family: 'DM Sans', sans-serif; font-size: 14px; background: var(--bg); outline: none; transition: border-color 0.2s; }
.search-input:focus { border-color: var(--accent); background: white; }
.search-icon { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-spinner { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); display: none; font-size: 12px; color: var(--muted); }

/* PRODUCTOS */
.productos-list { display: flex; flex-direction: column; }
.producto-item { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid #f0ebe3; transition: background 0.15s; }
.producto-item:last-child { border-bottom: none; }
.producto-item:hover { background: #faf7f3; }
.producto-emoji { font-size: 20px; flex-shrink: 0; }
.producto-info { flex: 1; min-width: 0; }
.producto-nombre { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.producto-precio { font-size: 12px; color: var(--muted); margin-top: 2px; }
.producto-precio strong { color: var(--green); }
.btn-agregar { background: var(--text); color: white; border: none; border-radius: 8px; padding: 7px 13px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.15s; flex-shrink: 0; }
.btn-agregar:hover { background: var(--accent); }
.productos-empty { padding: 36px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-icon { font-size: 30px; margin-bottom: 8px; }

/* MODAL SHEET */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); z-index: 600; display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-sheet { background: var(--surface); border-radius: 18px 18px 0 0; width: 100%; max-width: 640px; transform: translateY(30px); transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1); }
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-handle { width: 36px; height: 4px; background: var(--border2); border-radius: 2px; margin: 12px auto 0; }
.modal-sheet-header { padding: 14px 20px 12px; border-bottom: 1px solid var(--border); }
.modal-prod-nombre { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 700; }
.modal-prod-precio { color: var(--muted); font-size: 12px; margin-top: 3px; }
.modal-sheet-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; }
.qty-label { font-size: 13px; font-weight: 500; }
.qty-ctrl { display: flex; align-items: center; gap: 12px; }
.qty-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border2); background: var(--bg); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s, background 0.15s; }
.qty-btn:hover { border-color: var(--accent); background: #fff3ee; }
.qty-val { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; min-width: 32px; text-align: center; }
.adicional-wrap { display: none; flex-direction: column; gap: 5px; }
.adicional-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.adicional-input { border: 1.5px solid var(--border2); border-radius: 8px; padding: 9px 12px; font-family: 'DM Sans', sans-serif; font-size: 13px; background: var(--bg); outline: none; resize: none; transition: border-color 0.2s; }
.adicional-input:focus { border-color: var(--accent); }
.modal-sheet-footer { padding: 12px 20px 20px; border-top: 1px solid var(--border); }
.btn-confirm-add { background: var(--accent); color: white; border: none; border-radius: 10px; padding: 13px; width: 100%; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-confirm-add:hover { background: var(--accent-h); }

/* BARRA CARRITO */
.carrito-panel { position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; display: flex; justify-content: center; pointer-events: none; }
.carrito-bar { max-width: 628px; width: calc(100% - 32px); background: var(--text); color: white; margin: 0 16px 14px; border-radius: 14px; padding: 13px 18px; display: none; align-items: center; justify-content: space-between; box-shadow: var(--shadow-lg); pointer-events: all; cursor: pointer; transition: transform 0.15s; }
.carrito-bar:hover { transform: translateY(-2px); }
.carrito-bar.visible { display: flex; }
.carrito-bar-info { display: flex; flex-direction: column; gap: 2px; }
.carrito-count { font-size: 11px; color: #aaa; }
.carrito-total-bar { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 700; }
.carrito-arrow { font-size: 18px; }

/* CARRITO LISTA */
.carrito-items { display: flex; flex-direction: column; }
.carrito-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #f0ebe3; }
.carrito-item:last-child { border-bottom: none; }
.carrito-item-emoji { font-size: 20px; flex-shrink: 0; }
.carrito-item-info { flex: 1; min-width: 0; }
.carrito-item-nombre { font-weight: 500; font-size: 13px; }
.carrito-item-det  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.carrito-item-nota { font-size: 11px; color: var(--gold); margin-top: 2px; }
.carrito-item-sub { font-weight: 600; color: var(--green); font-size: 13px; white-space: nowrap; }
.btn-del { background: none; border: 1px solid var(--border2); border-radius: 6px; padding: 4px 7px; color: var(--muted); cursor: pointer; font-size: 11px; transition: border-color 0.15s, color 0.15s; }
.btn-del:hover { border-color: #e84040; color: #e84040; }
.carrito-total-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 2px solid var(--border); background: var(--light); }
.carrito-total-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.carrito-total-vals { text-align: right; }
.carrito-total-usd { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 700; color: var(--green); }
.carrito-total-bs  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* MODALIDAD */
.modalidad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; }
.modalidad-card { border: 2px solid var(--border2); border-radius: 12px; padding: 20px 14px; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s; background: var(--bg); }
.modalidad-card:hover { border-color: var(--accent); background: #fff8f5; transform: translateY(-2px); }
.modalidad-card.selected { border-color: var(--accent); background: #fff3ee; }
.modalidad-icon { font-size: 28px; margin-bottom: 8px; }
.modalidad-nombre { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.modalidad-desc { font-size: 11px; color: var(--muted); }

/* RESUMEN */
.resumen-box { background: var(--light); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.resumen-fila { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.resumen-fila-label { color: var(--muted); }
.resumen-fila-val { font-weight: 500; }

/* ÉXITO */
.success-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 40px 20px; }
.success-icon { font-size: 54px; }
.success-title { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700; }
.success-sub { color: var(--muted); font-size: 13px; max-width: 290px; line-height: 1.6; }
.success-num { background: var(--light); border: 1px solid var(--border2); border-radius: 8px; padding: 10px 20px; font-family: 'Fraunces', serif; font-size: 17px; font-weight: 700; color: var(--green); }

/* TOAST */
.toast { position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--text); color: white; padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 1000; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* CAMBIAR SECCIÓN */
.link-cambiar { font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.link-cambiar:hover { color: var(--accent-h); }

@media (max-width: 460px) {
  .step span:not(.step-num) { display: none; }
  .step-line { width: 20px; }
}

/* HEADER ACTIONS */
.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-menu { display: flex; align-items: center; gap: 6px; background: var(--light); color: var(--text); border: 1px solid var(--border2); border-radius: 8px; padding: 7px 13px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background 0.2s; }
.btn-menu:hover { background: var(--border); }

/* TELÉFONO SHOW (cliente nuevo) */
.tlf-show { background: var(--light); border: 1.5px solid var(--border2); border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--text); }
