:root {
  --bg: #f7f7fb;
  --card: #ffffff;
  --border: #e9e7f2;
  --text: #18181f;
  --muted: #6b7280;
  --accent: #9333ea;
  --accent-dark: #7c22ce;
  --accent-light: #f3e8ff;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24,24,31,.04), 0 8px 24px rgba(24,24,31,.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; }

/* ===== Login / Change-Password Gate ===== */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, var(--accent-light), transparent 45%),
    radial-gradient(circle at 85% 90%, #ede9fe, transparent 45%),
    var(--bg);
}
.login-card {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-logo { width: 120px; margin-bottom: 20px; }
.login-card h1 { font-size: 22px; margin: 0 0 6px; }
.login-card .muted { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.login-card .muted.small { font-size: 12px; margin: 16px 0 0; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input {
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s;
}
.login-card input:focus { outline: none; border-color: var(--accent); }

/* ===== Buttons ===== */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.back-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 0; margin-bottom: 16px; display: block; font-weight: 600;
}
.back-btn:hover { color: var(--accent); }
.error-msg { color: var(--danger); font-size: 13px; min-height: 4px; }

/* ===== Site Header ===== */
.site-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 14px 24px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-logo { height: 42px; flex-shrink: 0; }
.header-nav { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.nav-link {
  background: none; border: none; padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer;
  white-space: nowrap;
}
.nav-link.active { background: var(--accent-light); color: var(--accent-dark); }
.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; }
.cart-btn {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.cart-btn:hover { border-color: var(--accent); }
.cart-btn svg { width: 20px; height: 20px; color: var(--text); }
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* ===== Views ===== */
.view { max-width: 1000px; margin: 0 auto; padding: 24px; }

.hero { padding: 32px 4px 8px; }
.hero h1 { font-size: 30px; margin: 0 0 6px; }
.hero p { color: var(--muted); margin: 0; font-size: 15px; }

.age-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
  margin: 20px 0 24px;
}

/* ===== Product Grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.product-card:hover { transform: translateY(-2px); }
.pc-image-wrap { width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.pc-image { width: 100%; height: 100%; object-fit: cover; }
.pc-name { margin: 4px 0 0; font-size: 15px; font-weight: 700; }
.pc-description { margin: 0; font-size: 13px; color: var(--muted); flex: 1; line-height: 1.4; }
.pc-select-group { display: flex; flex-direction: column; gap: 3px; }
.pc-select-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.pc-select-group select {
  width: 100%; padding: 9px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: #fff;
}
.pc-variant-description { margin: 0; font-size: 12px; color: var(--muted); font-style: italic; min-height: 15px; }
.pc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.pc-price { font-weight: 800; font-size: 16px; }

/* ===== Cart Drawer ===== */
.cart-overlay { position: fixed; inset: 0; background: rgba(24,24,31,.4); z-index: 30; backdrop-filter: blur(2px); }
.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; background: var(--card); z-index: 31; box-shadow: -12px 0 32px rgba(24,24,31,.15); }
.cart-drawer-inner { display: flex; flex-direction: column; height: 100%; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border); }
.cart-header h3 { margin: 0; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--bg); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 700; }
.cart-item-variant { font-size: 12px; color: var(--muted); }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.cart-item-controls button { width: 26px; height: 26px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 700; }
.cart-footer { padding: 20px; border-top: 1px solid var(--border); }

.summary-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; color: var(--muted); }
.summary-line.total { font-weight: 800; color: var(--text); font-size: 17px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }

/* ===== Checkout ===== */
.checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 800px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow); }
.ck-section h3 { margin: 0 0 10px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ck-section input, .ck-section textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; margin-bottom: 8px;
}
.ck-section input:focus, .ck-section textarea:focus { outline: none; border-color: var(--accent); }
.ck-row { display: flex; gap: 8px; }
.option-list { display: flex; flex-direction: column; gap: 8px; }
.option-card {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; font-size: 14px;
  transition: border-color .15s;
}
/* WICHTIG: native Radios/Checkboxen komplett deaktivieren (appearance:none)
   und durch fest dimensionierte (20x20px, NIE größer) Custom-Controls
   ersetzen. Grund: iOS "Größerer Text"/Bedienungshilfen skaliert native
   Formularelemente teils massiv und unvorhersehbar auf - das hat vorher
   dazu geführt, dass der Radio fast die ganze Box einnahm und der
   Beschriftungstext auf eine 1-Zeichen-breite Spalte gequetscht wurde
   (Zeichen-für-Zeichen-Umbruch). Mit appearance:none ignoriert der Browser
   die OS-Größenvorgabe komplett - garantiert gleich auf jedem Gerät. */
.option-card input[type="radio"],
.age-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  border: 2px solid var(--border);
  cursor: pointer;
  position: relative;
  background: #fff;
}
.option-card input[type="radio"] { border-radius: 50%; }
.age-check input[type="checkbox"] { border-radius: 5px; margin-top: 1px; }
.option-card input[type="radio"]:checked,
.age-check input[type="checkbox"]:checked { border-color: var(--accent); }
.option-card input[type="radio"]:checked::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 10px; height: 10px; background: var(--accent); border-radius: 50%;
  transform: translate(-50%, -50%);
}
.age-check input[type="checkbox"]:checked { background: var(--accent); }
.age-check input[type="checkbox"]:checked::after {
  content: ''; position: absolute; top: 1px; left: 5px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.option-card span { flex: 1; min-width: 0; }
.option-card:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.age-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); }
.order-summary { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: sticky; top: 90px; box-shadow: var(--shadow); }
.order-summary h3 { margin: 0 0 14px; font-size: 15px; }

/* ===== Confirmation ===== */
.confirmation-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px 36px;
  text-align: center;
  max-width: 420px;
  margin: 48px auto;
  box-shadow: var(--shadow);
}
.confirmation-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  background: #dcfce7; color: var(--success);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}
.confirmation-box h2 { font-size: 22px; margin: 0 0 8px; }
.confirmation-box p { margin: 0 0 4px; }
.confirmation-box .muted { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.confirmation-box .btn-block { margin-top: 8px; }
.confirmation-box .back-btn { text-align: center; margin: 14px auto 0; }

.paypal-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 18px;
  margin: 20px 0;
  text-align: left;
}
.paypal-note { font-size: 13px; color: #9a3412; margin: 0 0 14px; line-height: 1.5; }
.paypal-box .btn-primary { display: inline-flex; text-decoration: none; width: 100%; justify-content: center; }

/* ===== My Orders ===== */
.my-orders-list { display: flex; flex-direction: column; gap: 10px; }
.my-order-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; box-shadow: var(--shadow); }
.mo-head { display: flex; flex-direction: column; }
.mo-number { font-size: 14px; }
.mo-status { font-size: 12px; font-weight: 700; color: var(--accent-dark); background: var(--accent-light); padding: 3px 10px; border-radius: 999px; align-self: flex-start; margin-top: 4px; }
.mo-date { font-size: 12px; color: var(--muted); }
.mo-total { font-weight: 800; }

/* ===== Footer ===== */
.site-footer {
  max-width: 1000px;
  margin: 20px auto 40px;
  padding: 20px 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.footer-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-link:hover { color: var(--accent); }
.footer-sep { opacity: .5; }

/* ===== Modal (About etc.) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24,24,31,.45);
  backdrop-filter: blur(2px);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-card h2 { margin: 0 0 14px; font-size: 19px; }
.modal-card p { font-size: 14px; color: #374151; line-height: 1.6; margin: 0 0 14px; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}
.modal-map-link {
  text-decoration: none;
  display: block;
  text-align: center;
  box-sizing: border-box;
  margin-top: 6px;
}

/* ===== Shop Sub-Navigation (Bundles / Pods / Akkuträger) ===== */
.shop-subnav {
  display: flex;
  gap: 8px;
  margin: 4px 0 6px;
  flex-wrap: wrap;
}
.subnav-btn {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}
.subnav-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.subtab-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}

.pc-mode-note {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  margin: -2px 0 2px;
}
