/* Böhubers Hofladen - Basis-Stylesheet (kein Framework, reines CSS) */

:root {
  --color-green-dark: #2f4f2f;
  --color-green: #3f6b3f;
  --color-green-light: #eaf2e8;
  --color-brown: #6b4a2f;
  --color-cream: #faf6ee;
  --color-white: #ffffff;
  --color-text: #2b2b26;
  --color-text-muted: #6a6a63;
  --color-border: #e0dbcd;
  --color-danger: #b53d3d;
  --color-success: #2f6b3f;
  --color-warning: #c98a1c;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --max-width: 1140px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Trebuchet MS", Verdana, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-cream);
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3, h4 {
  color: var(--color-green-dark);
  line-height: 1.25;
  margin-top: 0;
}

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

img { max-width: 100%; display: block; }

/* --- Header / Navigation ------------------------------------------------ */

.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-green-dark);
  text-decoration: none;
}

.brand-logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

.footer-banner { width: 100%; max-width: 700px; border-radius: var(--radius); margin: 0 auto 2rem; display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-green-dark);
  border-radius: 2px;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
}

.main-nav a:hover { color: var(--color-green); }

.nav-admin {
  background: var(--color-green);
  color: var(--color-white) !important;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--color-green);
  color: var(--color-white);
}

.btn-primary:hover { background: var(--color-green-dark); }

.btn-secondary {
  background: var(--color-white);
  color: var(--color-green-dark);
  border: 1px solid var(--color-green);
}

.btn-secondary:hover { background: var(--color-green-light); }

.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
}

.btn-small { padding: 0.45rem 1rem; font-size: 0.9rem; }
.btn-block { width: 100%; }

/* --- Hero ----------------------------------------------------------------- */

.hero {
  background: linear-gradient(135deg, var(--color-green-dark), var(--color-green));
  color: var(--color-white);
  padding: 4rem 0;
  text-align: center;
}

.hero h1 { color: var(--color-white); font-size: 2.6rem; margin-bottom: 0.5rem; }
.hero-sub { font-size: 1.15rem; opacity: 0.95; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero .btn-secondary { background: transparent; color: var(--color-white); border-color: var(--color-white); }
.hero .btn-secondary:hover { background: rgba(255,255,255,0.15); }

/* --- Sections -------------------------------------------------------------- */

.section { padding: 3rem 0; }
.section-alt { background: var(--color-green-light); }
.page-intro { color: var(--color-text-muted); max-width: 60ch; }
.section-more { margin-top: 1.5rem; }
.section-more a { font-weight: 600; text-decoration: none; }

.hof-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.hof-photo {
  margin: 0;
}

.hof-bild {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hof-photo figcaption {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.hof-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 3rem;
}

/* --- Product grid ---------------------------------------------------------- */

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

.product-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.product-image {
  background: var(--color-green-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image-placeholder { font-size: 3rem; }

.product-card h3 { margin-bottom: 0.3rem; }
.product-desc { color: var(--color-text-muted); flex-grow: 1; font-size: 0.95rem; }
.product-price { font-weight: 700; color: var(--color-brown); font-size: 1.1rem; margin: 0.5rem 0; }
.product-stock.in-stock { color: var(--color-success); font-size: 0.9rem; }
.product-stock.out-of-stock { color: var(--color-danger); font-size: 0.9rem; }

.stock-bar {
  width: 100%;
  height: 10px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.4rem 0;
}

.stock-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.stock-bar-green { background: var(--color-success); }
.stock-bar-orange { background: var(--color-warning); }

.stock-bar-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.stock-bar-label.stock-bar-label-orange { color: var(--color-warning); font-weight: 600; }

/* --- News grid --------------------------------------------------------------- */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.news-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.news-card-body { padding: 1.1rem; }
.news-card time { color: var(--color-text-muted); font-size: 0.85rem; }

/* --- Forms ----------------------------------------------------------------- */

.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 0.85rem; color: var(--color-text-muted); margin-top: -0.5rem; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"], input[type="file"],
select, textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-white);
  color: var(--color-text);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-green);
  outline-offset: 1px;
}

fieldset { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
legend { font-weight: 700; color: var(--color-green-dark); padding: 0 0.5rem; }

.checkbox-row label { font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; }

.order-form { max-width: 640px; }

/* --- Confirmation ------------------------------------------------------------ */

.confirmation-box {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 600px;
}

.confirmation-number { font-size: 1.15rem; margin-bottom: 1.5rem; }
.confirmation-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.confirmation-table th, .confirmation-table td { text-align: left; padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); }
.confirmation-table th { width: 40%; color: var(--color-text-muted); font-weight: 600; }

/* --- Login ------------------------------------------------------------------- */

.login-section { display: flex; justify-content: center; }
.login-box {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  max-width: 380px;
  width: 100%;
}

/* --- Flash messages ------------------------------------------------------------ */

.flash-container { margin: 1rem auto; }
.flash {
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.flash-success { background: #e4f3e4; color: var(--color-success); }
.flash-error { background: #fbe6e6; color: var(--color-danger); }
.flash-info { background: #e6f0fb; color: #2b5fa3; }

/* --- Error page ------------------------------------------------------------------ */

.error-page { text-align: center; padding: 5rem 0; }
.error-page h1 { font-size: 4rem; }

/* --- Footer ------------------------------------------------------------------------ */

.site-footer {
  background: var(--color-green-dark);
  color: #dfe8dc;
  padding: 3rem 0 1rem;
  margin-top: 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h3, .site-footer h4 { color: var(--color-white); }
.site-footer a { color: #cfe0cb; }

.newsletter-form { display: flex; flex-direction: column; gap: 0.5rem; }
.newsletter-form input {
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius);
  border: none;
}
.newsletter-form button {
  background: var(--color-white);
  color: var(--color-green-dark);
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem;
  font-weight: 700;
  cursor: pointer;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
  font-size: 0.85rem;
}

/* --- Responsive ------------------------------------------------------------------------ */

@media (max-width: 800px) {
  /* Alles (Text, Abstände, Buttons, ...) rechnet in "rem" relativ zu dieser
     Basisgröße - 70% = 30% kleinerer Start auf dem Handy als am PC. */
  html { font-size: 70%; }

  .hof-gallery { grid-template-columns: 1fr; }
  .hof-text { grid-template-columns: 1fr; }
  .hof-bild { aspect-ratio: 16 / 10; }
  .form-row-split { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    gap: 0.75rem;
  }
  .main-nav.open { display: flex; }
  .hero h1 { font-size: 2rem; }
}
