/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --green-dark:    #2d5a27;
  --green-mid:     #4a7c43;
  --green-light:   #e8f0e6;
  --sand:          #f5f0e8;
  --sand-dark:     #e8dcc8;
  --warm-accent:   #c8822a;
  --warm-light:    #fdf3e3;
  --white:         #ffffff;
  --text:          #2c2c2c;
  --text-muted:    #6b6b6b;
  --border:        #d8d0c4;
  --shadow:        0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.15);
  --radius:        10px;
  --radius-lg:     16px;
  --transition:    0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Lato', Arial, sans-serif;
  background: var(--sand);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--green-dark);
  color: var(--white);
  padding: 0.75rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  border-radius: 4px;
}

.header-text h1,
.header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin: 0;
}

.header-text p,
.header-sub {
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  color: rgba(255,255,255,0.8);
  margin: 0;
}

/* ─── Countdown ─────────────────────────────────────────────── */
.countdown-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}

.countdown-label {
  font-size: 0.88rem;
  color: inherit;
  opacity: 0.8;
}

.countdown-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  background: rgba(45, 90, 39, 0.08);
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.3s;
}

/* ─── Honeypot-Feld (komplett versteckt) ─────────────────────── */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ─── Schwebender Mobile-Warenkorb ───────────────────────────── */
/* Kern-Regeln – gelten auf allen Breiten */
#mobileCart {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 9999;
  background: var(--green-dark);
  color: var(--white);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0,0,0,0.20);
  border-radius: 18px 18px 0 0;
  display: none;                /* JS überschreibt via style.display */
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  /* GPU-Compositing erzwingen – verhindert Flackern auf iOS */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}

/* Desktop: nie anzeigen – !important schlägt JS-inline-style */
@media (min-width: 769px) {
  #mobileCart { display: none !important; }
}

/* Mobile: flex wenn sichtbar, oberer Balken ausblenden */
@media (max-width: 768px) {
  /* Oberen Progress-Balken auf Mobile verstecken – unten schwebender Warenkorb übernimmt */
  .progress-bar {
    display: none !important;
  }

  #mobileCart[style*="flex"] {
    display: flex !important;
  }

  /* Genug Abstand damit kein Inhalt dahinter verschwindet */
  body.mobile-cart-open {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

.mc-count {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.mc-total {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  text-align: center;
  flex: 1;
  white-space: nowrap;
}

.mc-total strong {
  color: var(--white);
  font-size: 0.95rem;
}

.mc-btn {
  background: var(--warm-accent);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background var(--transition);
}
.mc-btn:active { background: #a06018; transform: scale(0.97); }

/* ─── Ausverkauft-Artikel ────────────────────────────────────── */
.product-card.sold-out {
  background: #f7f7f7;
  border-color: #e0e0e0;
  opacity: 0.65;
}

.product-card.sold-out .product-name { color: #888; }
.product-card.sold-out .product-price { color: #aaa; }

.product-card.sold-out .qty-btn {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
  border-color: #ccc;
}

.sold-out-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #777;
  background: #e8e8e8;
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ─── Sticky Bestellfortschritt ──────────────────────────────── */
.progress-bar {
  background: var(--warm-accent);
  color: var(--white);
  position: sticky;
  top: 73px;        /* direkt unter dem Header */
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: transform 0.25s ease;
}

.progress-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.progress-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.progress-icon { font-size: 1.2rem; }

.progress-text {
  font-size: 0.95rem;
  font-weight: 700;
}

.progress-action {
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition);
}
.progress-action:hover {
  background: rgba(255,255,255,0.35);
  text-decoration: none;
  color: white;
}

/* ─── Main ───────────────────────────────────────────────────── */
.main-content { flex: 1; padding: 1.5rem 0 3rem; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ─── Welcome Section ────────────────────────────────────────── */
.welcome-section { margin-bottom: 2rem; }

.welcome-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--warm-accent);
  margin-bottom: 1rem;
}

.welcome-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

.welcome-card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}

.welcome-card p { color: var(--text-muted); font-size: 1rem; line-height: 1.7; }

/* ─── Info Banners ───────────────────────────────────────────── */
.info-banner {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.info-banner--info {
  background: var(--green-light);
  border: 1px solid #b8d4b4;
  color: var(--green-dark);
}

.info-banner--warning {
  background: #fff8e6;
  border: 1px solid #f0c060;
  color: #7a5200;
}

.banner-icon { font-size: 1.5rem; flex-shrink: 0; }

/* ─── Order Layout ───────────────────────────────────────────── */
.order-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .order-layout { grid-template-columns: 1fr; }
  .cart-sidebar { order: -1; }
}

/* ─── Section Headings ───────────────────────────────────────── */
.section-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  color: var(--green-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--sand-dark);
}

/* ─── Customer Form ──────────────────────────────────────────── */
.customer-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.required { color: #d32f2f; }
.optional { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(45,90,39,0.15);
}

.form-control::placeholder { color: #bbb; }

/* ─── Products Section ───────────────────────────────────────── */
.products-section { margin-bottom: 1.5rem; }

.product-category { margin-bottom: 2rem; }

.category-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: var(--green-light);
  border-radius: 6px;
  border-left: 4px solid var(--green-mid);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.product-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.product-card:has(.qty-display:not(:empty)):not(.qty-zero) {
  border-color: var(--green-mid);
  box-shadow: 0 2px 8px rgba(45,90,39,0.12);
}

.product-card.has-qty {
  border-color: var(--green-mid);
  box-shadow: 0 2px 8px rgba(45,90,39,0.12);
  background: var(--green-light);
}

.product-info { flex: 1; min-width: 0; }

.product-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
}

.product-price {
  display: block;
  font-size: 0.9rem;
  color: var(--warm-accent);
  font-weight: 700;
  margin-top: 2px;
}

.product-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--green-dark);
  background: var(--white);
  color: var(--green-dark);
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  line-height: 1;
  padding: 0;
}

.qty-btn:hover, .qty-btn:active {
  background: var(--green-dark);
  color: var(--white);
}

.qty-btn:active { transform: scale(0.93); }

.qty-display {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

/* ─── Cart Sidebar ───────────────────────────────────────────── */
.cart-sidebar { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 900px) {
  .cart-sidebar { position: static; }
}

.cart-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--warm-accent);
}

.cart-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  color: var(--green-dark);
  margin-bottom: 1rem;
}

.cart-empty { text-align: center; padding: 1.5rem 0; color: var(--text-muted); }
.cart-empty-hint { font-size: 0.85rem; margin-top: 0.25rem; }

.cart-items { margin-bottom: 1rem; }

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.cart-item:last-child { border-bottom: none; }

.cart-item-name { font-weight: 600; flex: 1; }
.cart-item-qty { color: var(--text-muted); font-size: 0.85rem; }
.cart-item-price { font-weight: 700; color: var(--warm-accent); margin-left: 0.5rem; white-space: nowrap; }

.cart-total {
  background: var(--sand);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
}

.cart-total-row strong { font-size: 1.2rem; color: var(--green-dark); }

.form-error {
  background: #fee2e2;
  color: #dc2626;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.cart-hint { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }

.cart-info-box { border-top-color: var(--green-mid); }
.cart-info-box h3 { font-size: 1rem; color: var(--green-dark); margin-bottom: 0.75rem; font-weight: 700; }

.info-list { list-style: none; }
.info-list li { padding: 0.35rem 0; font-size: 0.9rem; color: var(--text-muted); }
.info-list li strong { color: var(--text); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--green-dark);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(45,90,39,0.3);
}
.btn-primary:hover { background: var(--green-mid); box-shadow: 0 4px 12px rgba(45,90,39,0.4); color: white; }

.btn-secondary {
  background: var(--sand-dark);
  color: var(--text);
}
.btn-secondary:hover { background: #d8cfc0; color: var(--text); }

.btn-full { width: 100%; }

.btn-large { padding: 0.85rem 1.5rem; font-size: 1.05rem; }

.btn-icon { font-size: 1.1rem; }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { transform: scale(0.9) translateY(-20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-icon { font-size: 3.5rem; margin-bottom: 0.75rem; }

.modal-box h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
}

.modal-text { font-size: 1rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.modal-pickup { font-size: 1.05rem; color: var(--text); margin-bottom: 0.5rem; }
.modal-date { font-size: 0.9rem; color: var(--warm-accent); margin-bottom: 0.75rem; }

.modal-cancel-hint {
  margin: 0.75rem 0 0.25rem;
  padding: 0.75rem 1rem;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: #78350f;
}

.modal-cancel-hint p { margin-bottom: 0.35rem; }

.btn-cancel-link {
  display: inline-block;
  color: #92400e;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
.btn-cancel-link:hover { color: #dc2626; }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.85rem;
}

.footer-inner p { margin: 0.2rem 0; }
.footer-inner a { color: rgba(255,255,255,0.85); }
.footer-inner a:hover { color: white; }

/* ─── Utilities ──────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
