/* =========================================================
   Prior Dienstleistungen – Produkte (Katalog, Produktansicht, Warenkorb)
   Nutzt die Variablen aus styles.css
   ========================================================= */
.page-hero--compact { padding-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.page-hero--compact .hero-copy { max-width: 46rem; }

.shop-section { padding-block: 0 clamp(4rem, 3rem + 4vw, 6.5rem); }
.shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; margin-bottom: 1.5rem; }
.shop-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  min-height: 40px; padding: 0.45rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--petrol);
  font: 600 0.875rem/1 var(--font-head); cursor: pointer; touch-action: manipulation;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--petrol); border-color: var(--petrol); color: #fff; }
@media (hover: hover) and (pointer: fine) { .chip:hover:not([aria-pressed="true"]) { border-color: var(--petrol); } }
.shop-search { position: relative; flex: 0 1 300px; }
.shop-search input { width: 100%; min-height: 44px; padding: 0.55rem 0.9rem 0.55rem 2.4rem; border: 1.5px solid #c9d5cd; border-radius: 999px; background: var(--surface); font: 400 16px/1.4 var(--font-body); color: var(--text); }
.shop-search input:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgb(59 122 8 / 0.2); }
.shop-search svg { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
@media (max-width: 640px) { .shop-search { flex-basis: 100%; } }

.shop-cat-intro { grid-column: 1 / -1; margin: 0 0 0.5rem; max-width: 46rem; color: var(--muted); }
.shop-grid { display: grid; gap: clamp(1rem, 0.75rem + 1vw, 1.5rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.shop-empty { grid-column: 1 / -1; padding: 2rem; border: 1px dashed #c9d5cd; border-radius: var(--radius); background: var(--surface); text-align: center; color: var(--muted); }
.shop-empty strong { color: var(--petrol); }
.shop-skeleton { aspect-ratio: 3 / 4; border-radius: var(--radius); background: linear-gradient(100deg, #eef2ef 40%, #f6f8f5 50%, #eef2ef 60%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Produktkarte */
.p-card {
  display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  animation: pIn 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms);
  transition: box-shadow 220ms var(--ease-out), border-color 180ms ease, transform 220ms var(--ease-out);
}
@keyframes pIn { from { opacity: 0; transform: translateY(8px); } }
@media (hover: hover) and (pointer: fine) { .p-card:hover { border-color: #c4d3c9; box-shadow: var(--shadow-md); transform: translateY(-2px); } }
.p-media { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: #f2f5f2; cursor: zoom-in; overflow: hidden; }
.p-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .p-card:hover .p-media img { transform: scale(1.03); } }
.p-noimg { display: block; width: 100%; height: 100%; min-height: 120px; background: #eef2ef url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa9a0' stroke-width='1.5'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='M21 16l-5-5-8 8'/%3E%3C/svg%3E") center / 48px no-repeat; }
.p-noimg.sm { width: 64px; height: 64px; min-height: 0; border-radius: 10px; background-size: 28px; }
.p-count { position: absolute; right: 0.6rem; bottom: 0.6rem; padding: 0.2rem 0.55rem; border-radius: 999px; background: rgb(11 37 51 / 0.72); color: #fff; font: 600 0.75rem/1.3 var(--font-head); }
.p-body { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; padding: 1rem 1.1rem 1.1rem; }
.p-name { margin: 0; font-size: 1.0625rem; line-height: 1.3; }
.p-name button { padding: 0; border: 0; background: none; font: inherit; color: var(--petrol); text-align: left; cursor: pointer; }
.p-name button:focus-visible, .p-media:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.p-short { margin: 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.p-price { display: grid; gap: 0.1rem; margin: 0.25rem 0 0; }
.p-main { font: 800 1.25rem/1.2 var(--font-head); color: var(--petrol); font-variant-numeric: tabular-nums; }
.p-price.is-big .p-main { font-size: 1.75rem; }
.p-sub { font-size: 0.8125rem; color: var(--muted); }
.p-sub a { color: inherit; }
.p-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; margin-top: auto; padding-top: 0.5rem; }
.p-stock { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8125rem; font-weight: 600; }
.p-stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.p-stock.is-ok { color: var(--green-700); } .p-stock.is-ok::before { background: var(--green); }
.p-stock.is-no { color: #8a5a00; } .p-stock.is-no::before { background: #c47f0a; }
.btn-sm { min-height: 40px; padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn.is-added { background: var(--petrol); }

.shop-info { margin-top: clamp(2rem, 1.5rem + 2vw, 3rem); padding: 1.25rem 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 1rem); }
.shop-info h2 { font-size: 1.125rem; margin: 0 0 0.75rem; }
.shop-facts { display: grid; gap: 0.75rem 2rem; margin: 0; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.shop-facts dt { font: 700 0.75rem/1.3 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-700); }
.shop-facts dd { margin: 0.25rem 0 0; font-size: 0.9375rem; color: var(--text); }

/* Warenkorb-Schaltfläche */
.cart-fab {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 60;
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 52px; padding: 0.5rem 1.1rem 0.5rem 0.9rem;
  border: 0; border-radius: 999px; background: var(--petrol); color: #fff; font: 700 0.9375rem/1 var(--font-head);
  box-shadow: 0 16px 32px -12px rgb(11 37 51 / 0.55); cursor: pointer; touch-action: manipulation;
  transition: transform 180ms var(--ease-out), background-color 150ms ease;
}
.cart-fab[hidden] { display: none; }
.cart-fab:active { transform: scale(0.96); }
.cart-fab .cart-badge { display: grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.35rem; border-radius: 999px; background: var(--green-300); color: var(--petrol-900); font-size: 0.8125rem; }
.cart-fab.is-bump { animation: bump 380ms var(--ease-out); }
@keyframes bump { 30% { transform: scale(1.08); } }
@media (hover: hover) and (pointer: fine) { .cart-fab:hover { background: var(--petrol-700); } }

/* Dialoge */
html:has(dialog.shop-dialog[open]) { overflow: hidden; }
.shop-dialog {
  width: min(960px, calc(100vw - 2rem)); max-height: min(92dvh, 900px); padding: 0; border: 0; border-radius: calc(var(--radius) + 4px);
  background: var(--surface); color: var(--text); box-shadow: 0 40px 80px -24px rgb(11 37 51 / 0.5);
  overflow: hidden; display: none; flex-direction: column;
}
.shop-dialog[open] { display: flex; animation: dIn 220ms var(--ease-out); }
.cart-dialog { width: min(640px, calc(100vw - 2rem)); }
@keyframes dIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.shop-dialog::backdrop { background: rgb(11 37 51 / 0.55); backdrop-filter: blur(3px); }
@media (max-width: 640px) {
  .shop-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
}
.sd-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.sd-head h2 { margin: 0; font-size: 1.25rem; }
.sd-eyebrow { margin: 0; font: 700 0.75rem/1.2 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--green-700); }
.sd-close { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--petrol); cursor: pointer; flex-shrink: 0; }
@media (hover: hover) and (pointer: fine) { .sd-close:hover { border-color: var(--petrol); } }
.sd-body { padding: 1.25rem; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sd-foot { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fbfcfb; flex-shrink: 0; }
@media (max-width: 640px) { .sd-foot .btn { flex: 1; } }

/* Produktansicht */
.pd-grid { display: grid; gap: 1.5rem; padding: 1.25rem; overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 800px) { .pd-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem; padding: 1.5rem; } }
.pd-main { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #f2f5f2; touch-action: pan-y; }
.pd-main img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.pd-thumbs { display: flex; gap: 0.5rem; margin-top: 0.6rem; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: thin; }
.pd-thumbs button { flex: 0 0 auto; width: 68px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #f2f5f2; cursor: pointer; transition: border-color 150ms ease, opacity 150ms ease; opacity: 0.75; }
.pd-thumbs button[aria-pressed="true"] { border-color: var(--green); opacity: 1; }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.pd-info h2 { margin: 0; font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem); line-height: 1.2; }
.pd-sku { margin: -0.4rem 0 0; color: var(--muted); font-size: 0.875rem; }
.pd-buy { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; padding: 0.75rem 0; border-block: 1px solid var(--line); }
.pd-buy .btn { flex: 1; min-width: 200px; }
.pd-short { margin: 0; font-weight: 500; color: var(--petrol); }
.pd-desc { color: var(--text); font-size: 0.9875rem; line-height: 1.6; }
.pd-desc p { margin: 0 0 0.6em; }
.pd-desc ul { margin: 0 0 0.75em; padding-left: 1.2rem; }
.pd-desc li { margin-bottom: 0.25em; }
.pd-note { margin: 0; padding: 0.6rem 0.8rem; border-radius: 8px; background: #fff7e0; color: #5c4708; font-size: 0.875rem; }

/* Menge */
.qty { display: inline-flex; align-items: center; border: 1.5px solid #c9d5cd; border-radius: 999px; overflow: hidden; background: var(--surface); }
.qty button { width: 44px; height: 44px; border: 0; background: none; color: var(--petrol); font: 700 1.25rem/1 var(--font-head); cursor: pointer; touch-action: manipulation; }
.qty button:active { background: #eef2ef; }
.qty input { width: 3rem; height: 44px; border: 0; text-align: center; font: 600 1rem var(--font-body); color: var(--text); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty.sm button { width: 36px; height: 36px; font-size: 1.1rem; }
.qty.sm span { min-width: 1.75rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Warenkorb */
.c-steps { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--line); background: #fbfcfb; font-size: 0.8125rem; color: var(--muted); flex-shrink: 0; overflow-x: auto; }
.c-steps li { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.c-steps li + li::before { content: ""; width: 18px; height: 1px; background: var(--line); margin: 0 0.35rem; }
.c-steps span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-weight: 700; font-size: 0.75rem; }
.c-steps li[aria-current="step"] { color: var(--petrol); font-weight: 600; }
.c-steps li[aria-current="step"] span { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.c-steps li.is-done span { background: var(--green-50); border-color: var(--green-300); color: var(--green-700); }
.c-lines { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.75rem; }
.c-lines li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 0.85rem; align-items: center; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.c-lines li img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #f2f5f2; }
.c-line-main { display: grid; gap: 0.15rem; min-width: 0; }
.c-line-main strong { color: var(--petrol); font-size: 0.9375rem; line-height: 1.3; }
.c-line-main small { color: var(--muted); font-size: 0.8125rem; }
.c-line-main .link-btn { justify-self: start; padding: 0; border: 0; background: none; color: var(--muted); font-size: 0.8125rem; text-decoration: underline; cursor: pointer; }
.c-line-sum { font-weight: 700; color: var(--petrol); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-lines.is-compact li { grid-template-columns: auto minmax(0, 1fr) auto; padding-bottom: 0.5rem; }
.c-q { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .c-lines li { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .c-lines li img, .c-lines li .p-noimg.sm { width: 56px; height: 56px; }
  .c-lines li .qty { grid-column: 2; justify-self: start; }
  .c-lines li .c-line-sum { grid-column: 3; grid-row: 1 / span 2; align-self: start; }
}
.c-delivery { border: 0; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.c-delivery legend { font: 700 0.875rem/1.3 var(--font-head); color: var(--petrol); margin-bottom: 0.5rem; padding: 0; }
.c-choice { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.8rem 0.95rem; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.c-choice input { width: 18px; height: 18px; margin-top: 0.15rem; accent-color: var(--green); }
.c-choice span { display: grid; gap: 0.1rem; } .c-choice strong { color: var(--petrol); } .c-choice small { color: var(--muted); font-size: 0.8125rem; }
.c-choice:has(input:checked) { border-color: var(--green); background: var(--green-50); }
.c-choice.is-disabled { opacity: 0.55; cursor: not-allowed; }
.c-hint { margin: 0 0 1rem; padding: 0.6rem 0.85rem; border-radius: 10px; background: var(--green-50); color: var(--petrol); font-size: 0.875rem; }
.c-totals { margin: 0; display: grid; gap: 0.35rem; }
.c-totals div { display: flex; justify-content: space-between; gap: 1rem; }
.c-totals dt { color: var(--muted); } .c-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.c-totals .is-total { padding-top: 0.5rem; margin-top: 0.25rem; border-top: 1px solid var(--line); font: 800 1.125rem/1.3 var(--font-head); }
.c-totals .is-total dt, .c-totals .is-total dd { color: var(--petrol); }
.c-totals .is-note dt { font-size: 0.8125rem; }
.c-form { display: grid; gap: 1rem; }
.c-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.c-grid[hidden] { display: none; }
.c-field { display: grid; gap: 0.3rem; font: 600 0.875rem/1.3 var(--font-head); color: var(--petrol); }
.c-field.is-full { grid-column: 1 / -1; }
.c-field small { font: 400 0.8125rem var(--font-body); color: var(--muted); }
.c-field input, .c-field textarea { width: 100%; min-height: 46px; padding: 0.6rem 0.8rem; border: 1.5px solid #c9d5cd; border-radius: 10px; background: #fff; font: 400 16px/1.4 var(--font-body); color: var(--text); }
.c-field textarea { resize: vertical; min-height: 70px; }
.c-field input:focus-visible, .c-field textarea:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgb(59 122 8 / 0.2); }
.c-field input[aria-invalid] { border-color: #b3261e; background: #fffafa; }
@media (max-width: 520px) { .c-grid { grid-template-columns: 1fr; } }
.c-check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9rem; line-height: 1.5; cursor: pointer; }
.c-check input { width: 18px; height: 18px; margin-top: 0.15rem; flex-shrink: 0; accent-color: var(--green); }
.c-review { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 1.25rem 0 1rem; padding: 1rem; border-radius: 12px; background: #f6f8f5; font-size: 0.9rem; }
.c-review h4 { margin: 0 0 0.3rem; font: 700 0.75rem/1.3 var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-700); }
.c-review p { margin: 0; }
.c-consents { display: grid; gap: 0.75rem; }
.c-small { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.c-error { margin: 0 0 1rem; padding: 0.7rem 0.9rem; border-radius: 10px; background: #fdecea; color: #7d1a14; font-size: 0.9rem; }
.c-success { text-align: center; display: grid; justify-items: center; gap: 0.5rem; padding-block: 2rem; }
.c-success p { margin: 0; max-width: 32rem; }
.c-success-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--green-50); color: var(--green-700); margin-bottom: 0.5rem; animation: pop 420ms var(--ease-out); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .p-card, .shop-dialog[open], .c-success-icon, .cart-fab.is-bump, .shop-skeleton { animation: none; }
  .p-card, .p-media img, .cart-fab, .chip { transition: none; }
}
.p-name button { width: 100%; }
.c-totals { font-size: 0.9375rem; }
.c-totals .is-total { font-size: 1.0625rem; }
@media (max-width: 640px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .p-body { padding: 0.75rem; gap: 0.35rem; }
  .p-name { font-size: 0.9375rem; }
  .p-short { display: none; }
  .p-main { font-size: 1.0625rem; }
  .p-sub { font-size: 0.75rem; }
  .p-foot { flex-direction: column; align-items: stretch; }
  .p-foot .btn { width: 100%; padding-inline: 0.5rem; }
  .p-stock { font-size: 0.75rem; }
  .p-count { font-size: 0.6875rem; right: 0.4rem; bottom: 0.4rem; }
}

/* Produktansicht groß: mindestens 70 % des Bildschirms */
@media (min-width: 641px) {
  .shop-dialog[data-product-dialog] {
    width: max(70vw, min(960px, calc(100vw - 2rem)));
    max-width: min(1600px, calc(100vw - 2rem));
    min-height: 70dvh;
    max-height: 94dvh;
  }
  .shop-dialog[data-product-dialog] .pd-grid { flex: 1; align-content: start; }
}
@media (min-width: 800px) {
  .shop-dialog[data-product-dialog] .pd-grid { gap: 2.5rem; padding: 2rem; }
  .shop-dialog[data-product-dialog] .pd-main { max-height: calc(94dvh - 12rem); width: 100%; }
}
.pd-desc ul { list-style: disc; } .pd-desc li::marker { color: var(--green); }
