/* Styles für den Shop (shop/*.html) und die AGB-Seite (agb.html).
   Ergänzt /blog/blog.css: Farben, Schriften, Navigation, Footer, Karten und
   Textformatierung kommen von dort. */

/* shop.js blendet Knöpfe und Felder mit hidden aus – das gilt auch dort, wo ein display gesetzt ist. */
[hidden] {
  display: none !important;
}

.nav-actions a[aria-current] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Solange der Kauf-Dialog offen ist, scrollt die Seite dahinter nicht mit. */
body:has(dialog[open]) {
  overflow: hidden;
}

/* ---------- Knöpfe ---------- */

.shop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 16px 22px;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--text);
  color: var(--bg);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background .18s ease, color .18s ease, border-color .18s ease, opacity .18s ease;
}

.shop-button:hover,
.shop-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
}

.shop-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.shop-button.is-quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.shop-button.is-quiet:hover,
.shop-button.is-quiet:focus-visible {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.shop-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  border-color: var(--text);
  background: var(--text);
}

.shop-button.is-busy {
  cursor: wait;
}

/* ---------- Übersicht ---------- */

.shop-head {
  display: grid;
  gap: 24px;
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--line);
}

.shop-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 22px;
}

.shop-title .blog-title-main {
  font-size: clamp(3.4rem, 8vw, 8rem);
  line-height: 0.86;
  letter-spacing: -0.06em;
}

/* Rockybilly hat sehr lange Unterlängen: die hohe Zeile hält den Text darunter auf Abstand. */
.shop-title .blog-title-script {
  padding-top: 0;
  font-size: clamp(1.4rem, 2.2vw, 2.2rem);
  line-height: 2.1;
}

.shop-intro {
  max-width: 760px;
  color: var(--soft);
  font-size: clamp(1.08rem, 1.5vw, 1.45rem);
  line-height: 1.3;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.shop-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-points li {
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shop-main {
  padding: 48px 0 86px;
}

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

.post-card-tile.product-card-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6% 8% 8%;
  font-family: "Inter", Arial, sans-serif;
  text-align: left;
}

.product-tile-brand {
  font-family: "Rockybilly", Georgia, serif;
  font-size: clamp(1.1rem, 1.5vw, 1.5rem);
  line-height: 1.6;
}

.product-tile-title {
  max-width: 100%;
  font-size: clamp(1.5rem, 2.3vw, 2.4rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  font-weight: 900;
  overflow-wrap: break-word;
  hyphens: auto;
}

.post-card .product-card-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.product-card-price strong {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.product-card-price span {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Produktseite ---------- */

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.5fr);
  gap: 60px;
  padding: 56px 0 86px;
}

.product-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.product-buy {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  align-self: start;
  display: grid;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.product-price {
  font-size: clamp(2.2rem, 3.2vw, 3rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 900;
}

.product-facts {
  margin: 0;
  border-top: 1px solid var(--line);
}

.product-facts div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.product-facts dt {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-facts dd {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
  font-weight: 700;
}

.buy-button {
  width: 100%;
}

.product-note {
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Hinweis zum Download direkt nach der Zahlung: auf der Produktseite und auf der Bestätigungsseite. */
.product-notice,
.order-notice {
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.92rem;
  line-height: 1.5;
}

.product-notice strong,
.order-notice strong {
  color: var(--accent);
  font-weight: 900;
}

/* ---------- Kauf-Dialog ---------- */

.buy-dialog {
  width: min(620px, calc(100% - 20px));
  max-height: calc(100% - 20px);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overscroll-behavior: contain;
}

.buy-dialog::backdrop {
  background: rgba(20, 19, 12, 0.72);
  backdrop-filter: blur(4px);
}

.buy-form {
  display: grid;
  gap: 18px;
  padding: 34px 34px 28px;
}

.buy-form .kicker {
  padding-right: 48px;
}

.buy-form h2 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  font-weight: 900;
}

/* Der Titel bekommt beim Öffnen den Fokus (autofocus), damit der Dialog oben beginnt und nicht
   zur ersten Checkbox springt. Einen Fokusrahmen braucht er dafür nicht. */
.buy-form h2:focus {
  outline: none;
}

.buy-terms {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--soft);
  font-size: 0.98rem;
  line-height: 1.5;
}

.buy-terms li {
  position: relative;
  padding-left: 20px;
}

.buy-terms li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.buy-terms strong {
  color: var(--text);
  font-weight: 800;
}

.buy-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.96rem;
  line-height: 1.45;
  font-weight: 700;
}

.buy-check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.buy-check a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.buy-check a:hover,
.buy-check a:focus-visible {
  color: var(--text);
}

.buy-status:empty {
  display: none;
}

.buy-status,
.order-status {
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 700;
}

.buy-status.is-error,
.order-status.is-error {
  color: #f0a6a6;
}

.order-status.is-success {
  color: var(--accent);
}

.buy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.buy-note {
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.buy-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.buy-close:hover,
.buy-close:focus-visible {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.buy-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- Bestätigungsseite ---------- */

.order-body {
  padding-top: 48px;
}

.order-notice {
  display: grid;
  gap: 6px;
  margin-bottom: 24px;
  padding: 18px 22px;
  font-size: 1rem;
}

.order-notice .order-email {
  overflow-wrap: anywhere;
}

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

.order-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--line);
}

.order-card h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  font-weight: 900;
}

.order-card > p:not(.order-status) {
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.5;
}

.order-card .shop-button {
  justify-self: start;
}

.order-status:empty {
  display: none;
}

.order-field {
  display: grid;
  gap: 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.order-field input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  outline: none;
  transition: border-color .18s ease, background .18s ease;
}

.order-field input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
}

.order-legal {
  margin-top: 28px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.order-legal strong {
  color: var(--text);
}

.order-number {
  white-space: nowrap;
}

.order-pending {
  padding-top: 32px;
}

.order-help {
  padding: 40px 0 86px;
  color: var(--soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.order-help a {
  color: var(--accent);
}

/* ---------- AGB ---------- */

.legal-page .post-body h3:first-child {
  margin-top: 0;
}

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

@media (max-width: 1040px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Kaufbox rückt über die Beschreibung. */
  .product-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .product-buy,
  .product-main {
    grid-column: 1;
    grid-row: auto;
  }

  .product-buy {
    position: static;
    max-width: 560px;
  }
}

@media (max-width: 720px) {
  .shop-head {
    gap: 20px;
    padding: 32px 0 32px;
  }

  /* Der Untertitel rutscht unter «Shop»: Abstand für die hohen Oberlängen, Umbruch statt Überlauf. */
  .shop-title {
    gap: 12px 14px;
  }

  .shop-title .blog-title-script {
    font-size: 1.3rem;
    line-height: 1.7;
    white-space: normal;
  }

  .shop-main {
    padding: 32px 0 62px;
  }

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

  .product-layout {
    padding: 32px 0 62px;
  }

  .product-buy {
    max-width: none;
    padding: 22px;
  }

  .buy-form {
    gap: 16px;
    padding: 26px 20px 22px;
  }

  .buy-close {
    top: 12px;
    right: 12px;
  }

  .buy-actions .shop-button {
    flex: 1 1 100%;
  }

  .order-body {
    padding-top: 32px;
  }

  .order-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .order-card {
    padding: 22px;
  }

  .order-help {
    padding: 32px 0 62px;
  }
}
