/* Tienda pública — mobile first
 * --brand se sobreescribe en cada tienda desde PHP.
 */
:root { --brand: #D45A36; }

body { background: #fff; }

.shop-cover { height: 140px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); position: relative; }
.shop-cover img { width: 100%; height: 100%; object-fit: cover; }

.shop-head { padding: 0 18px; margin-top: -34px; position: relative; }
.shop-avatar { width: 64px; height: 64px; border-radius: 16px; background: #fff; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.12); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--brand); }
.shop-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; margin: 14px 0 2px; }
.shop-meta { font-size: 13.5px; color: var(--tinta); margin-bottom: 6px; }
.shop-state { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dot-open { width: 8px; height: 8px; border-radius: 50%; background: var(--estado-listo); display: inline-block; margin-right: 5px; }
.dot-closed { width: 8px; height: 8px; border-radius: 50%; background: var(--ceniza); display: inline-block; margin-right: 5px; }
.shop-state .open { color: var(--estado-listo); font-weight: 600; display: inline-flex; align-items: center; }
.shop-state .closed { color: var(--ceniza); font-weight: 600; display: inline-flex; align-items: center; }
.shop-state .hours { color: var(--ceniza); font-family: var(--font-mono); font-size: 12.5px; }

.closed-banner { margin: 14px 18px 0; padding: 12px 14px; background: var(--linea-3); border-radius: 11px; font-size: 13.5px; color: var(--tinta); }

.cats { display: flex; gap: 8px; padding: 16px 18px 4px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { font-size: 13px; font-weight: 600; background: var(--linea-3); color: var(--tinta); padding: 9px 16px; border-radius: 18px; white-space: nowrap; border: none; cursor: pointer; font-family: inherit; }
.cat.active { background: var(--brand); color: #fff; }

.promo { margin: 14px 18px 4px; border-radius: 14px; overflow: hidden; height: 96px; background: var(--brand); position: relative; }
.promo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.promo .gradient { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 18px; background: linear-gradient(90deg, rgba(36,28,22,.6), rgba(36,28,22,.05)); }
.promo .eye { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.promo .title { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: #fff; }

.cat-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin: 20px 18px 4px; }
.products { padding: 0 18px; }
.product { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--linea-3); }
.product:first-child { border-top: none; }
.product .info { flex: 1; min-width: 0; }
.product .name { font-size: 15px; font-weight: 600; }
.product .desc { font-size: 12.5px; color: var(--ceniza); line-height: 1.4; margin: 2px 0 4px; }
.product .price { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--brand); }
.product .thumb {
  width: 70px; height: 70px; border-radius: 13px; overflow: hidden; flex-shrink: 0; position: relative;
  background: linear-gradient(135deg, var(--linea-4), var(--linea-3));
}
.product .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.add-btn { position: absolute; bottom: 4px; right: 4px; width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: #fff; border: none; cursor: pointer; display: grid; place-items: center; font-weight: 700; font-size: 18px; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.stepper { display: none; position: absolute; bottom: 4px; right: 4px; left: 4px; align-items: center; justify-content: space-between; background: var(--brand); border-radius: 9px; padding: 4px; color: #fff; }
.stepper button { background: transparent; border: none; color: #fff; font-weight: 700; cursor: pointer; width: 22px; height: 22px; font-size: 18px; line-height: 1; font-family: inherit; }
.stepper [data-qty] { font-family: var(--font-mono); font-weight: 700; font-size: 13px; }

.empty-state { text-align: center; padding: 60px 24px; color: var(--ceniza); }
.empty-state h2 { font-family: var(--font-display); font-size: 20px; color: var(--carbon); margin: 0 0 8px; }
.empty-state p { margin: 0; font-size: 14px; }

.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--linea-3); transform: translateY(120%); transition: transform .25s ease; z-index: 30; }
.cart-bar.visible { transform: translateY(0); }
.cart-bar button { width: 100%; }
.spacer { height: 100px; }

.drawer { position: fixed; inset: 0; background: var(--papel); transform: translateX(100%); transition: transform .25s ease; z-index: 60; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 12px; position: sticky; top: 0; background: var(--papel); z-index: 2; border-bottom: 1px solid var(--linea-3); margin-bottom: 4px; }
.back-btn { width: 36px; height: 36px; border-radius: 11px; background: var(--linea-3); display: grid; place-items: center; color: var(--carbon); border: none; cursor: pointer; font-size: 18px; font-family: inherit; }
.drawer-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; }

.cart-list { padding: 8px 18px; background: #fff; margin: 0 18px; border-radius: 14px; border: 1px solid var(--linea); }
.cart-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 14px 0; border-top: 1px solid var(--linea-3); }
.cart-row:first-child { border-top: none; }
.cart-row .qty { color: var(--brand); font-weight: 700; font-size: 14px; font-family: var(--font-mono); }
.cart-row .name { font-size: 14px; font-weight: 600; }
.cart-row .unit { font-size: 11.5px; color: var(--ceniza); font-family: var(--font-mono); }
.cart-row .line-total { font-size: 14px; font-weight: 700; font-family: var(--font-mono); }
.stepper-mini { display: flex; gap: 6px; }
.stepper-mini button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--linea); background: #fff; cursor: pointer; font-weight: 700; font-family: inherit; }
.empty { padding: 36px 0; text-align: center; color: var(--ceniza); font-size: 14px; }

.notes { padding: 16px 18px 0; }
.notes label { font-size: 12px; font-weight: 600; color: var(--tinta); display: block; margin-bottom: 7px; }
.notes textarea { width: 100%; background: #fff; border: 1px solid var(--linea); border-radius: 11px; padding: 11px 13px; font-size: 14px; font-family: inherit; min-height: 60px; resize: none; }
.notes textarea:focus { outline: none; border-color: var(--brand); }

.coupon { padding: 16px 18px 0; }
.coupon label { font-size: 12px; font-weight: 600; color: var(--tinta); display: block; margin-bottom: 7px; }
.coupon label .hint { color: var(--ceniza); font-weight: 400; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; background: #fff; border: 1px solid var(--linea); border-radius: 11px; padding: 11px 13px; font-size: 14px; font-family: var(--font-mono); text-transform: uppercase; color: var(--carbon); }
.coupon-row input:focus { outline: none; border-color: var(--brand); }
.coupon-apply { background: var(--carbon); color: #fff; border: none; border-radius: 11px; padding: 0 18px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.coupon-apply:hover { background: #1a1410; }
.coupon-apply:disabled { opacity: .55; cursor: not-allowed; }
.coupon-status { font-size: 12.5px; margin-top: 8px; min-height: 17px; display: flex; align-items: center; gap: 6px; }
.coupon-status.ok { color: var(--estado-listo); }
.coupon-status.bad { color: var(--ladrillo); }
.coupon-status .clear { background: none; border: none; cursor: pointer; color: var(--ceniza); font-size: 12px; padding: 0; text-decoration: underline; margin-left: auto; font-family: inherit; }

.totals { padding: 16px 18px 0; }
.totals .inner { background: #fff; border: 1px solid var(--linea); border-radius: 14px; padding: 14px 16px; }
.totals .row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--tinta); margin-bottom: 6px; }
.totals .grand { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--linea-2); padding-top: 12px; margin-top: 4px; }
.totals .grand .label { font-weight: 700; font-size: 15px; }
.totals .grand .amount { font-family: var(--font-mono); font-weight: 700; font-size: 22px; color: var(--brand); }
.drawer-cta { padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); }

.field { padding: 0 18px; margin-top: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--tinta); display: block; margin-bottom: 7px; }
.field input, .field textarea { width: 100%; border: 1px solid var(--linea); border-radius: 11px; padding: 13px 14px; font-size: 15px; font-family: inherit; background: #fff; color: var(--carbon); }
.field input:focus { outline: none; border-color: var(--brand); }
.field .hint { font-size: 11.5px; color: var(--ceniza); font-weight: 400; }
.pay-info { padding: 0 18px; margin-top: 12px; }
.alias-card {
  background: linear-gradient(135deg, var(--linea-4), color-mix(in srgb, var(--brand) 8%, #fff));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--linea));
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.alias-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alias-label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ladrillo); font-weight: 700; font-family: var(--font-mono);
}
.alias-value {
  font-family: var(--font-mono); font-weight: 700; font-size: 17px;
  color: var(--carbon); letter-spacing: .02em;
  word-break: break-all;
}
.alias-titular {
  font-size: 12px; color: var(--tinta); margin-top: 2px;
}
.alias-copy {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--carbon); color: #fff; border: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  padding: 9px 12px; border-radius: 9px; flex-shrink: 0;
  transition: background .15s ease;
}
.alias-copy:hover { background: #1a1410; }
.alias-copy.copied { background: var(--estado-listo); }
.alias-copy.copied span:before { content: '✓ '; }
.alias-help {
  font-size: 11.5px; color: var(--ceniza);
  margin: 8px 4px 0; line-height: 1.4;
}

.pay-options { display: flex; gap: 8px; padding: 0 18px; margin-top: 8px; }
.pay-option { flex: 1; position: relative; }
.pay-option input { position: absolute; opacity: 0; pointer-events: none; }
.pay-option span { display: block; background: #fff; border: 1px solid var(--linea); border-radius: 11px; padding: 12px 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--tinta); cursor: pointer; }
.pay-option input:checked + span { border-color: var(--brand); color: var(--brand); border-width: 2px; padding: 11px 7px; font-weight: 700; }

.entrega-options { padding: 0 18px; display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; }
.entrega-option {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 2px solid var(--linea); border-radius: 14px;
  padding: 14px; cursor: pointer; position: relative;
  transition: all .15s ease;
  width: 100%; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.entrega-option input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.entrega-option .entrega-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--linea-3); display: grid; place-items: center;
  flex-shrink: 0; color: var(--tinta);
}
.entrega-option .entrega-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.entrega-option .title { display: block; font-size: 14.5px; font-weight: 700; color: var(--carbon); line-height: 1.2; }
.entrega-option .sub { display: block; font-size: 12.5px; color: var(--ceniza); line-height: 1.3; }
.entrega-option .sub.mono { font-family: var(--font-mono); color: var(--brand); font-weight: 700; }
.entrega-option .entrega-radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--linea-2);
  flex-shrink: 0; position: relative;
  transition: border-color .15s ease;
}
.entrega-option.active .entrega-radio { border-color: var(--brand); }
.entrega-option.active .entrega-radio::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand);
}

/* Tono brand suave para envío */
.entrega-option.entrega-envio { background: linear-gradient(135deg, #fff 0%, var(--linea-4) 100%); }
.entrega-option.entrega-envio .entrega-icon { background: var(--linea-4); color: var(--ladrillo); }

/* Tono neutro frío para retiro */
.entrega-option.entrega-retiro { background: linear-gradient(135deg, #fff 0%, var(--papel-3) 100%); }
.entrega-option.entrega-retiro .entrega-icon { background: var(--papel-3); color: var(--tinta); }

.entrega-option.active { border-color: var(--brand); box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--brand) 40%, transparent); }
.entrega-option.active .title { color: var(--brand); }

.confirm-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--estado-listo-bg); display: grid; place-items: center; margin: 40px auto 18px; }
.confirm h3 { font-family: var(--font-display); font-weight: 800; font-size: 24px; text-align: center; margin: 0 0 8px; }
.confirm p.lead-conf { font-size: 14.5px; color: var(--tinta); line-height: 1.5; text-align: center; margin: 0 18px 24px; }

@media (min-width: 720px) {
  .shop-head, .products, .cats, .promo, .cat-title, .empty-state { max-width: 600px; margin-left: auto; margin-right: auto; }
}
