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

:root {
  --green-900: #3a4e35;
  --green-800: #4a6344;
  --green-700: #5a7355;
  --green-600: #6d8a67;
  --green-500: #8a9e82;
  --green-400: #a3b59c;
  --green-200: #cfdfc8;
  --green-100: #deebd8;
  --green-50:  #edf4ea;
  --cream:     #faf8f3;
  --warm-50:   #fdf9f0;
  --red-700:   #8b2020;
  --red-500:   #b53030;
  --amber-600: #b87c10;
  --amber-50:  #fef9ec;
  --gray-700:  #3a3a36;
  --gray-500:  #6b6b60;
  --gray-300:  #c4c4bc;
  --gray-100:  #f3f3ef;
  --white:     #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --radius:    6px;
  --radius-lg: 10px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Lora', Georgia, serif;
  background: var(--cream);
  color: var(--gray-700);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }

/* ─── TYPOGRAPHY ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--green-900);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

.sans { font-family: 'Source Sans 3', Arial, sans-serif; }

/* ─── LAYOUT ────────────────────────────────────────────────────────────────── */
.container { max-width: 1060px; margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 720px; margin: 0 auto; padding: 0 1.25rem; }

/* ─── HEADER ────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--green-900);
  border-bottom: 3px solid var(--red-700);
  padding: .9rem 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-brand { display: flex; align-items: center; gap: 1rem; }
.logo-box {
  border: 1px solid rgba(255,255,255,.3);
  padding: .35rem .65rem;
  text-align: center;
  background: rgba(255,255,255,.08);
}
.logo-box strong {
  display: block;
  color: white;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: .72rem;
  letter-spacing: 2px;
  line-height: 1.3;
}
.logo-box small {
  display: block;
  color: rgba(255,255,255,.5);
  font-size: .6rem;
  letter-spacing: 1.5px;
  font-family: 'Source Sans 3', Arial, sans-serif;
}
.header-text { color: white; }
.header-text h1 {
  font-size: 1rem;
  letter-spacing: 2px;
  color: rgba(255,255,255,.9);
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-weight: 600;
}
.header-text p {
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  font-style: italic;
  font-family: 'Source Sans 3', Arial, sans-serif;
  margin: 0;
}

/* ─── EVENT BANNER ──────────────────────────────────────────────────────────── */
.event-banner {
  background: var(--green-50);
  border-bottom: 1px solid var(--green-200);
  padding: .7rem 0;
  font-family: 'Source Sans 3', Arial, sans-serif;
}
.event-banner .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
}
.event-chip {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--green-800);
}
.event-chip .icon {
  font-size: 1rem;
  color: var(--green-600);
}
.event-chip strong { font-weight: 700; }

.banner-closed {
  background: var(--amber-50);
  border-bottom: 1px solid #e8c97a;
  padding: .8rem 0;
}
.banner-closed .container {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .9rem;
  color: var(--amber-600);
}

/* ─── SECTION LABELS ────────────────────────────────────────────────────────── */
.section-label {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .7rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gray-500);
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--green-200);
  margin-bottom: 1rem;
}

/* ─── CARDS ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
}
.card--flat {
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

/* ─── PRODUCT CARDS ─────────────────────────────────────────────────────────── */
.product-group { margin-bottom: 2rem; }
.product-group h3 {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .7rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gray-500);
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--green-200);
  margin-bottom: .75rem;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--green-200);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin-bottom: .6rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: border-color .15s;
}
.product-card:hover { border-color: var(--green-400); }
.product-info { flex: 1; }
.product-name {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-weight: 700;
  font-size: .95rem;
  color: var(--gray-700);
  margin-bottom: .15rem;
}
.product-desc {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .8rem;
  color: var(--gray-500);
  font-style: italic;
  margin-bottom: .35rem;
}
.product-price {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .85rem;
  color: var(--green-700);
  font-weight: 700;
}

/* ─── QTY CONTROLS ──────────────────────────────────────────────────────────── */
.qty-wrap { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.qty-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--green-300, #9ab87a);
  background: var(--green-50);
  color: var(--green-800);
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
  font-family: 'Source Sans 3', Arial, sans-serif;
  line-height: 1;
}
.qty-btn:hover { background: var(--green-600); color: white; border-color: var(--green-600); }
.qty-input {
  width: 44px;
  text-align: center;
  border: 1px solid var(--green-200);
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 700;
  padding: .3rem;
  color: var(--gray-700);
  font-family: 'Source Sans 3', Arial, sans-serif;
}
.qty-input:focus { outline: none; border-color: var(--green-500); }

/* ─── CART PANEL ────────────────────────────────────────────────────────────── */
.layout-shop { display: flex; align-items: flex-start; gap: 1.5rem; margin-top: 1.5rem; }
.products-col { flex: 1; min-width: 0; }
.cart-col {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 1rem;
}

.cart-panel {
  background: var(--white);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cart-header {
  background: var(--green-900);
  color: white;
  padding: .7rem 1.1rem;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-body { padding: .9rem 1.1rem; }
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--green-100);
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .82rem;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-name { color: var(--gray-700); flex: 1; line-height: 1.3; }
.cart-item-price { color: var(--green-700); font-weight: 700; white-space: nowrap; }
.cart-empty {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .82rem;
  color: var(--gray-500);
  font-style: italic;
  padding: .75rem 0;
}
.cart-total {
  border-top: 2px solid var(--green-200);
  margin-top: .5rem;
  padding-top: .6rem;
  display: flex;
  justify-content: space-between;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-900);
}

.pickup-box {
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius);
  padding: .65rem .85rem;
  margin: .75rem 0;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .8rem;
  color: var(--green-800);
  line-height: 1.6;
}
.twint-box {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: .55rem .85rem;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .78rem;
  color: var(--gray-500);
  text-align: center;
  font-style: italic;
  margin-bottom: .75rem;
}

/* ─── BUTTONS ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.2rem;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .88rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: .5px;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .88; }
.btn--primary { background: var(--green-700); color: white; }
.btn--primary:hover { background: var(--green-600); opacity: 1; }
.btn--outline {
  background: white;
  color: var(--green-700);
  border: 1px solid var(--green-400);
}
.btn--outline:hover { background: var(--green-50); opacity: 1; }
.btn--danger { background: var(--red-700); color: white; }
.btn--sm { padding: .35rem .8rem; font-size: .78rem; }
.btn--full { width: 100%; justify-content: center; }

/* ─── FORMS ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: .9rem; }
.form-label {
  display: block;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: .5px;
  margin-bottom: .3rem;
}
.form-control {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--green-200);
  border-radius: var(--radius);
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .9rem;
  color: var(--gray-700);
  background: white;
  transition: border-color .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 2px rgba(94,143,56,.15);
}
.form-row { display: flex; gap: .75rem; }
.form-row .form-group { flex: 1; }
.form-hint {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .74rem;
  color: var(--gray-500);
  margin-top: .2rem;
  font-style: italic;
}
.required-star { color: var(--red-500); }

/* ─── ALERTS ────────────────────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .88rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.alert--success { background: #eaf4e0; color: #2d5a1b; border: 1px solid #b5d98a; }
.alert--error   { background: #fce8e8; color: #7a1a1a; border: 1px solid #e8a0a0; }
.alert--info    { background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-200); }
.alert--warning { background: var(--amber-50); color: var(--amber-600); border: 1px solid #e8c97a; }

/* ─── STATUS BADGES ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border-radius: 20px;
}
.badge-new    { background: var(--green-50);  color: var(--green-800); border: 1px solid var(--green-200); }
.badge-ready  { background: var(--amber-50);  color: var(--amber-600); border: 1px solid #e8c97a; }
.badge-done   { background: var(--gray-100);  color: var(--gray-500);  border: 1px solid var(--gray-300); }
.badge-cancel { background: #fce8e8;          color: var(--red-700);   border: 1px solid #e8a0a0; }

/* ─── TABLES ────────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .84rem;
}
.data-table th {
  text-align: left;
  padding: .55rem .9rem;
  background: var(--green-50);
  color: var(--green-800);
  font-size: .72rem;
  letter-spacing: .8px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--green-200);
}
.data-table td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--green-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--green-50); }

/* ─── FOOTER ────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--green-900);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .78rem;
}
.site-footer a { color: rgba(255,255,255,.7); }

/* ─── PRINT STYLES ──────────────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  .site-header, .site-footer, .event-banner, .cart-col, .nav { display: none !important; }
  body { background: white; font-size: 12pt; }
  .lieferschein { border: none !important; box-shadow: none !important; }
  .page-break { page-break-after: always; }
}

/* ─── RESPONSIVE ────────────────────────────────────────────────────────────── */
/* ─── RESPONSIVE — iPhone / iPad ───────────────────────────────────────────── */

/* iPad landscape + small desktop (≤900px) */
@media (max-width: 900px) {
  .cart-col { width: 260px; }
}

/* iPad portrait + large phones (≤720px) */
@media (max-width: 720px) {
  /* Layout */
  .layout-shop { flex-direction: column; }
  .cart-col { width: 100%; position: static; }
  .form-row { flex-direction: column; gap: 0; }

  /* Typography */
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }

  /* Header */
  .site-header .container { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .header-text h1 { font-size: .85rem; }
  .header-text p { font-size: .7rem; }

  /* Event banner - stack vertically */
  .event-banner-blocks { flex-direction: column !important; gap: .75rem !important; }
  .event-banner-divider { display: none !important; }

  /* Product cards */
  .product-card { padding: .75rem .9rem; }
  .qty-input { width: 38px; font-size: .88rem; }

  /* Cart */
  .cart-body { padding: .75rem .9rem; }

  /* Admin nav - scrollable */
  .admin-nav .container { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .25rem; }
  .admin-nav a { white-space: nowrap; }

  /* Admin flex layouts */
  .admin-flex { flex-direction: column !important; }
  .admin-flex > div { min-width: 0 !important; width: 100% !important; max-width: 100% !important; }

  /* Tables - horizontal scroll */
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 500px; }

  /* Lieferschein */
  .lieferschein { padding: 1.2rem 1rem; }
  .ls-head { flex-direction: column; gap: .75rem; }
  .ls-title-block { text-align: left; }
  .ls-footer-row { flex-direction: column; gap: .75rem; }
}

/* iPhone SE / small phones (≤400px) */
@media (max-width: 400px) {
  .container { padding: 0 .75rem; }
  .logo-box { padding: .25rem .5rem; }
  .logo-box strong { font-size: .6rem; }
  .header-text h1 { font-size: .75rem; letter-spacing: 1px; }
  .btn { padding: .5rem .9rem; font-size: .82rem; }
  .cart-header { padding: .6rem .9rem; font-size: .8rem; }
  .product-name { font-size: .88rem; }
  .qty-btn { width: 26px; height: 26px; }
}

/* Touch-friendly: larger tap targets on touch devices */
@media (hover: none) and (pointer: coarse) {
  .qty-btn { min-width: 36px; min-height: 36px; }
  .btn { min-height: 40px; }
  .form-control { min-height: 40px; font-size: 16px; } /* 16px prevents iOS zoom */
  select.form-control { font-size: 16px; }
}

/* ─── LIEFERSCHEIN ──────────────────────────────────────────────────────────── */
.lieferschein {
  background: white;
  border: 1px solid var(--green-200);
  border-radius: var(--radius-lg);
  padding: 2rem 2.2rem;
  max-width: 680px;
  margin: 0 auto;
}
.ls-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 2px solid var(--green-200);
}
.ls-logo-text strong {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  color: var(--green-900);
}
.ls-logo-text small {
  display: block;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .78rem;
  color: var(--gray-500);
  margin-top: .1rem;
}
.ls-title-block { text-align: right; }
.ls-title-block h2 {
  font-size: 1.5rem;
  color: var(--green-900);
  letter-spacing: 1px;
  margin-bottom: .1rem;
}
.ls-title-block .ls-nr {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .8rem;
  color: var(--gray-500);
}

.ls-section { margin-bottom: 1.2rem; }
.ls-section-title {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-500);
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--green-200);
  margin-bottom: .65rem;
}

.ls-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .85rem;
}
.ls-table th {
  text-align: left;
  padding: .5rem .7rem;
  background: var(--green-50);
  color: var(--green-800);
  font-size: .75rem;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--green-200);
}
.ls-table td {
  padding: .55rem .7rem;
  border-bottom: 1px solid var(--green-50);
  vertical-align: top;
}
.ls-total-row td {
  font-weight: 700;
  color: var(--green-900);
  border-top: 2px solid var(--green-200);
  border-bottom: none;
  font-size: .95rem;
}

.ls-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--green-200);
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .8rem;
  color: var(--gray-500);
}
.ls-footer-row strong { color: var(--gray-700); }

/* ─── ADMIN NAV ─────────────────────────────────────────────────────────────── */
.admin-nav {
  background: var(--green-800);
  padding: .5rem 0;
}
.admin-nav .container {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}
.admin-nav a {
  font-family: 'Source Sans 3', Arial, sans-serif;
  font-size: .82rem;
  color: rgba(255,255,255,.7);
  padding: .35rem .8rem;
  border-radius: var(--radius);
  letter-spacing: .3px;
  transition: background .12s;
}
.admin-nav a:hover, .admin-nav a.active {
  background: rgba(255,255,255,.15);
  color: white;
  text-decoration: none;
}

.page-title {
  padding: 1.5rem 0 .75rem;
  border-bottom: 1px solid var(--green-200);
  margin-bottom: 1.5rem;
}
.page-title h2 { margin: 0; }
