/* Seraina Fest: Basis + Wunschbuechli + RSVP. Alle Farben/Radii/Abstaende via Bricks-Variablen (--sg-*). */

body {
  background: var(--sg-bg, #FDFCFA);
  color: var(--sg-ink, #2B2228);
  font-family: var(--sg-font-body, 'Figtree', sans-serif);
  line-height: 1.6;
}
h1, h2, h3, h4, h5 {
  font-family: var(--sg-font-heading, 'Bricolage Grotesque', sans-serif);
  font-weight: 800;
  line-height: 1.08;
  color: var(--sg-ink, #2B2228);
}

/* Seitenabstand, sobald der Container die Bildschirmkante beruehrt.
   Bricks-Container haben max-width 1100 und links/rechts kein Padding. */
@media (max-width: 1140px) {
  .brxe-container { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 478px) {
  .brxe-container { padding-left: 16px; padding-right: 16px; }
}

/* Abstaende auf kleinen Screens straffen (Bricks-Breakpoints).
   :root:root schlaegt die spaeter geladene Bricks-Variablen-Datei. */
@media (max-width: 991px) {
  :root:root { --sg-space-xl: 64px; --sg-space-lg: 36px; }
}
@media (max-width: 767px) {
  :root:root { --sg-space-xl: 48px; --sg-space-lg: 28px; --sg-space-md: 20px; }
}

/* Countdown: Zahl gross, Label klein darunter */
.brxe-countdown { display: flex; flex-wrap: wrap; gap: var(--sg-space-md, 24px); }
.brxe-countdown .field { display: flex; flex-direction: column; line-height: 1.05; }
.brxe-countdown .field .suffix { margin-top: 4px; }

/* ---------- Wunschbuechli ---------- */
.sg-wb { display: flex; flex-direction: column; gap: var(--sg-space-lg, 48px); }
.sg-wb__filters { display: flex; flex-wrap: wrap; gap: var(--sg-space-xs, 8px); }
@media (max-width: 640px) { .sg-wb__filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; } }
.sg-chip {
  border: 0; cursor: pointer; white-space: nowrap;
  padding: 10px 18px; border-radius: var(--sg-radius-pill, 999px);
  background: var(--sg-accent-soft, #FBE9ED); color: var(--sg-ink, #2B2228);
  font-family: inherit; font-size: 15px; font-weight: 600;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.sg-chip:hover { transform: translateY(-1px); }
.sg-chip.is-active { background: var(--sg-accent, #E8546B); color: #fff; }

.sg-wb__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sg-space-md, 24px); }

.sg-card {
  background: var(--sg-surface, #FFFFFF);
  border: 1px solid rgba(43, 34, 40, 0.08);
  border-radius: var(--sg-radius-md, 16px);
  overflow: hidden; display: flex; flex-direction: column;
}
.sg-card.is-hidden { display: none; }
.sg-card__media { aspect-ratio: 4 / 3; background: var(--sg-accent-soft, #FBE9ED); position: relative; }
.sg-card__media img, .sg-card__media svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-card__body { padding: var(--sg-space-md, 24px); display: flex; flex-direction: column; gap: 12px; flex: 1; }
.sg-card__title { margin: 0; font-size: 22px; }
.sg-card__desc { margin: 0; color: var(--sg-ink-soft, #6E5F68); font-size: 15px; }
.sg-card__price { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; }
.sg-card__price strong { font-family: var(--sg-font-heading, 'Bricolage Grotesque', sans-serif); font-size: 20px; }
.sg-card__open { font-size: 14px; color: var(--sg-ink-soft, #6E5F68); }

.sg-progress { height: 10px; background: var(--sg-accent-soft, #FBE9ED); border-radius: var(--sg-radius-pill, 999px); overflow: hidden; }
.sg-progress__fill { height: 100%; width: 0; background: var(--sg-accent, #E8546B); border-radius: inherit; transition: width .4s ease; }

.sg-card__actions { display: flex; flex-wrap: wrap; gap: var(--sg-space-xs, 8px); }
.sg-btn {
  border: 0; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 15px;
  padding: 12px 22px; border-radius: var(--sg-radius-pill, 999px);
  background: var(--sg-accent, #E8546B); color: #fff;
  transition: transform .1s ease, opacity .15s ease;
}
.sg-btn:hover { opacity: .92; }
.sg-btn:active { transform: scale(.97); }
.sg-btn[disabled] { opacity: .5; cursor: not-allowed; }
.sg-btn--outline { background: transparent; color: var(--sg-accent, #E8546B); box-shadow: inset 0 0 0 2px var(--sg-accent, #E8546B); }
.sg-badge-done {
  display: inline-block; padding: 8px 16px; border-radius: var(--sg-radius-pill, 999px);
  background: var(--sg-accent-soft, #FBE9ED); color: var(--sg-accent, #E8546B); font-weight: 700; font-size: 14px;
}

/* ---------- Modal ---------- */
.sg-modal {
  border: 0; border-radius: var(--sg-radius-lg, 24px); padding: 0;
  max-width: 440px; width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px); overflow-y: auto;
}
.sg-modal::backdrop { background: rgba(43, 34, 40, 0.5); }
.sg-modal__inner { position: relative; padding: var(--sg-space-lg, 48px) var(--sg-space-md, 24px); display: flex; flex-direction: column; gap: var(--sg-space-sm, 16px); }
.sg-modal__title { margin: 0; padding-right: 44px; font-size: 24px; }
.sg-modal__hint { margin: 0; font-size: 14px; color: var(--sg-ink-soft, #6E5F68); }
.sg-modal__close {
  position: absolute; top: 14px; right: 14px;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 0;
  background: var(--sg-accent-soft, #FBE9ED); color: var(--sg-ink, #2B2228);
  border-radius: var(--sg-radius-pill, 999px); cursor: pointer;
  font-family: inherit; font-size: 15px; line-height: 1;
}
.sg-modal__close:hover { background: var(--sg-accent, #E8546B); color: #fff; }
.sg-success { text-align: center; padding: var(--sg-space-sm, 16px) 0; }
.sg-success h4 { margin: 0 0 8px; font-size: 22px; }

/* ---------- Erfuellte Wuensche deutlich abheben ---------- */

/* Badge nur bei erfuellten Karten zeigen */
.sg-erfuellt { display: none; }
[data-sg-available="0"] .sg-erfuellt {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  padding: 10px 18px;
  border-radius: var(--sg-radius-pill, 999px);
  background: var(--sg-accent, #E8546B); color: #fff;
  font-weight: 700; font-size: 15px;
}
[data-sg-available="0"] .sg-erfuellt::before { content: "\2713"; font-size: 14px; }

/* Schenken-Button verschwindet, sobald der Wunsch erfuellt ist */
[data-sg-available="0"] .sg-wb-btn { display: none; }

/* Die Karte selbst: ruhiger Ton, Akzentrahmen, gedaempftes Bild */
[data-sg-available="0"] {
  background: var(--sg-accent-soft, #FBE9ED) !important;
  border-color: var(--sg-accent, #E8546B) !important;
}
[data-sg-available="0"] img {
  opacity: .6;
  filter: saturate(.7);
}
[data-sg-available="0"] .sg-wb-preis {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  color: var(--sg-ink-soft, #6E5F68);
}
/* Der Badge sagt es schon, die kleine Statuszeile waere doppelt */
[data-sg-available="0"] .sg-wb-status { display: none; }
/* Voller Balken braucht es nicht mehr */
[data-sg-available="0"] .sg-wb-bar { display: none; }

/* Bricks zeigt den Prozenttext trotz deaktivierter Einstellung, hier gezielt weg */
.brxe-progress-bar.sg-wb-bar label,
.brxe-progress-bar.sg-wb-bar .percentage { display: none !important; }
.brxe-progress-bar.sg-wb-bar .bar-wrapper { margin: 0; }

/* «Ganzes Geschenk uebernehmen»: sitzt zwischen Hinweis und Formular */
.sg-alles { width: 100%; text-align: center; }
.sg-alles.is-done { background: var(--sg-accent, #E8546B); color: #fff; box-shadow: none; }

/* Popup fuer bereits erfuellte Wuensche: Formular weg, Hinweis her */
.sg-voll { display: none; }
[data-sg-available="0"] .sg-voll {
  display: block;
  padding: 16px 18px;
  border-radius: var(--sg-radius-md, 16px);
  background: var(--sg-accent-soft, #FBE9ED);
  color: var(--sg-ink, #2B2228);
  font-size: 15px; line-height: 1.55;
}
.sg-pop[data-sg-available="0"] .sg-pop-form,
.sg-pop[data-sg-available="0"] .sg-alles,
.sg-pop[data-sg-available="0"] .sg-pop-hint { display: none; }

/* ---------- Bricks-Popup: zentrieren und Hoehe begrenzen ---------- */
.brx-popup .sg-pop {
  margin-left: auto; margin-right: auto;
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
}

/* ---------- Zahlungsangaben nach dem Schenken ---------- */
.sg-pay {
  margin-top: var(--sg-space-md, 24px);
  padding-top: var(--sg-space-md, 24px);
  border-top: 1px solid rgba(43, 34, 40, 0.12);
  text-align: left;
}
.sg-pay__lead { margin: 0 0 var(--sg-space-sm, 16px); font-size: 15px; }
.sg-pay__label {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sg-ink-soft, #6E5F68); margin-bottom: 2px;
}

/* TWINT-Zeile: dunkler Grund, weil die Wortmarke weiss ist */
.sg-pay__row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--sg-radius-md, 16px);
  background: #2B2228;
}
.sg-pay__brand { display: flex; align-items: center; flex-shrink: 0; }
.sg-pay__brand img { display: block; width: 70px; height: auto; }
.sg-pay__tel {
  font-family: var(--sg-font-heading, 'Bricolage Grotesque', sans-serif);
  font-weight: 800; font-size: 19px; color: #fff; margin-right: auto;
}

/* Ab 420px Popup-Breite QR und Konto nebeneinander, das halbiert die Hoehe */
@media (min-width: 480px) {
  .sg-pay__split { display: flex; gap: var(--sg-space-md, 24px); align-items: flex-start; }
  .sg-pay__split .sg-pay__qr { flex: 0 0 150px; margin: 0; }
  .sg-pay__split .sg-pay__bank { flex: 1; min-width: 0; }
  .sg-pay__split .sg-pay__qr img { width: 150px; }
}

.sg-pay__qr { margin: var(--sg-space-sm, 16px) 0; text-align: center; }
.sg-pay__qr img {
  display: block; width: 190px; max-width: 100%; height: auto; margin: 0 auto;
  border-radius: var(--sg-radius-sm, 10px);
  background: #fff; padding: 8px;
  border: 1px solid rgba(43, 34, 40, 0.12);
}
.sg-pay__qr figcaption {
  margin-top: 6px; font-size: 13px; color: var(--sg-ink-soft, #6E5F68);
}

.sg-pay__bank { font-size: 14px; line-height: 1.5; }
.sg-pay__bank p { margin: 0 0 8px; }
.sg-pay__iban {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--sg-font-heading, 'Bricolage Grotesque', sans-serif);
  font-weight: 700; font-size: 15px;
}

.sg-copy {
  border: 0; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; padding: 6px 12px;
  border-radius: var(--sg-radius-pill, 999px);
  background: var(--sg-accent-soft, #FBE9ED); color: var(--sg-accent, #E8546B);
  flex-shrink: 0;
}
.sg-copy:hover { background: var(--sg-accent, #E8546B); color: #fff; }
.sg-copy.is-done { background: var(--sg-accent, #E8546B); color: #fff; }
.sg-pay__row .sg-copy { background: rgba(255, 255, 255, 0.16); color: #fff; }
.sg-pay__row .sg-copy:hover { background: #fff; color: #2B2228; }

/* Auf schmalen Screens muss die TWINT-Zeile einzeilig bleiben */
@media (max-width: 430px) {
  .sg-pay__row { gap: 10px; padding: 12px; }
  .sg-pay__brand img { width: 58px; }
  .sg-pay__tel { font-size: 17px; white-space: nowrap; }
  .sg-copy { padding: 6px 10px; }
}

.sg-bring {
  margin-top: var(--sg-space-md, 24px);
  padding-top: var(--sg-space-md, 24px);
  border-top: 1px solid rgba(43, 34, 40, 0.12);
  font-size: 15px;
}
.sg-bring p { margin: 0; }

/* ---------- Formulare ---------- */
.sg-field { display: flex; flex-direction: column; gap: 6px; }
.sg-field label { font-size: 14px; font-weight: 600; }
.sg-field input, .sg-field textarea, .sg-field select {
  font-family: inherit; font-size: 16px; color: var(--sg-ink, #2B2228);
  padding: 12px 14px; border: 1px solid rgba(43, 34, 40, 0.15);
  border-radius: var(--sg-radius-sm, 10px); background: var(--sg-surface, #FFFFFF);
}
.sg-field input:focus, .sg-field textarea:focus, .sg-field select:focus {
  outline: 2px solid var(--sg-accent, #E8546B); outline-offset: 1px; border-color: transparent;
}
.sg-form-error { color: var(--sg-accent, #E8546B); font-size: 14px; font-weight: 600; min-height: 1em; margin: 0; }
.sg-radio-row { display: flex; gap: var(--sg-space-sm, 16px); }
.sg-radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.sg-rsvp { max-width: 480px; display: flex; flex-direction: column; gap: var(--sg-space-sm, 16px); }
.sg-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .sg-chip, .sg-btn, .sg-progress__fill { transition: none; }
  .sg-chip:hover, .sg-btn:active { transform: none; }
}
