/* Salvatore Carta QR — menú gráfico protagonista + rail de accesos */
:root {
  --salvatore-red: #C92F2F;
  --salvatore-red-dark: #A82323;
  --salvatore-green: #2F4E24;
  --salvatore-green-dark: #20391A;
  --salvatore-black: #000000;
  --salvatore-charcoal: #161616;
  --salvatore-white: #FFFFFF;
  --salvatore-offwhite: #F7F5F0;
  --salvatore-yellow: #D9A321;
  --salvatore-wa: #25D366;
  --sg-nav-h: 3.25rem;
  --sg-mbar-h: 3.6rem;
  --sg-radius: 14px;
  --sg-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  --sg-shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.18);
  --sg-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sg-dur: 340ms;
  --sg-font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sg-display: "Lilita One", "Source Sans 3", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.sg-page {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sg-font);
  color: var(--salvatore-charcoal);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(201, 47, 47, 0.08), transparent 60%),
    linear-gradient(180deg, #efeae2 0%, var(--salvatore-offwhite) 40%, #f3efe8 100%);
  overflow-x: hidden;
}

.sg-header {
  background: var(--salvatore-black);
  color: var(--salvatore-white);
  padding: 0.7rem 1rem 0.85rem;
  text-align: center;
  border-bottom: 3px solid var(--salvatore-red);
}

.sg-header-inner {
  max-width: 720px;
  margin: 0 auto;
}

.sg-logo {
  display: block;
  width: clamp(140px, 34vw, 220px);
  height: auto;
  margin: 0 auto 0.25rem;
  object-fit: contain;
}

.sg-tagline {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.sg-wait {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--salvatore-yellow);
}

.sg-closed {
  margin: 1rem;
  padding: 0.85rem 1rem;
  background: #fff3f3;
  border: 1px solid var(--salvatore-red);
  border-radius: var(--sg-radius);
  color: var(--salvatore-red-dark);
  font-weight: 700;
  text-align: center;
}

.sg-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid rgba(32, 57, 26, 0.12);
  backdrop-filter: blur(8px);
}

.sg-nav::-webkit-scrollbar { height: 4px; }

.sg-nav-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(47, 78, 36, 0.25);
  background: var(--salvatore-white);
  color: var(--salvatore-green-dark);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--sg-dur) var(--sg-ease), color var(--sg-dur) var(--sg-ease), border-color var(--sg-dur) var(--sg-ease);
}

.sg-nav-btn:hover { border-color: var(--salvatore-red); }
.sg-nav-btn:focus-visible {
  outline: 3px solid rgba(201, 47, 47, 0.45);
  outline-offset: 2px;
}
.sg-nav-btn[aria-selected="true"] {
  background: var(--salvatore-red);
  border-color: var(--salvatore-red);
  color: var(--salvatore-white);
}

/* ——— Layout: carta protagonista ——— */
.sg-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  padding: 0.65rem 0.55rem calc(var(--sg-mbar-h) + 1.25rem);
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.sg-stage {
  position: relative;
  min-width: 0;
}

.sg-stack {
  position: relative;
  width: 100%;
  min-height: 40vh;
}

.sg-card {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  border-radius: calc(var(--sg-radius) + 4px);
  background: transparent;
  transform-origin: 50% 40%;
  transition:
    transform var(--sg-dur) var(--sg-ease),
    opacity var(--sg-dur) var(--sg-ease),
    filter var(--sg-dur) var(--sg-ease);
  will-change: transform, opacity;
  pointer-events: none;
}

.sg-card.is-active {
  position: relative;
  pointer-events: auto;
  z-index: 30 !important;
  opacity: 1;
  transform: none;
  filter: none;
}

.sg-card.is-under-1 {
  z-index: 20;
  opacity: 0.55;
  transform: translate3d(10px, 14px, 0) scale(0.985);
  filter: brightness(0.96);
}

.sg-card.is-under-2 {
  z-index: 10;
  opacity: 0.35;
  transform: translate3d(-12px, 22px, 0) scale(0.97);
  filter: brightness(0.93);
}

.sg-card.is-buried {
  z-index: 1;
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(0.96);
  pointer-events: none;
  visibility: hidden;
}

.sg-card-frame {
  width: 100%;
  max-width: none;
  background: var(--salvatore-white);
  border-radius: var(--sg-radius);
  box-shadow: var(--sg-shadow);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-card.is-flyer .sg-card-frame {
  width: min(100%, 520px);
  margin: 0 auto;
  background: var(--salvatore-charcoal);
  padding: 0.75rem;
}

.sg-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  cursor: zoom-in;
  background: #111;
}

.sg-card.is-flyer img {
  background: transparent;
}

.sg-pages-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.sg-page-btn {
  appearance: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: none;
  background: var(--salvatore-green);
  color: var(--salvatore-white);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
}
.sg-page-btn:hover { background: var(--salvatore-green-dark); }
.sg-page-btn:focus-visible {
  outline: 3px solid rgba(201, 47, 47, 0.45);
  outline-offset: 2px;
}
.sg-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.sg-page-indicator {
  font-weight: 800;
  color: var(--salvatore-green-dark);
  min-width: 3.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.sg-special {
  width: min(100%, 560px);
  margin: 0 auto;
  background: var(--salvatore-white);
  border-radius: var(--sg-radius);
  box-shadow: var(--sg-shadow-soft);
  border-top: 4px solid var(--salvatore-red);
  padding: 1.25rem 1.1rem 1.4rem;
}
.sg-special h2 {
  margin: 0 0 0.35rem;
  font-family: var(--sg-display);
  color: var(--salvatore-green-dark);
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  font-weight: 400;
}
.sg-special .sg-special-note {
  margin: 0 0 1rem;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 600;
}
.sg-special .sg-pending {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(217, 163, 33, 0.22);
  color: #5c4308;
  font-weight: 800;
  font-size: 0.8rem;
}

.sg-missing {
  margin: 2rem auto;
  max-width: 28rem;
  text-align: center;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px dashed rgba(47, 78, 36, 0.35);
  border-radius: var(--sg-radius);
  color: var(--salvatore-green-dark);
  font-weight: 700;
}

/* ——— Rail PC ——— */
.sg-rail {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.sg-rail-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: var(--salvatore-white);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--sg-radius);
  box-shadow: var(--sg-shadow-soft);
  padding: 0.75rem;
  cursor: pointer;
  font: inherit;
  transition: transform 180ms var(--sg-ease), box-shadow 180ms var(--sg-ease);
}
.sg-rail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}
.sg-rail-card:focus-visible {
  outline: 3px solid rgba(201, 47, 47, 0.45);
  outline-offset: 2px;
}
.sg-rail-card.is-disabled {
  cursor: default;
  opacity: 0.72;
}
.sg-rail-card.is-disabled:hover { transform: none; }

.sg-rail-transfer {
  flex-direction: column;
  align-items: stretch;
  padding: 0.85rem;
  cursor: default;
}
.sg-rail-transfer:hover { transform: none; }

.sg-rail-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--salvatore-green-dark);
  font-weight: 800;
}

.sg-transfer-hit {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}
.sg-transfer-hit:focus-visible {
  outline: 3px solid rgba(201, 47, 47, 0.45);
  outline-offset: 2px;
  border-radius: 10px;
}

.sg-transfer-frame {
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.sg-transfer-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  max-height: min(42vh, 420px);
}
.sg-rail-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(32, 57, 26, 0.7);
}

.sg-wa-badge {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--salvatore-wa);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}
.sg-rail-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.sg-rail-card-text strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--salvatore-charcoal);
  line-height: 1.25;
}
.sg-rail-card-text em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(22, 22, 22, 0.62);
  line-height: 1.3;
}

.sg-rail-offers {
  background: linear-gradient(145deg, #fff8e8 0%, #fff 55%, #ffe8e4 100%);
  border-color: rgba(201, 47, 47, 0.22);
}
.sg-gift {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
  background: rgba(201, 47, 47, 0.1);
}

/* ——— Mobile action bar (no overlays grandes sobre la carta) ——— */
.sg-mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding: 0.45rem 0.55rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
}
.sg-mbar-btn {
  appearance: none;
  border: 1px solid rgba(32, 57, 26, 0.14);
  background: var(--salvatore-white);
  border-radius: 12px;
  min-height: 2.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  text-decoration: none;
  color: var(--salvatore-green-dark);
  font: inherit;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0.3rem 0.2rem;
}
.sg-mbar-btn .sg-mbar-ico {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--salvatore-green-dark);
}
.sg-mbar-btn .sg-mbar-ico-wa { color: #128C7E; }
.sg-mbar-btn em { font-style: normal; }
.sg-mbar-btn:focus-visible {
  outline: 3px solid rgba(201, 47, 47, 0.45);
  outline-offset: 2px;
}
.sg-mbar-btn.is-disabled,
.sg-mbar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sg-mbar-wa { border-color: rgba(37, 211, 102, 0.35); }
.sg-mbar-offers {
  border-color: rgba(201, 47, 47, 0.28);
  background: #fff8f0;
}

/* Sheets / modals / zoom */
.sg-sheet[hidden],
.sg-modal[hidden],
.sg-zoom[hidden],
.sg-pages-controls[hidden],
.sg-special[hidden],
.sg-missing[hidden] {
  display: none !important;
}

.sg-sheet,
.sg-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}
.sg-sheet-backdrop,
.sg-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.sg-sheet-panel,
.sg-modal-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(90dvh, 920px);
  background: var(--salvatore-offwhite);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.28);
}
.sg-modal-panel {
  max-width: 480px;
  margin: 0 auto;
}
.sg-sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--salvatore-white);
  border-radius: 18px 18px 0 0;
}
.sg-sheet-bar h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--salvatore-green-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
}
.sg-sheet-close {
  appearance: none;
  border: none;
  background: var(--salvatore-charcoal);
  color: #fff;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
}
.sg-sheet-body {
  overflow: auto;
  padding: 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.sg-sheet-body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #111;
}

.sg-offers-form {
  overflow: auto;
  padding: 1rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.sg-offers-lead {
  margin: 0;
  font-family: var(--sg-display);
  font-size: 1.25rem;
  color: var(--salvatore-red-dark);
  font-weight: 400;
  line-height: 1.25;
}
.sg-offers-privacy {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #3a3a3a;
  font-weight: 600;
}
.sg-offers-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--salvatore-green-dark);
}
.sg-offers-form input[type="text"] {
  min-height: 46px;
  border: 1px solid #d5cfc4;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-weight: 600;
  background: #fff;
  color: #111;
}
.sg-offers-consent {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.55rem !important;
  font-weight: 650 !important;
  color: #222 !important;
}
.sg-offers-consent input {
  margin-top: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}
.sg-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.sg-offers-msg {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
}
.sg-offers-msg.is-ok {
  background: #e8f8ee;
  color: #14532d;
  border: 1px solid #86efac;
}
.sg-offers-msg.is-err {
  background: #fff1f1;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}
.sg-offers-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.sg-offers-submit,
.sg-offers-cancel {
  appearance: none;
  border: none;
  border-radius: 12px;
  min-height: 46px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.sg-offers-submit {
  background: var(--salvatore-red);
  color: #fff;
}
.sg-offers-submit:hover { background: var(--salvatore-red-dark); }
.sg-offers-submit:disabled { opacity: 0.55; cursor: wait; }
.sg-offers-cancel {
  background: transparent;
  color: var(--salvatore-green-dark);
  border: 1px solid rgba(32, 57, 26, 0.25);
}

.sg-zoom {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 0.5rem 1rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.sg-zoom-img {
  width: min(100%, 960px);
  height: auto;
  object-fit: contain;
}
.sg-zoom-close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  appearance: none;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--salvatore-red);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 71;
}

.sg-footer {
  text-align: center;
  padding: 0.5rem 1rem calc(var(--sg-mbar-h) + 1rem);
  color: rgba(22, 22, 22, 0.55);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Desktop: rail 20–25 %, carta ~75–80 % */
@media (min-width: 900px) {
  .sg-layout {
    grid-template-columns: minmax(0, 3.2fr) minmax(220px, 0.9fr);
    align-items: start;
    padding: 0.9rem 1.1rem 2rem;
    gap: 1.1rem;
  }

  .sg-rail {
    display: flex;
    position: sticky;
    top: calc(var(--sg-nav-h) + 0.65rem);
    max-height: calc(100dvh - var(--sg-nav-h) - 1.5rem);
    overflow: auto;
  }

  .sg-mobile-bar { display: none; }

  .sg-footer { padding-bottom: 1.5rem; }

  .sg-logo { width: clamp(160px, 18vw, 220px); }

  .sg-modal-panel {
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    border-radius: 16px;
    width: min(92vw, 480px);
    max-height: min(88dvh, 720px);
  }
  .sg-modal-panel .sg-sheet-bar { border-radius: 16px 16px 0 0; }
}

@media (min-width: 1200px) {
  .sg-layout {
    grid-template-columns: minmax(0, 3.6fr) minmax(240px, 0.95fr);
    gap: 1.35rem;
    padding-left: 1.35rem;
    padding-right: 1.35rem;
  }
}

@media (min-width: 1600px) {
  .sg-layout {
    grid-template-columns: minmax(0, 3.8fr) minmax(260px, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --sg-dur: 1ms; }
  .sg-card,
  .sg-nav-btn,
  .sg-page-btn,
  .sg-rail-card {
    transition: none !important;
  }
  .sg-card.is-under-1,
  .sg-card.is-under-2 {
    transform: none;
  }
}
