/* Zubehoer-Shop & Warenkorb (accessories.php). Alles unter .acc gescoped,
   newshop.css wird von vielen Seiten genutzt. */

.acc {
  --acc-accent: var(--domain-default-color, #333);
  --acc-text: #1d1d1f;
  --acc-muted: #6e6e73;
  --acc-line: #e5e5ea;
  --acc-soft: #f5f5f7;
  --acc-ok: #1f8a4c;
  --acc-warn: #c62828;
  --acc-radius: 12px;

  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  background: #fff;
  color: var(--acc-text);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  box-sizing: border-box;
}

.acc *,
.acc *::before,
.acc *::after {
  box-sizing: inherit;
}

.acc a {
  color: inherit;
  text-decoration: none;
}

.acc .material-icons {
  font-size: 20px;
  line-height: 1;
}

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

.acc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--acc-accent);
  border-radius: 999px;
  background: var(--acc-accent);
  color: #fff !important;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}

.acc-btn:hover { filter: brightness(1.1); }
.acc-btn:active { transform: translateY(1px); }
.acc-btn:disabled { opacity: .5; cursor: wait; }

.acc-btn--block { width: 100%; }
.acc-btn--lg { padding: 14px 32px; font-size: 17px; }

.acc-btn--ghost {
  background: transparent;
  color: var(--acc-text) !important;
  border-color: var(--acc-line);
}

.acc-btn--ghost:hover {
  border-color: var(--acc-accent);
  filter: none;
}

/* ---------- Kategorien ---------- */

.acc-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: thin;
}

.acc-cat {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 112px;
  padding: 12px 8px 10px;
  border: 1px solid var(--acc-line);
  border-radius: var(--acc-radius);
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}

.acc-cat:hover {
  border-color: var(--acc-accent);
}

.acc-cat.is-active {
  border-color: var(--acc-accent);
  box-shadow: inset 0 0 0 1px var(--acc-accent);
}

.acc-cat__img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 48px;
}

.acc-cat__img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.acc-cat__label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.acc-cat__count {
  font-size: 12px;
  color: var(--acc-muted);
}

@media (min-width: 1100px) {
  .acc-cats { flex-wrap: wrap; overflow: visible; }
}

/* ---------- Toolbar / Breadcrumb ---------- */

.acc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.acc-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 22px;
  font-weight: 700;
}

.acc-crumbs li + li::before {
  content: '›';
  margin-right: 6px;
  color: var(--acc-muted);
  font-weight: 400;
}

.acc-crumbs a:hover { color: var(--acc-accent); }

.acc-crumbs .acc-crumbs__count {
  font-size: 14px;
  font-weight: 400;
  color: var(--acc-muted);
}

.acc-crumbs .acc-crumbs__count::before { content: none; }

/* ---------- Unterkategorien ---------- */

.acc-subcats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.acc-chip {
  padding: 6px 14px;
  border: 1px solid var(--acc-line);
  border-radius: 999px;
  font-size: 14px;
  background: #fff;
  transition: border-color .15s, background-color .15s;
}

.acc-chip span { color: var(--acc-muted); font-size: 12px; }
.acc-chip:hover { border-color: var(--acc-accent); }

.acc-chip.is-active {
  background: var(--acc-accent);
  border-color: var(--acc-accent);
  color: #fff;
}

.acc-chip.is-active span { color: rgba(255, 255, 255, .8); }

/* ---------- Produktraster ---------- */

.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.acc-card {
  scroll-margin-top: calc(var(--header-h, 180px) + 20px);
}

.acc-card form {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--acc-line);
  border-radius: var(--acc-radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow .2s, transform .2s;
}

.acc-card form:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}

.acc-card:target form {
  box-shadow: 0 0 0 2px var(--acc-accent);
}

.acc-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 16px;
  border: 0;
  background: #fff;
  cursor: zoom-in;
}

.acc-card__media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.acc-card__media.is-missing {
  background: var(--acc-soft);
}

.acc-card__media.is-missing::after {
  content: 'image';
  font-family: 'Material Icons';
  font-size: 48px;
  color: #c7c7cc;
}

.acc-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.acc-badge--sale { background: var(--sales-color, var(--acc-warn)); }

.acc-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 4px 16px 12px;
}

.acc-card__brand {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--acc-muted);
}

.acc-card__name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--acc-text);
}

.acc-card__sku {
  font-size: 12px;
  color: var(--acc-muted);
}

.acc-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.acc-price strong { font-size: 18px; }

.acc-price s {
  margin-left: 6px;
  font-size: 13px;
  color: var(--acc-muted);
}

.acc-stock {
  font-size: 12px;
  color: var(--acc-ok);
  white-space: nowrap;
}

.acc-stock::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.acc-card .acc-btn {
  border-radius: 0;
}

/* ---------- Detail-Dialog ---------- */

.acc-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 24px;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.acc-dialog::backdrop { background: rgba(0, 0, 0, .55); }

.acc-dialog__media {
  display: flex;
  justify-content: center;
}

.acc-dialog__media img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.acc-dialog h2 {
  margin: 16px 0 8px;
  font-size: 20px;
  color: #1d1d1f;
}

.acc-dialog__text {
  margin-bottom: 20px;
  color: #3a3a3c;
  line-height: 1.5;
}

.acc-dialog .acc-btn {
  --acc-accent: var(--domain-default-color, #333);
}

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

.acc-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--acc-radius);
  background: #e8f5ec;
  color: var(--acc-ok);
  font-weight: 600;
}

.acc-toast a {
  margin-left: auto;
  text-decoration: underline !important;
}

.acc-empty {
  padding: 64px 16px;
  text-align: center;
  color: var(--acc-muted);
  font-size: 17px;
}

.acc-empty .material-icons {
  font-size: 56px;
  color: #c7c7cc;
}

.acc-alert {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fdecea;
  color: var(--acc-warn);
  font-weight: 600;
}

.acc-alert[hidden] { display: none; }

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

.acc-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--acc-muted) !important;
}

.acc-back:hover { color: var(--acc-text) !important; }

.acc-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.acc-line {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto 110px 40px;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--acc-line);
}

.acc-line:first-child { border-top: 1px solid var(--acc-line); }

.acc-line__img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  background: var(--acc-soft);
  overflow: hidden;
}

.acc-line__img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.acc-line__info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.acc-line__info .acc-card__sku { display: block; }

.acc-line__warn {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--acc-warn);
}

.acc-line.is-over .acc-qty { border-color: var(--acc-warn); }

.acc-line__total {
  font-weight: 700;
  text-align: right;
}

.acc-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--acc-line);
  border-radius: 999px;
}

.acc-qty form { display: contents; }

.acc-qty button {
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--acc-text);
}

.acc-qty button:disabled { color: #c7c7cc; cursor: default; }

.acc-qty__value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

.acc-line__remove button {
  display: flex;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--acc-muted);
  cursor: pointer;
}

.acc-line__remove button:hover {
  background: var(--acc-soft);
  color: var(--acc-warn);
}

.acc-summary {
  position: sticky;
  top: calc(var(--header-h, 180px) + 16px);
  padding: 20px;
  border-radius: var(--acc-radius);
  background: var(--acc-soft);
}

.acc-summary h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.acc-summary dl { margin: 0; }

.acc-summary dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.acc-summary dl > div[hidden] { display: none; }
.acc-summary dt, .acc-summary dd { margin: 0; padding: 0; width: auto; float: none; font-weight: inherit; }

.acc-summary .acc-summary__total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--acc-line);
  font-size: 20px;
  font-weight: 700;
}

/* ---------- Bestellformular ---------- */

.acc-form {
  max-width: 760px;
  margin-top: 40px;
}

.acc-form fieldset {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
}

.acc-form legend {
  margin-bottom: 14px;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
}

.acc-fields {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px 16px;
}

.acc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  grid-column: span 3;
}

.acc-field--s { grid-column: span 2; }
.acc-field--m { grid-column: span 4; }
.acc-field--wide { grid-column: 1 / -1; }

.acc-field > span,
.acc-field > label > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--acc-muted);
}

.acc-field input,
.acc-field select,
.acc-field textarea {
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--acc-text);
  transition: border-color .15s, box-shadow .15s;
}

.acc-field input:focus,
.acc-field select:focus,
.acc-field textarea:focus {
  outline: none;
  border-color: var(--acc-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc-accent) 20%, transparent);
}

.acc-field .is-invalid,
.acc-field .is-invalid:focus {
  border-color: var(--acc-warn) !important;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, .12);
}

/* Adresssuche (js/ort_hilfe.js) */
.acc-field.sv-adresse-zu { display: none; }
.sv-adresse-feld { position: relative; }
.acc-field #svAdresseSuche.sv-adresse-fehlt {
  border-color: var(--acc-warn);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, .12);
}
.sv-adresse-manuell {
  align-self: flex-start;
  font-size: 13px;
  color: var(--acc-muted);
}
.sv-adresse-manuell:hover { color: var(--acc-text); }
.sv-adresse-auswahl {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}
.sv-adresse-eintrag {
  padding: 9px 12px;
  border-bottom: 1px solid #eee;
  color: var(--acc-text);
  cursor: pointer;
}
.sv-adresse-eintrag:last-child { border-bottom: none; }
.sv-adresse-aktiv { background: color-mix(in srgb, var(--acc-accent) 10%, #fff); }

.acc-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--acc-soft);
  font-weight: 600;
}

.acc-agb {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--acc-line);
  border-radius: var(--acc-radius);
}

.acc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
}

.acc-check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--acc-accent);
  flex: none;
}

.acc-check.is-invalid { color: var(--acc-warn); }

.acc-agb details { margin-top: 10px; }

.acc-agb summary {
  color: var(--acc-muted);
  font-size: 14px;
  cursor: pointer;
}

.acc-agb #AGB_TEXT {
  max-height: 260px;
  margin-top: 10px;
  overflow-y: auto;
  font-size: 13px;
  color: #3a3a3c;
}

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

@media (max-width: 900px) {
  .acc-checkout { grid-template-columns: 1fr; gap: 24px; }
  .acc-checkout__main { display: contents; }
  .acc-cart { order: 1; }
  .acc-summary { order: 2; position: static; }
  .acc-form { order: 3; margin-top: 16px; }
}

@media (max-width: 600px) {
  .acc { padding: 16px 16px 48px; }
  .acc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .acc-card__body { padding: 4px 10px 10px; }
  .acc-card__name { font-size: 14px; }
  .acc-price strong { font-size: 16px; }
  .acc-card .acc-btn { padding: 10px 8px; font-size: 13px; }
  .acc-card .acc-btn .material-icons { display: none; }
  .acc-crumbs { font-size: 18px; }

  .acc-line {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas: "img info remove" "img qty total";
    gap: 8px 12px;
  }
  .acc-line__img { grid-area: img; width: 64px; height: 64px; align-self: start; }
  .acc-line__info { grid-area: info; }
  .acc-qty { grid-area: qty; justify-self: start; }
  .acc-line__total { grid-area: total; }
  .acc-line__remove { grid-area: remove; }

  .acc-fields { grid-template-columns: 1fr; }
  .acc-field, .acc-field--s, .acc-field--m { grid-column: 1 / -1; }
  .acc-btn--lg { width: 100%; }
}
