/**
 * GSH Shop - Warenkorb & Checkout
 *
 * Gemeinsames Stylesheet fuer die Wunschlisten-Seite (cart) und den
 * Anfrage-Checkout. Ersetzt die frueheren <style>-Bloecke in den Templates.
 */

.gsh-shop {
  --gsh-accent: var(--color-content-primary, #2ecc71);
  --gsh-accent-dark: #1f9d55;
  --gsh-ink: #12212e;
  --gsh-ink-soft: #66788a;
  --gsh-line: #e6ebf0;
  --gsh-surface: #fff;
  --gsh-surface-soft: #f5f7fa;
  --gsh-danger: #d0392b;
  --gsh-radius: 16px;
  --gsh-radius-sm: 10px;
  --gsh-shadow: 0 1px 2px rgba(18, 33, 46, .04), 0 8px 28px rgba(18, 33, 46, .06);
  --gsh-gap: 28px;

  color: var(--gsh-ink);
  font-variant-numeric: tabular-nums;
}

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

/* ---------------------------------------------------------------- Kopfzeile */

.gsh-shop__head {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 0;
}

.gsh-shop__title {
  margin: 0;
  font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--gsh-ink);
}

.gsh-shop__subtitle {
  margin: 8px 0 0;
  max-width: 62ch;
  color: var(--gsh-ink-soft);
  font-size: .98rem;
  line-height: 1.6;
}

/* Fortschrittsanzeige */

.gsh-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.gsh-steps__item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--gsh-ink-soft);
}

.gsh-steps__item::after {
  content: "";
  width: 26px;
  height: 1px;
  margin-left: 4px;
  background: var(--gsh-line);
}

.gsh-steps__item:last-child::after {
  display: none;
}

.gsh-steps__num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--gsh-line);
  border-radius: 50%;
  background: var(--gsh-surface);
  font-size: .8rem;
  line-height: 1;
}

.gsh-steps__item--done .gsh-steps__num,
.gsh-steps__item--active .gsh-steps__num {
  border-color: var(--gsh-accent);
  background: var(--gsh-accent);
  color: #fff;
}

.gsh-steps__item--active,
.gsh-steps__item--done {
  color: var(--gsh-ink);
}

/* ------------------------------------------------------------------ Layout */

.gsh-shop__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: var(--gsh-gap);
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.gsh-shop__main {
  min-width: 0;
}

.gsh-shop__aside {
  position: sticky;
  top: 100px;
}

/* ------------------------------------------------------------------- Karte */

.gsh-card {
  background: var(--gsh-surface);
  border: 1px solid var(--gsh-line);
  border-radius: var(--gsh-radius);
  box-shadow: var(--gsh-shadow);
}

.gsh-card__body {
  padding: 26px 26px 28px;
}

.gsh-card__title {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--gsh-ink);
}

.gsh-card__hint {
  margin: 0 0 20px;
  color: var(--gsh-ink-soft);
  font-size: .9rem;
  line-height: 1.6;
}

/* --------------------------------------------------------- Warenkorb-Zeile */

.gsh-line-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gsh-line-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  padding: 18px;
  background: var(--gsh-surface);
  border: 1px solid var(--gsh-line);
  border-radius: var(--gsh-radius);
  box-shadow: var(--gsh-shadow);
  transition: border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.gsh-line-item:hover {
  border-color: #d3dce4;
  box-shadow: 0 2px 4px rgba(18, 33, 46, .05), 0 14px 34px rgba(18, 33, 46, .09);
}

.gsh-line-item.is-busy {
  opacity: .55;
  pointer-events: none;
}

.gsh-line-item.is-removing {
  opacity: 0;
}

.gsh-line-item__media {
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: var(--gsh-radius-sm);
  background: var(--gsh-surface-soft);
}

.gsh-line-item__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.gsh-line-item__media:hover img {
  transform: scale(1.04);
}

.gsh-line-item__name {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.gsh-line-item__name a {
  color: inherit;
  text-decoration: none;
}

.gsh-line-item__name a:hover {
  color: var(--gsh-accent-dark);
}

.gsh-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.gsh-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gsh-surface-soft);
  color: var(--gsh-ink-soft);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.gsh-line-item__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 22px;
}

.gsh-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--gsh-ink-soft);
  font-size: .76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.gsh-figure__value {
  font-size: 1rem;
  font-weight: 700;
}

.gsh-figure__value--accent {
  color: var(--gsh-accent-dark);
}

/* Mengensteuerung */

.gsh-qty {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--gsh-line);
  border-radius: var(--gsh-radius-sm);
  background: var(--gsh-surface);
}

.gsh-qty__btn {
  display: grid;
  place-items: center;
  width: 40px;
  padding: 0;
  border: 0;
  background: var(--gsh-surface-soft);
  color: var(--gsh-ink);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.gsh-qty__btn:hover:not(:disabled) {
  background: var(--gsh-accent);
  color: #fff;
}

.gsh-qty__btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.gsh-qty__btn:focus-visible {
  outline: 2px solid var(--gsh-accent);
  outline-offset: -2px;
}

.gsh-qty__value {
  min-width: 54px;
  padding: 9px 4px;
  border: 0;
  background: transparent;
  color: var(--gsh-ink);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.gsh-qty__value::-webkit-outer-spin-button,
.gsh-qty__value::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.gsh-qty__value:focus-visible {
  outline: 2px solid var(--gsh-accent);
  outline-offset: -2px;
}

/* Entfernen */

.gsh-line-item__remove {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--gsh-line);
  border-radius: 50%;
  background: var(--gsh-surface);
  color: var(--gsh-ink-soft);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.gsh-line-item__remove:hover {
  border-color: var(--gsh-danger);
  background: var(--gsh-danger);
  color: #fff;
}

/* -------------------------------------------------------- Zusammenfassung */

.gsh-summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--gsh-line);
  font-size: .95rem;
}

.gsh-summary__row:last-of-type {
  border-bottom: 0;
}

.gsh-summary__row--total {
  margin-top: 4px;
  padding-top: 15px;
  border-top: 1px solid var(--gsh-line);
  border-bottom: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.gsh-summary__label {
  color: var(--gsh-ink-soft);
}

.gsh-summary__row--total .gsh-summary__label {
  color: var(--gsh-ink);
}

.gsh-summary__value {
  font-weight: 700;
}

.gsh-summary__row--total .gsh-summary__value {
  color: var(--gsh-accent-dark);
  font-size: 1.15rem;
}

/* ------------------------------------------------------ Checkout-Positionen */

.gsh-mini-items {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
}

.gsh-mini-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gsh-line);
}

.gsh-mini-item:last-child {
  border-bottom: 0;
}

.gsh-mini-item__media {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--gsh-surface-soft);
}

.gsh-mini-item__media img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.gsh-mini-item__badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gsh-ink);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.gsh-mini-item__name {
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.35;
}

.gsh-mini-item__meta {
  margin-top: 3px;
  color: var(--gsh-ink-soft);
  font-size: .82rem;
}

/* ------------------------------------------------------------- Formularfeld */

.gsh-fieldset {
  margin: 0 0 26px;
  padding: 0;
  border: 0;
}

.gsh-fieldset:last-of-type {
  margin-bottom: 0;
}

.gsh-fieldset__legend {
  display: block;
  width: 100%;
  margin-bottom: 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--gsh-line);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.gsh-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gsh-grid__cell--full {
  grid-column: 1 / -1;
}

.gsh-input {
  display: block;
}

.gsh-input__label {
  display: block;
  margin-bottom: 6px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--gsh-ink);
}

.gsh-input__label .gsh-req {
  color: var(--gsh-danger);
}

.gsh-input__control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gsh-line);
  border-radius: var(--gsh-radius-sm);
  background: var(--gsh-surface-soft);
  color: var(--gsh-ink);
  font: inherit;
  font-size: .97rem;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.gsh-input__control::placeholder {
  color: #9fb0be;
}

.gsh-input__control:focus {
  outline: 0;
  border-color: var(--gsh-accent);
  background: var(--gsh-surface);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, .16);
}

.gsh-input__control.is-invalid {
  border-color: var(--gsh-danger);
  background: #fff6f5;
}

.gsh-input__error {
  display: none;
  margin-top: 5px;
  color: var(--gsh-danger);
  font-size: .8rem;
  font-weight: 600;
}

.gsh-input__control.is-invalid ~ .gsh-input__error {
  display: block;
}

/* ------------------------------------------------------------- Zustimmungen */

.gsh-consents {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.gsh-consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--gsh-line);
  border-radius: var(--gsh-radius-sm);
  background: var(--gsh-surface-soft);
  color: var(--gsh-ink);
  font-size: .88rem;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.gsh-consent:hover {
  border-color: #cfdae3;
}

.gsh-consent.is-checked {
  border-color: var(--gsh-accent);
  background: rgba(46, 204, 113, .07);
}

.gsh-consent.is-invalid {
  border-color: var(--gsh-danger);
  background: #fff6f5;
}

.gsh-consent__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.gsh-consent__box {
  position: relative;
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border: 1.5px solid #c3ced8;
  border-radius: 6px;
  background: var(--gsh-surface);
  transition: background .15s ease, border-color .15s ease;
}

.gsh-consent__box::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 7px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg) scale(.7);
  transition: opacity .12s ease, transform .12s ease;
}

.gsh-consent__input:checked + .gsh-consent__box {
  border-color: var(--gsh-accent);
  background: var(--gsh-accent);
}

.gsh-consent__input:checked + .gsh-consent__box::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.gsh-consent__input:focus-visible + .gsh-consent__box {
  outline: 2px solid var(--gsh-accent);
  outline-offset: 2px;
}

.gsh-consent__text a {
  color: var(--gsh-accent-dark);
  text-decoration: underline;
}

/* ---------------------------------------------------------------- Buttons */

.gsh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 22px;
  border: 1px solid transparent;
  border-radius: var(--gsh-radius-sm);
  background: var(--gsh-accent);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .12s ease;
}

.gsh-btn:hover:not(:disabled) {
  background: var(--gsh-accent-dark);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(31, 157, 85, .22);
}

.gsh-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.gsh-btn:focus-visible {
  outline: 2px solid var(--gsh-ink);
  outline-offset: 2px;
}

.gsh-btn:disabled,
.gsh-btn[aria-disabled="true"] {
  background: #c3ced8;
  box-shadow: none;
  cursor: not-allowed;
}

.gsh-btn--ghost {
  background: transparent;
  border-color: var(--gsh-line);
  color: var(--gsh-ink);
}

.gsh-btn--ghost:hover:not(:disabled) {
  background: var(--gsh-surface-soft);
  border-color: #cfdae3;
  color: var(--gsh-ink);
  box-shadow: none;
}

.gsh-btn.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.gsh-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gsh-shop-spin .7s linear infinite;
}

@keyframes gsh-shop-spin {
  to { transform: rotate(360deg); }
}

.gsh-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gsh-actions--spaced {
  margin-top: 18px;
}

.gsh-card__hint--flush {
  margin-bottom: 0;
}

.gsh-note {
  margin: 12px 0 0;
  color: var(--gsh-ink-soft);
  font-size: .82rem;
  line-height: 1.5;
  text-align: center;
}

/* --------------------------------------------------------------- Hinweise */

.gsh-alert {
  display: none;
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid #f3c6c1;
  border-left-width: 4px;
  border-radius: var(--gsh-radius-sm);
  background: #fff6f5;
  color: #93261b;
  font-size: .9rem;
  line-height: 1.5;
}

.gsh-alert.is-visible {
  display: block;
}

.gsh-trust {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid var(--gsh-line);
  border-radius: var(--gsh-radius-sm);
  background: var(--gsh-surface-soft);
}

.gsh-trust svg,
.gsh-trust i {
  flex-shrink: 0;
  width: 20px;
  height: auto;
  color: var(--gsh-accent-dark);
  font-size: 1.15rem;
}

.gsh-trust__title {
  display: block;
  font-size: .88rem;
  font-weight: 700;
}

.gsh-trust__text {
  display: block;
  color: var(--gsh-ink-soft);
  font-size: .78rem;
  line-height: 1.4;
}

.gsh-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------- Leerer Korb */

.gsh-empty {
  max-width: 620px;
  margin: 0 auto;
  padding: 56px 20px 72px;
  text-align: center;
}

.gsh-empty__title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 700;
}

.gsh-empty__text {
  margin: 0 auto 26px;
  max-width: 46ch;
  color: var(--gsh-ink-soft);
  line-height: 1.6;
}

.gsh-empty .gsh-btn {
  width: auto;
}

/* ------------------------------------------------------------- Responsive */

@media (max-width: 1024px) {
  .gsh-shop__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .gsh-shop__aside {
    position: static;
    order: 2;
  }

  .gsh-shop__main {
    order: 1;
  }

  .gsh-mini-items {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .gsh-shop__head {
    padding-top: 22px;
  }

  .gsh-shop__layout {
    gap: 18px;
    padding: 18px 14px 40px;
  }

  .gsh-card__body {
    padding: 20px 18px 22px;
  }

  .gsh-line-item {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .gsh-line-item__media {
    width: 72px;
    height: 72px;
  }

  .gsh-line-item__remove {
    grid-column: 2;
    justify-self: end;
    margin-top: -8px;
  }

  .gsh-line-item__controls {
    gap: 16px;
  }

  .gsh-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gsh-steps__item::after {
    width: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gsh-shop *,
  .gsh-shop *::before,
  .gsh-shop *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
