/* =============================================
   Variables & Reset
   ============================================= */
:root {
  --primary:       #e28235;
  --primary-dark:  #c46b20;
  --primary-light: #fdf3e8;
  --dark:          #1a1a1a;
  --header-bg:     #2d2d2d;
  --border:        #e8e8e8;
  --border-dark:   #ccc;
  --error-bg:      #E74C3C;
  --text:          #333;
  --muted:         #777;
  --bg:            #f2f2f2;
  --radius:        6px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  background: var(--bg);
  padding-bottom: 118px; /* Platz für den fixierten Footer */
}

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

/* =============================================
   Page Header — white bar with clipped logo
   ============================================= */
.page-header {
  background: #fff;
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

/* Clip the 2000×1000 PNG so only the myLINE top-half shows */
.header-logo-clip {
  display: block;
  width: 100px;
  height: 48px;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
}
.header-logo-clip img {
  width: 100px;
  height: auto;        /* = 100px → container clips to top 48px */
  display: block;
}

.header-title {
  font-size: 12.5px;
  color: var(--muted);
  text-align: right;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.4;
  text-transform: uppercase;
}
.header-title strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

/* =============================================
   Page Content & Footer
   ============================================= */
.page-content {
  max-width: 980px;
  margin: 28px auto 60px;
  padding: 0 16px;
}

.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--dark);
  color: #888;
  text-align: center;
  padding: 16px;
  font-size: 12px;
  line-height: 1.7;
}
.page-footer a { color: #bbb; }
.page-footer p { margin: 0; }

/* =============================================
   Loading / Error state
   ============================================= */
.loading-msg {
  text-align: center;
  color: var(--muted);
  padding: 80px 0;
  font-size: 15px;
}

/* =============================================
   Form card
   ============================================= */
#bestellformular {
  background: #fff;
  padding: 32px 36px 40px;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
@media (max-width: 640px) {
  #bestellformular { padding: 18px 14px 26px; }
}

/* =============================================
   Personal info fieldset
   ============================================= */
.pers-block {
  padding: 0 0 22px;
  margin: 0 0 22px;
  border-bottom: 2px solid var(--border);
}
.pers-block-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 14px;
}
.pers-info {
  border: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .pers-info { grid-template-columns: 1fr; }
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-dark);
  font-size: 14px;
  font-family: inherit;
  border-radius: 4px;
  height: 40px;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
input[type="text"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(226,130,53,.15);
}

.pers-info textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-dark);
  font-size: 14px;
  font-family: inherit;
  border-radius: 4px;
  resize: vertical;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.pers-info textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(226,130,53,.15);
}

.pers-info .form-group.span-2    { grid-column: span 2; }
.pers-info .form-group.span-full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .pers-info .form-group.span-2,
  .pers-info .form-group.span-full { grid-column: auto; }
}

input.error,
select.error {
  border-color: var(--error-bg) !important;
  box-shadow: 0 0 0 2px rgba(231,76,60,.12) !important;
}

/* Umtauschgarantie-Hinweis oben im Formular */
.guarantee-note {
  background: #faf1e8;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.45;
  color: #5a3c1e;
}

/* =============================================
   Product sections
   ============================================= */
.product-section { margin-bottom: 46px; }

.product-section h3 {
  color: var(--primary);
  margin: 0 0 6px;
  font-size: 1em;
  font-weight: 700;
  padding: 2px 0 2px 11px;
  border-left: 4px solid var(--primary);
  letter-spacing: 0.01em;
}
.product-section .prices {
  font-size: 11.5px;
  color: var(--muted);
  margin: 6px 0 0;
  padding-left: 15px;
}

/* =============================================
   Tables
   ============================================= */
table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 4px;
}

thead {
  background: var(--header-bg);
  color: #fff;
}
thead th {
  text-align: left;
  padding: 8px 8px;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr { transition: background 0.1s; }
tbody tr:nth-child(odd)  { background: #fafafa; }
tbody tr:nth-child(even) { background: #fff; }
tbody tr:hover           { background: var(--primary-light); }
tbody td {
  border-top: 1px solid var(--border);
  padding: 6px 8px;
  vertical-align: middle;
  font-size: 13.5px;
}

tfoot td {
  border-top: 2px solid var(--border-dark);
  padding: 8px 8px;
  font-size: 13px;
  background: #f6f6f6;
}
tfoot { text-align: right; }
tfoot .total_price,
tfoot .total_count { text-align: right; }

/* Column widths */
th.nr, td.nr           { width: 90px; }
th.kap, td.kap         { width: 80px; text-align: center; color: var(--muted); }
th.price, td.price     { width: 110px; text-align: right; }
th.sales-price, td.sales-price { width: 125px; text-align: right; }
th.input, td.input     { width: 120px; text-align: right; }

/* Product number inputs */
input[type="number"].bst-field {
  width: 74px;
  height: 32px;
  padding: 3px 8px;
  border: 1.5px solid var(--border-dark);
  border-radius: 4px;
  text-align: right;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
input[type="number"].bst-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(226,130,53,.15);
}

/* Product select inputs */
select.bst-field {
  height: 32px;
  padding: 3px 6px;
  border: 1.5px solid var(--border-dark);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s;
}
select.bst-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(226,130,53,.15);
}

/* =============================================
   Validation error messages
   ============================================= */
.error-msg {
  background: var(--error-bg);
  color: #fff;
  padding: 7px 12px;
  margin: 6px 0;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}
.error-msg a { color: #fff; text-decoration: underline; }

/* =============================================
   Anmerkung textarea
   ============================================= */
.anmerkung { margin-bottom: 28px; }
.anmerkung label {
  display: block;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 5px;
}
.anmerkung textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1.5px solid var(--border-dark);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.anmerkung textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(226,130,53,.15);
}

/* =============================================
   Order summary & submit
   ============================================= */
.form-footer {
  border-top: 2px solid var(--border);
  padding-top: 22px;
}

.total_overview {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.total_overview p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.total_overview p:last-child { border-bottom: none; }
.total_overview p.price {
  font-weight: 700;
  font-size: 15px;
  background: var(--primary-light);
}
.total_overview .value {
  min-width: 120px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.btn-submit {
  display: block;
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 16px 20px;
  font-size: 1.05em;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: inherit;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(226,130,53,.35);
}
.btn-submit:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196,107,32,.4);
}
.btn-submit:active  { transform: translateY(0); box-shadow: none; }
.btn-submit:disabled { background: #bbb; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-submit:disabled:hover { background: #bbb; transform: none; box-shadow: none; }

/* Versand-/Zahlungskonditionen (aus products.json → Excel-Blatt "Konditionen"),
   als Fußzeile unter dem Formular und in der Erfolgsmeldung. */
.conditions {
  margin: 26px 0 0;
  padding: 20px 22px;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text);
}
.conditions-group + .conditions-group { margin-top: 16px; }
.conditions-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.conditions-list { margin: 0; }
.conditions-row {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 4px 16px;
  padding: 4px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  align-items: baseline;
}
.conditions-row:first-child { border-top: none; }
.conditions-row dt { font-weight: 600; }
.conditions-row dd { margin: 0; color: #555; }
.success-msg .conditions { background: #fff; }

@media (max-width: 560px) {
  .conditions-row { grid-template-columns: 1fr; gap: 0; }
  .conditions-row dd { margin-bottom: 2px; }
}

/* Versionsstempel (aus products.json), dezent am Formularende */
.form-version {
  margin: 14px 0 0;
  font-size: 11px;
  color: #b5b5b5;
  text-align: right;
}

/* =============================================
   Success screen
   ============================================= */
.success-msg {
  background: #f4fbf4;
  border: 2px solid #4caf50;
  border-radius: var(--radius);
  padding: 32px 36px;
}
.success-msg h1 { color: #2e7d32; margin: 0 0 18px; font-size: 1.35em; }
.success-msg p  { margin: 10px 0; line-height: 1.8; }

/* =============================================
   Landing page (index.html)
   ============================================= */
.landing {
  max-width: 620px;
  margin: 60px auto;
  padding: 0 16px;
  text-align: center;
}
.landing h1 {
  font-size: 1.5em;
  color: var(--dark);
  margin: 0 0 8px;
  font-weight: 700;
}
.landing > p {
  color: var(--muted);
  margin: 0 0 36px;
}
.form-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 460px) {
  .form-cards { grid-template-columns: 1fr; }
}
.form-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  border: 2px solid transparent;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  overflow: hidden;
}
.form-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(226,130,53,.2);
  transform: translateY(-2px);
}
.card-main-link {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 20px 22px;
  text-decoration: none;
  color: var(--dark);
}
.card-main-link:hover { color: var(--dark); }
.card-main-link .icon { font-size: 2.2em; }
.card-main-link strong { font-size: 1em; display: block; line-height: 1.3; }
.card-main-link span { font-size: 11.5px; color: var(--muted); }
.card-main-link .card-title-note { display: block; font-size: 1em; font-weight: normal; color: inherit; }
.card-pdf-link {
  display: block;
  border-top: 1px solid var(--border);
  padding: 9px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  background: var(--bg);
  transition: background 0.15s, color 0.15s;
}
.card-pdf-link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* PDF download bar on form pages */
.pdf-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--primary-light);
  border: 1px solid rgba(226,130,53,.3);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.pdf-bar-label { flex: 1; min-width: 0; }
.pdf-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}
.pdf-bar-btn:hover {
  background: var(--primary-dark);
  color: #fff;
}
