/* ==========================================================================
   Sidrería Balmes · Estilos de carta-qr.html (carta digital / QR)
   ========================================================================== */

:root {
  --green:       #1a3c2e;
  --green-mid:   #2d5a42;
  --green-light: #4a7c5f;
  --gold:        #c9a84c;
  --gold-light:  #e6c97a;
  --cream:       #f8f4ed;
  --warm-white:  #fefcf8;
  --text-dark:   #1c1c1c;
  --text-mid:    #4a4a4a;
  --text-light:  #7a7a7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--warm-white);
  color: var(--text-dark);
  -webkit-tap-highlight-color: transparent;
}

/* ── LOADER ── */
#qr-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#qr-loader.hide { opacity: 0; visibility: hidden; }
.qr-loader-apple {
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.35));
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  animation: qrLoaderIn 0.6s ease forwards;
}
.qr-loader-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(6px);
  animation: qrLoaderIn 0.6s ease 0.25s forwards;
}
.qr-loader-sub {
  color: var(--gold-light);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  animation: qrLoaderIn 0.6s ease 0.4s forwards;
}
@keyframes qrLoaderIn { to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── HEADER ── */
header.qr-header {
  background: var(--green);
  padding: 1.6rem 1.2rem 1.2rem;
  text-align: center;
  position: relative;
}
.qr-call-fab {
  position: absolute;
  top: 1.2rem;
  right: 1.1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
}
.qr-lang-fab {
  position: absolute;
  top: 1.2rem;
  left: 1.1rem;
  height: 38px;
  padding: 0 0.85rem;
  border-radius: 50px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.qr-call-fab svg { width: 18px; height: 18px; }
header.qr-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 16px;
  background: var(--green);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.qr-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
}
.qr-brand {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0.5rem 0 0.15rem;
}
.qr-sub {
  color: var(--gold-light);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ── TABS (sticky) ── */
.qr-tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  background: var(--green);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding: 0 0.4rem;
}
.qr-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255,255,255,0.55);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.9rem 0.3rem;
  cursor: pointer;
}
.qr-tab-btn.active { color: var(--gold-light); border-bottom-color: var(--gold-light); }

/* ── HOW IT WORKS ── */
.qr-howto {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: var(--cream);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin: 1.2rem 0 0.4rem;
}
.qr-howto-icon { font-size: 1.3rem; line-height: 1; }
.qr-howto p { margin: 0; font-size: 0.82rem; color: var(--text-mid); line-height: 1.55; }
.qr-howto strong { color: var(--green); }

/* ── PANELS ── */
main { padding: 1.4rem 1.1rem 6rem; max-width: 560px; margin: 0 auto; }
.qr-panel { display: none; }
.qr-panel.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.qr-group-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--green);
  margin: 1.8rem 0 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(26,60,46,0.15);
}
.qr-group-title:first-child { margin-top: 0.2rem; }

.qr-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(26,60,46,0.08);
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.qr-item:last-child { border-bottom: none; }
.qr-item.selected { background: rgba(201,168,76,0.12); border-radius: 10px; }
.qr-item-info { flex: 1; min-width: 0; }
.qr-item-name { flex: 1; min-width: 0; font-size: 0.98rem; font-weight: 500; color: var(--text-dark); overflow-wrap: break-word; }
.qr-item-price { order: 2; }

/* ── STEPPER (cantidad) ── */
.qr-stepper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  width: 76px;
  flex-shrink: 0;
}
.qr-step-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(26,60,46,0.08);
  color: var(--green);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.qr-stepper[data-qty="0"] .qr-step-minus,
.qr-stepper[data-qty="0"] .qr-step-qty { display: none; }
.qr-stepper:not([data-qty="0"]) .qr-step-minus,
.qr-stepper:not([data-qty="0"]) .qr-step-plus { background: var(--green); color: #fff; }
.qr-step-qty { font-size: 0.94rem; font-weight: 700; color: var(--green); min-width: 14px; text-align: center; }
.qr-stepper-corner {
  position: absolute;
  top: 1rem; right: 1rem;
  width: auto;
}
.qr-item-desc { font-size: 0.8rem; color: var(--text-light); margin-top: 0.15rem; }
.qr-item-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}
.qr-note {
  font-size: 0.75rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ── FOTO DEL PLATO ── */
.qr-photo-btn {
  order: 1;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid rgba(201,168,76,0.4);
  padding: 0;
  background: rgba(26,60,46,0.08);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qr-photo-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.qr-special-card .qr-photo-btn { position: absolute; top: 1rem; right: 3.7rem; }
.qr-photo-spacer { order: 1; flex-shrink: 0; width: 52px; height: 52px; }

.qr-photo-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(10,20,15,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.2rem;
}
.qr-photo-modal.open { display: flex; }
.qr-photo-modal img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.qr-photo-modal-title {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.15rem;
  text-align: center;
}
.qr-photo-modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ── MENÚS ESPECIALES ── */
.qr-special-card {
  position: relative;
  background: var(--cream);
  border: 1.5px solid rgba(201,168,76,0.3);
  border-radius: 16px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.qr-special-card.selected { background: rgba(201,168,76,0.18); border-color: var(--gold); }
.qr-special-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 0.9rem;
  padding-right: 5.4rem;
}
.qr-special-course {
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.7rem;
}
.qr-special-dish { font-size: 0.92rem; color: var(--text-mid); margin-top: 0.15rem; line-height: 1.5; }
.qr-special-or { color: var(--text-light); font-size: 0.78rem; font-style: italic; }
.qr-special-price {
  margin-top: 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(201,168,76,0.25);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.qr-special-amount { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--green); }
.qr-special-note { font-size: 0.76rem; color: var(--text-light); }
.qr-specials-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 0.6rem;
}

/* ── FOOTER CTA (sticky) ── */
.qr-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  background: var(--warm-white);
  border-top: 1px solid rgba(26,60,46,0.1);
  padding: 0.8rem 1.1rem calc(0.8rem + env(safe-area-inset-bottom));
  display: flex;
  gap: 0.7rem;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.06);
}
.qr-cta a, .qr-cta button {
  flex: 1;
  text-align: center;
  padding: 0.85rem 1rem;
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.qr-cta .site { background: none; border: 1.5px solid var(--green); color: var(--green); flex: 0 0 auto; padding: 0.85rem 1.2rem; }
.qr-selection-btn { background: rgba(26,60,46,0.12); color: var(--green); transition: background 0.2s, color 0.2s; }
.qr-selection-btn.has-items { background: var(--gold); color: var(--green); }
.sel-badge {
  background: rgba(255,255,255,0.5);
  color: var(--green);
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  padding: 0 4px;
}
.qr-selection-btn:not(.has-items) .sel-badge { background: rgba(26,60,46,0.15); }

/* ── SUMMARY MODAL ── */
.qr-summary-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10,20,15,0.55);
  display: none;
  align-items: flex-end;
}
.qr-summary-modal.open { display: flex; }
.qr-summary-sheet {
  background: var(--warm-white);
  width: 100%;
  max-height: 82vh;
  border-radius: 20px 20px 0 0;
  padding: 1.4rem 1.2rem calc(1.4rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  animation: qrSheetUp 0.3s ease;
}
@keyframes qrSheetUp { from { transform: translateY(30px); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }
.qr-summary-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.qr-summary-header h3 { font-family: 'Playfair Display', serif; color: var(--green); font-size: 1.25rem; margin: 0; }
.qr-summary-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(26,60,46,0.08);
  color: var(--green);
  font-size: 1rem;
  cursor: pointer;
}
.qr-summary-list { overflow-y: auto; flex: 1; margin-bottom: 0.6rem; }
.qr-summary-empty { text-align: center; color: var(--text-light); font-size: 0.9rem; padding: 2rem 0; }
.qr-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(26,60,46,0.08);
}
.qr-summary-row-main { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; }
.qr-summary-row-name { font-size: 0.92rem; color: var(--text-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-summary-row-qty { color: var(--gold); font-weight: 700; }
.qr-summary-row-end { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.qr-summary-row-price { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--green); white-space: nowrap; }
.qr-summary-row-remove {
  background: none; border: none; color: var(--text-light);
  font-size: 1.1rem; cursor: pointer; padding: 0 0.2rem; line-height: 1;
}
.qr-summary-stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  background: rgba(26,60,46,0.06);
  border-radius: 20px;
  padding: 0.2rem;
}
.qr-sum-step-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.qr-sum-qty { font-size: 0.85rem; font-weight: 700; color: var(--green); min-width: 14px; text-align: center; }
.qr-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 0.9rem;
  border-top: 1.5px solid rgba(26,60,46,0.15);
  margin-top: 0.4rem;
}
.qr-summary-total span { font-size: 0.85rem; color: var(--text-light); }
.qr-summary-total strong { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--green); }
.qr-summary-hint { font-size: 0.76rem; color: var(--text-light); font-style: italic; text-align: center; margin: 0.8rem 0 0; }

/* ── FOOTER ── */
.qr-footer {
  text-align: center;
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(26,60,46,0.08);
}
.qr-powered-by {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.2s, color 0.2s;
}
.qr-powered-by:hover { opacity: 1; color: var(--gold); }
