/* Promociones (public/app/promos.js): tarjetas del cliente, detalle, tarjetas y formulario de los paneles. */

/* ---------- Tarjeta del cliente ---------- */
.pr-carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 10px;
  margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.pr-carousel::-webkit-scrollbar { display: none; }
.pr-carousel > div { scroll-snap-align: start; flex: 0 0 auto; }
.pr-card { display: flex; flex-direction: column; width: 200px; padding: 0; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; overflow: hidden;
  box-shadow: 0 1px 4px var(--shadow); }
.pr-card:active { transform: scale(.985); }
.pr-card-wide { width: min(300px, 78vw); }
.pr-media { position: relative; display: block; }
.pr-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.pr-card-wide .pr-photo { aspect-ratio: 16 / 9; }
.pr-photo-empty { display: flex; align-items: center; justify-content: center; font-size: 40px; }
.pr-tag { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; background: var(--brand);
  color: var(--on-brand); font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.pr-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.pr-where { font-size: 12px; color: var(--muted); font-weight: 600; }
.pr-name { font-size: 16px; line-height: 1.25; }
.pr-prices { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.pr-price { font-size: 19px; color: var(--brand-text); }
.pr-regular { color: var(--muted); font-size: 14px; }
.pr-off { padding: 1px 6px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 800; }
.pr-time { font-size: 13px; color: var(--warn); font-weight: 600; }
.pr-save { color: var(--ok); font-weight: 700; }

/* ---------- Detalle (hoja inferior) ---------- */
.pr-detail h3 { margin: 12px 0 4px; }
.pr-detail-media { position: relative; margin: 0 -4px; }
.pr-detail-photo { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 14px; background: var(--surface-2); }
.pr-detail-photo.pr-photo-empty { height: 140px; }
.pr-includes { margin: 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pr-includes-title { display: block; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.pr-include { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.pr-include span:nth-child(2) { flex: 1; }
.pr-detail-prices { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pr-detail-prices .pr-price { font-size: 24px; }
.pr-detail-facts { margin: 6px 0 0; color: var(--muted); }
.pr-limit { margin-top: 10px; }

/* ---------- Paneles: lista ---------- */
.pr-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; vertical-align: 2px; }
.pr-status-ok { background: var(--ok-soft); color: var(--ok); }
.pr-status-warn { background: var(--warn-soft); color: var(--warn); }
.pr-status-info { background: var(--info-soft); color: var(--info); }
.pr-status-danger { background: var(--danger-soft); color: var(--danger); }
.pr-status-neutral { background: var(--neutral-soft); color: var(--muted); }
.pr-live { font-size: 12px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.pr-staff { display: flex; flex-direction: column; gap: 8px; }
.pr-staff-top { display: flex; gap: 12px; align-items: flex-start; }
.pr-thumb { flex: 0 0 76px; width: 76px; height: 76px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.pr-thumb.pr-photo-empty { font-size: 30px; }
.pr-staff-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pr-staff-title strong { font-size: 17px; }
.pr-staff-price { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.pr-staff-price b { font-size: 18px; }
.pr-staff-items { color: var(--text); }
.pr-notes { margin: 0; padding: 8px 12px 8px 28px; border-radius: 10px; background: var(--warn-soft); }
.pr-notes li { margin: 2px 0; }
.pr-reject { padding: 8px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--text); }
.pr-metrics { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; padding-top: 6px; border-top: 1px dashed var(--line); }
.pr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-actions .btn { flex: 1 1 auto; min-height: 44px; }
.pr-filters { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.pr-filters .chip { white-space: nowrap; }

/* ---------- Paneles: formulario ---------- */
.pr-editor .section-title { margin-top: 22px; }
.pr-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr-kind { position: relative; margin: 0 !important; font-weight: 400 !important; }
.form .pr-kind input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.pr-kind span { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--surface); cursor: pointer; height: 100%; box-sizing: border-box; }
.pr-kind small { color: var(--muted); font-size: 13px; }
.pr-kind input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.pr-kind input:focus-visible + span { outline: 3px solid var(--focus-ring); }
.pr-photo-field { display: flex; gap: 12px; align-items: center; }
.pr-photo-preview { width: 110px; height: 82px; border-radius: 12px; object-fit: cover; background: var(--surface-2); display: block; }
.pr-photo-preview.pr-photo-empty { font-size: 32px; }
.pr-products { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.pr-product { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; margin: 0 !important;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; font-weight: 400 !important; background: var(--surface); }
.pr-product.is-on { border-color: var(--brand); background: var(--brand-soft); }
.form .pr-product input[type="radio"] { width: 24px; height: 24px; min-height: 0; padding: 0; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
.pr-product-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pr-product .stepper button { width: 38px; height: 38px; font-size: 20px; }
.pr-normal { margin: 10px 0 0; }
.pr-savings-box { margin-top: 8px; }
.pr-check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin: 8px 0 !important; }
.form .pr-check input { width: 24px; height: 24px; min-height: 0; padding: 0; flex: 0 0 auto; margin: 0; accent-color: var(--brand); }
.pr-check > span { flex: 1; min-width: 0; }
.pr-check small { display: block; font-size: 13px; }
.pr-branches { padding-left: 14px; border-left: 3px solid var(--line); }
.pr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-two > div { min-width: 0; }
.form .pr-two input { width: 100%; min-width: 0; box-sizing: border-box; }
.pr-dates { grid-template-columns: 1fr; gap: 0; }
.pr-more { margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.pr-more summary { cursor: pointer; font-weight: 700; }
.pr-days { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.pr-day { position: relative; margin: 0 !important; }
.form .pr-day input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.pr-day span { display: inline-block; min-width: 44px; padding: 9px 6px; text-align: center; border: 1px solid var(--line);
  border-radius: 10px; font-weight: 700; cursor: pointer; background: var(--surface); }
.pr-day input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.pr-day input:focus-visible + span { outline: 3px solid var(--focus-ring); }
.pr-preview { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pr-preview .card { width: 100%; box-sizing: border-box; }
.pr-submit { display: flex; gap: 8px; margin-top: 18px; }
.pr-submit .btn { flex: 1; }
.pr-editor select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--input-bg); color: var(--text); font: inherit; }
@media (max-width: 380px) { .pr-two, .pr-kinds { grid-template-columns: 1fr; } }
.pr-history { margin: 0; padding-left: 18px; }
.pr-history li { margin: 4px 0; }
.pr-staff-title a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

/* ---------- Editor de producto con opciones (public/app/product-editor.js) ---------- */
.pe-group { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.pe-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pe-tools { display: flex; gap: 6px; }
.pe-tools .btn { min-height: 38px; min-width: 42px; padding: 0 10px; }
.pe-two { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.pe-two-2 { grid-template-columns: 1fr 1.4fr; }
.pe-two > div { min-width: 0; }
.form .pe-two input, .form .pe-two select { width: 100%; min-width: 0; box-sizing: border-box; }
.pe select { width: 100%; min-height: 48px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); color: var(--text); font: inherit; }
.pe-check { display: flex !important; gap: 10px; align-items: center; font-weight: 400 !important; }
.form .pe-check input { width: 24px; height: 24px; min-height: 0; padding: 0; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
.pe-option { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pe-option.is-off { opacity: .55; }
.form .pe-option input { min-width: 0; margin: 0; }
.form .pe-option input[data-f="opt-name"] { flex: 1 1 0; width: auto; }
.form .pe-option .pe-delta { flex: 0 0 70px; width: 70px; padding-left: 8px; padding-right: 8px; }
.pe-option .btn { min-height: 40px; min-width: 40px; padding: 0 8px; flex: 0 0 auto; }
.pe-avail { display: flex !important; align-items: center; gap: 2px; margin: 0 !important; font-weight: 700 !important; color: var(--ok); }
.form .pe-avail input { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--ok); }
.pe-photo { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); font-size: 18px; overflow: hidden; cursor: pointer; }
.pe-photo img { width: 100%; height: 100%; object-fit: cover; }
.pe-photo-field { display: flex; align-items: center; gap: 12px; }
.pe-photo-big { flex: 0 0 104px; width: 104px; height: 104px; font-size: 30px; border-radius: 14px; }
@media (max-width: 380px) { .pe-two { grid-template-columns: 1fr 1fr; } .pe-two > div:first-child { grid-column: 1 / -1; } }

/* Promoción "Solo primer pedido" */
.pr-first { margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; }
.pr-first-tag { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; }
