/* X-Shop - Stylesheet des Shops
   Stand: 17.10.2026 / HT */

/* Farben */
:root {
  --fg: #1d2330;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: var(--brand-bg);
  --bg: #fff;
  --error: #b42318;
  --brand-bg: rgb(0, 84, 143);
}

/* Grundlayout */
* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

a {
  color: var(--accent);
}

/* Kopfbereich und Navigation */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--brand-bg);
  color: #fff;
}

header nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

header nav a,
header button.link {
  color: #fff;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: #fff;
}

/* Sprachauswahl als Dropdown mit Flagge */
.langs {
  position: relative;
}

.langs summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}

.langs summary::-webkit-details-marker {
  display: none;
}

.langs summary::after {
  content: "▾";
}

.langs img {
  border: 1px solid var(--line);
  vertical-align: middle;
}

.langs ul {
  position: absolute;
  right: 0;
  z-index: 10;
  margin: 6px 0 0;
  padding: 4px 0;
  list-style: none;
  min-width: 140px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.langs li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--fg);
}

.langs li a:hover {
  background: var(--line);
}

.langs li a.active {
  font-weight: 700;
}

nav.groups {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--line);
}

nav.groups a {
  text-decoration: none;
  color: var(--fg);
}

nav.groups a.active,
nav.groups a:hover {
  color: var(--accent);
}

nav.crumbs {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

nav.subgroups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  text-decoration: none;
}

/* Artikelliste und Artikel */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

/* Artikelbilder: Vorschau in der Liste, Galerie auf der Artikelseite */
.thumb {
  display: block;
  aspect-ratio: 1;
  margin: -16px -16px 12px;
  border-radius: 8px 8px 0 0;
  background: #f2f4f7;
  overflow: hidden;
}

.thumb img,
.gallery .main,
.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  margin-bottom: 16px;
}

@media (max-width: 700px) {
  .product {
    grid-template-columns: 1fr;
  }
}

.gallery .main {
  height: auto;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #f2f4f7;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.thumbs a {
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #f2f4f7;
}

.thumbs a.active {
  border-color: var(--accent);
}

img.mini {
  width: 40px;
  height: 40px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
  background: #f2f4f7;
  border-radius: 4px;
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.price {
  font-weight: 600;
}

.price small,
.sku,
.stock {
  color: var(--muted);
  font-weight: normal;
}

.tax {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: normal;
  margin-top: -8px;
}

/* Bestand */
.stock.low {
  color: #b54708;
  font-weight: 600;
}

.stock.out {
  color: var(--error);
}

.stock-warn {
  color: var(--error);
}

/* Schaltflächen */
button,
.button {
  background: var(--brand-bg);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font: inherit;
}

button.link {
  background: none;
  color: var(--accent);
  padding: 0;
  text-decoration: underline;
}

button.danger {
  background: var(--error);
}

/* Tabellen: Warenkorb, Kasse, Bestellungen */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

td,
th {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

tr.total td {
  font-weight: 700;
}

td .tax {
  margin: 0 0 0 6px;
}

.num {
  text-align: right;
  white-space: nowrap;
}

tr.subtotal td {
  color: var(--muted);
  border-bottom: 0;
  padding-top: 4px;
  padding-bottom: 4px;
}

tr.note td {
  color: var(--muted);
  font-size: 0.85rem;
  border-bottom: 0;
}

/* Formulare */
input[type="number"] {
  width: 70px;
}

input,
textarea,
select {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

form.inline {
  display: inline;
}

form.checkout {
  display: grid;
  gap: 12px;
  max-width: 480px;
}

form.checkout label {
  display: grid;
  gap: 4px;
}

form.checkout fieldset label {
  display: inline;
  margin-right: 16px;
}

form.checkout fieldset.stack {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

form.checkout fieldset.stack label {
  display: grid;
  gap: 4px;
  margin: 0;
}

form.checkout label.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Meldungen */
.flash {
  padding: 8px 12px;
  border-radius: 6px;
  background: #ecfdf3;
}

.flash.error {
  background: #fef3f2;
  color: var(--error);
}

.flash.info {
  background: #eff8ff;
  color: #175cd3;
}

/* Kundenkonto */
.danger-zone {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.danger-zone a {
  color: var(--error);
}

/* Adressfelder */
form.checkout .row {
  display: flex;
  gap: 12px;
}

form.checkout .row .plz {
  flex: 0 0 120px;
}

form.checkout .row .grow {
  flex: 1;
}

/* Rechnungsadresse: nur sichtbar, wenn "Abweichende Rechnungsadresse" gesetzt ist */
.billing-fields {
  display: none;
}

form:has(input[name="billing_differs"]:checked) .billing-fields {
  display: grid;
}

/* Adressen in der Bestellbestätigung */
.addresses {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
}

.addresses h2 {
  font-size: 1rem;
  margin: 0 0 4px;
}

/* Adressbuch */
.badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff8ff;
  color: #175cd3;
  font-size: 0.8rem;
}

.card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
}

form.address-choice {
  margin-bottom: 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

button.secondary {
  background: var(--muted);
}

/* Fußzeile */
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--brand-bg);
  color: #fff;
  font-size: 0.9rem;
}

footer nav {
  display: flex;
  gap: 20px;
}

footer a {
  color: #fff;
}
