/* Seitenrahmen: Hintergrundmuster, weiße Papierspalte, Fußbereich */
.page {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  container-type: inline-size; /* Bezugsbreite (cqw) für die volle Breite der Kopfleiste */
  background: url("../images/background.svg");
}

/* Hat die Seite keinen Scrollbalken, hält sie seinen Platz frei (siehe js/services/scrollbar.js), damit der Inhalt nicht springt:
   Das Hintergrundmuster läuft im frei gehaltenen Streifen weiter, der Fuß reicht mit seinem dunklen Hintergrund bis an den Rand. */
html.scrollbar-fill .page {
  padding-right: var(--scrollbar-width);
  background-origin: content-box;
}
html.scrollbar-fill .site-footer {
  margin-right: calc(-1 * var(--scrollbar-width));
  padding-right: calc(var(--gutter) + var(--scrollbar-width));
}

.paper {
  position: relative;
  width: 100%;
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  background: var(--color-paper);
  box-shadow: var(--shadow-raised);
}

/* Kopfbereich */
/* Der Kopf löst sich auf, damit die Leiste mit Logo und Warenkorb in der ganzen Papierspalte haften bleibt. */
.site-header { display: contents; }

.site-header__bar {
  --sticky-top: 24px;
  position: sticky;
  top: var(--sticky-top);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--block-gap);
  margin-top: calc(2vh + var(--block-gap) + var(--space-1));
}

/* Halbtransparente, verwaschende Fläche hinter der Leiste (mit Luft unter dem Logo): Darunter durchlaufender Inhalt wird unscharf.
   Der Teil in Breite der Papierspalte (::before) liegt dauerhaft da (dort unsichtbar auf dem weißen Grund), damit sich Inhalt nie ungehindert
   mit Logo und Warenkorb überlagert. Haftet die Leiste (js/services/sticky-header.js), blendet ::after ein: dieselbe Fläche über die ganze
   Seitenbreite samt Schatten an der Unterkante. Der Zuschnitt spart die Papierbreite aus, damit sich beide Teile nicht überlagern
   (1 px Überlappung innen gegen eine Naht); seitliche Schatten gibt es bewusst nicht. Es wird nichts in der Größe animiert. */
.site-header__bar {
  --paper-width: min(100cqw, calc(var(--content-width) + 2 * var(--gutter)));
  --hole-left: calc(50cqw - var(--paper-width) / 2 + 1px);
  --hole-right: calc(50cqw + var(--paper-width) / 2 - 1px);
}

.site-header__bar::before,
.site-header__bar::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -100vh; /* reicht in jedem Fall bis zur Oberkante der Seite, auch solange die Leiste noch nicht haftet */
  bottom: -20px;
  pointer-events: none;
  background: rgb(255 255 255 / 72%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-header__bar::before {
  left: calc(-1 * var(--gutter));
  width: calc(100% + 2 * var(--gutter));
}

.site-header__bar::after {
  left: calc(50% - 50cqw);
  width: 100cqw;
  box-shadow: var(--shadow-raised);
  clip-path: polygon(evenodd,
    0 -10px, 100% -10px, 100% calc(100% + 40px), 0 calc(100% + 40px), 0 -10px,
    var(--hole-left) -10px, var(--hole-left) 100%, var(--hole-right) 100%, var(--hole-right) -10px, var(--hole-left) -10px);
  opacity: 0;
  transition: opacity 0.4s ease-out; /* Ausblenden: erst schnell, dann langsam */
}

/* Der freigehaltene Platz des Scrollbalkens gehört mit zur Fläche. */
html.scrollbar-fill .site-header__bar::after { width: calc(100cqw + var(--scrollbar-width)); }

.site-header__bar.is-stuck::after {
  opacity: 1;
  transition: opacity 0.4s ease-in; /* Einblenden: erst langsam, dann schnell */
}

@media (prefers-reduced-motion: reduce) {
  .site-header__bar::after,
  .site-header__bar.is-stuck::after { transition: none; }
}

.site-header__logo { display: block; line-height: 0; }
.site-header__logo img { width: 306px; }

.cart-link {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  padding: 10px;
  color: var(--color-text);
}

.cart-link svg { display: block; width: 30px; height: 30px; fill: currentColor; }

/* Links verankert, damit mehrstellige Zahlen nach rechts wachsen, weg vom Symbol */
.cart-link__count {
  font-family: var(--font-sans);
  font-feature-settings: "tnum";
  position: absolute;
  top: -1px;
  left: 37px;
  min-width: 1.6em;
  padding: 0.4em 0.7em 0.35em;
  border-radius: 1em;
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.site-nav { margin-block: var(--block-gap) var(--space-1); font-size: 1.125rem; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 58px;
  margin: 0;
  padding: 0 41px 0 0;
  line-height: 1.6;
  list-style: none;
}

.site-nav a,
.site-footer__links a {
  display: block;
  padding: 0.5em;
  font-family: var(--font-sans);
  font-weight: 350;
  word-spacing: 0.125rem;
  color: var(--color-text);
}

.site-nav a::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 14.56px;
  margin-right: 10px;
  background: transparent;
  mask: url("../images/icons/arrow.svg") center / contain no-repeat;
}

.site-nav a:hover { color: #000; font-weight: 400; word-spacing: 0.11rem; }
.site-nav a:hover::before { background: var(--color-brand); }
.site-nav a[aria-current="page"] { font-weight: 400; word-spacing: 0.11rem; }
.site-nav a[aria-current="page"]::before { background: var(--color-ink); }

/* Seitentitel und Inhaltsbereich */
.page-title {
  position: relative;
  padding: 46px 0 16px;
  font-size: 1.75rem;
}

/* Linie liegt außerhalb des Layouts, der Abstand zum Text bleibt unverändert; sie sitzt etwas über der Mitte dieses Abstands */
.page-title::after {
  content: "";
  position: absolute;
  inset: auto 0 6px;
  border-bottom: 1px solid var(--color-heading-line);
}

.view {
  min-height: 800px;
  padding-block: 30px 70px;
  overflow-wrap: anywhere;
}

.view > :first-child { margin-top: 0; }
.view > :last-child { margin-bottom: 0; }
.view:focus { outline: 0; }
.view--flush { padding-top: 0; }
.view--product { padding-block: 60px 98px; }

/* Fuß */
.site-footer {
  position: relative;
  padding: var(--space-6) var(--gutter);
  background: linear-gradient(130deg, #464a55 0%, #282c30 100%);
  box-shadow: var(--shadow-raised-up);
  color: #fff;
  line-height: 1.8;
}

.site-footer__inner { max-width: var(--content-width); margin-inline: auto; }
.site-footer a { color: inherit; }

.shipping-note { display: flex; align-items: center; gap: 20px; min-height: 25.2px; }
.shipping-note img { flex: none; width: 97px; height: auto; }

.shipping-note p,
.site-footer__contact p,
.site-footer__copyright {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.25;
  word-spacing: 0.11rem;
}

.shipping-note p { margin-top: var(--space-1); font-style: italic; word-spacing: 2px; }

.site-footer__links {
  display: grid;
  gap: var(--block-gap);
  margin-top: var(--block-gap);
}

.site-footer__links ul {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  padding: 0 8px;
  border-radius: 2px;
  font-size: 1rem;
  line-height: 1.8;
  word-spacing: 2px;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible { background: #fff; color: #000; }
.site-footer__links a[aria-current="page"] { background: var(--color-surface); color: #000; }

/* Widerrufsfunktion (§ 356a BGB): über beide Spalten, linksbündig mit der ersten Spalte; der Rahmen liegt innerhalb der Fläche */
.site-footer__links .site-footer__withdraw { grid-column: 1 / -1; }
.site-footer__withdraw a { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 85%); }
.site-footer__sign { position: relative; top: 1px; }

.site-footer__contact { display: flex; flex-wrap: wrap; min-height: 23.7px; margin-top: var(--block-gap); }
.site-footer__contact > :first-child { flex: 0 0 37%; }
.site-footer__address { display: flex; align-items: flex-start; }
.site-footer__address img { width: 20px; height: 20px; margin-inline: 0.4em; position: relative; top: -1px; }
.site-footer__copyright { margin: var(--block-gap) 0 var(--space-1); }

@media (min-width: 782px) {
  .site-footer__links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 781px) {
  .site-footer__contact > :first-child { flex-basis: 100%; margin-bottom: 7.5px; }
}
