/* Bäcker Cracker – Styles (Werte aus dem Design-Mockup übernommen) */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/roboto-latin.woff2) format('woff2');
}

:root {
  --ink: #101213;
  --dark: #141618;
  --btn: #262729;
  --gold: #ad7a29;
  --gold-light: #d9a54f;
  --gold-text: #8a5f1c;
  --muted: #6b6b6b;
  --soft: #f7f7f7;
  --line: #e4e4e4;
  --danger-bg: #fbeee6;
  --danger: #8a2c0d;
  --req: #d4121f;
  --gutter: clamp(16px, 3vw, 36px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: #fff;
  font-family: Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
}

a { color: var(--ink); }
a:hover { color: var(--gold); }
img { max-width: 100%; }
h1, h2, h3, h4, h5, p { overflow-wrap: break-word; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: #fff; color: var(--ink); padding: 10px 16px; font-weight: 600;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  background: var(--dark);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  display: flex; flex-wrap: wrap; align-items: stretch; justify-content: space-between;
  min-height: 70px;
  padding: 0 0 0 clamp(16px, 4vw, 48px);
  position: sticky; top: 0; z-index: 10;
}
.site-header__logo { display: flex; align-items: center; padding: 10px 0; }
.site-header__logo img { width: 140px; height: auto; display: block; }

.site-nav { display: flex; align-items: stretch; flex-wrap: wrap; }
.site-nav a { color: #fff; text-decoration: none; }
.site-nav a:hover { color: var(--gold-light); }
.site-nav__links {
  display: flex; align-items: center; gap: 22px; padding: 0 28px; flex-wrap: wrap;
  font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
}
.site-nav__links a { padding: 12px 0; }
.site-nav__cart {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 70px; padding: 0 20px;
  border-left: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px; font-weight: 600;
}
.badge {
  background: var(--gold); color: #fff; border-radius: 10px;
  padding: 0 7px; font-size: 11px; line-height: 18px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  height: clamp(380px, 44vw, 560px);
  background: #141618;
  display: flex; justify-content: center; align-items: flex-start; padding: 0 16px;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: url(../img/hero.jpg) center bottom / cover no-repeat;
  transform-origin: center bottom;
}
.hero h1 { margin: clamp(36px, 5vw, 64px) 0 0; line-height: 0; }
.hero img { width: min(360px, 78vw); height: auto; display: block; }

/* ---------- Produkte ---------- */
.products { background: var(--soft); padding: 36px var(--gutter); }
.products__grid {
  max-width: 1280px; margin: 0 auto; display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}
.product {
  background: #fff; display: flex; gap: 12px;
  padding: 28px 0 0 28px; min-height: 392px; overflow: hidden;
}
.product__body {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-bottom: 28px;
}
.product__title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.85px; line-height: 1.4; }
.product__teaser { margin: 0; color: var(--muted); line-height: 1.7; }
.product__price { margin-top: 4px; }
.product__price-main { font-size: 17px; font-weight: 600; letter-spacing: -.85px; line-height: 1.3; }
.product__price-main span { font-size: 13px; letter-spacing: 0; }
.product__price-sub { font-size: 12px; font-weight: 600; line-height: 1.6; }
.product__allergens { font-size: 12px; color: var(--muted); line-height: 1.5; }
.product__actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.product__inorder { font-size: 13px; font-weight: 600; color: var(--gold-text); }
.product__img {
  width: 44%; max-width: 180px; height: auto; align-self: flex-end;
  display: block; object-fit: contain;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--btn); color: #fff; border: 0; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; text-decoration: none; line-height: 1.2;
  padding: 0 18px; height: 44px; transition: background .15s;
}
.btn:hover { background: var(--gold); color: #fff; }
.btn--lg { font-size: 13px; height: 52px; padding: 0 28px; align-self: flex-start; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- Sektionen ---------- */
.section { padding: 72px var(--gutter); }
.section--delivery { padding-bottom: 36px; }
.section--order { padding-top: 36px; padding-bottom: 80px; }
.section__inner { max-width: 1180px; margin: 0 auto; }
.section__inner--narrow { max-width: 860px; }
.section__title {
  margin: 0; font-size: 29px; font-weight: 600; letter-spacing: -1.45px; line-height: 1.3;
}
.rule { width: 90px; height: 2px; background: var(--gold); margin: 26px 0 36px; }

.columns { display: flex; flex-wrap: wrap; gap: 36px 72px; }
.columns > * { flex: 1 1 380px; min-width: 0; }
.columns h4 { margin: 0 0 18px; font-size: 15px; font-weight: 600; }
.columns p { margin: 0 0 18px; color: var(--muted); }
.columns p:last-child { margin-bottom: 0; }

.pattern-band {
  background: #0b1430 url(../img/muster.jpg) center / cover no-repeat;
  padding: 72px 16px; display: flex; justify-content: center;
}
.pattern-band h2 {
  margin: 0; max-width: 820px; text-align: center; color: #fff;
  font-size: clamp(22px, 2.6vw, 29px); font-weight: 600; letter-spacing: -.5px; line-height: 1.35;
}

.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; color: var(--muted); }
.steps li { display: flex; gap: 14px; align-items: baseline; }
.steps__no {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--dark); color: #fff; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Bestellformular ---------- */
.order-form { display: flex; flex-wrap: wrap; gap: 36px 48px; align-items: flex-start; }

.order-form__cart {
  flex: 1 1 420px; min-width: 0; padding: 28px; background: var(--soft);
  display: flex; flex-direction: column;
}
.order-form h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -.85px; line-height: 1.4; }

.cart-lines { display: flex; flex-direction: column; width: 100%; }
.cart-line {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line); width: 100%;
}
.cart-line img { width: 32px; height: 64px; object-fit: cover; display: block; flex: none; }
.cart-line__name { flex: 1 1 auto; min-width: 90px; line-height: 1.35; white-space: nowrap; }
.cart-line__title { font-weight: 600; }
.cart-line__meta { font-size: 13px; color: var(--muted); }
.cart-line__sum { flex: none; width: 80px; text-align: right; font-weight: 600; white-space: nowrap; }

.stepper { flex: none; display: flex; align-items: center; background: #fff; border: 1px solid #dcdcdc; }
.stepper__btn {
  width: 44px; height: 44px; border: 0; background: #fff; cursor: pointer;
  font-family: inherit; font-size: 20px; line-height: 1; color: var(--ink);
}
.stepper__btn:hover { background: #ececec; }
.stepper__qty { width: 36px; text-align: center; font-weight: 600; }

.cart-totals { margin: 0; padding-top: 14px; }
.cart-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cart-totals dt, .cart-totals dd { margin: 0; }
.cart-totals dd { white-space: nowrap; }
.cart-totals > div:not(.cart-totals__total) { font-size: 14px; color: var(--muted); }
.cart-totals__total { padding-top: 10px; margin-top: 8px; border-top: 2px solid var(--ink); }
.cart-totals__total dt { font-weight: 600; }
.cart-totals__total dd { font-size: 22px; font-weight: 700; letter-spacing: -.8px; }
.cart-note { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.5; }
.cart-note--left { text-align: left; font-size: 12px; }

.order-form__contact { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.order-form__contact h3 { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.input {
  height: 46px; border: 1px solid #cfcfcf; padding: 0 14px; width: 100%;
  font-family: inherit; font-size: 15px; font-weight: 400; background: #fff; color: var(--ink);
  border-radius: 0;
}
.input--area { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.is-invalid .input { border-color: var(--danger); }
.req { color: var(--req); font-weight: 700; }
.field__error { font-size: 12px; font-weight: 500; color: var(--danger); }

.consent {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  font-size: 13px; color: #4a4a4a; line-height: 1.5;
}
.consent input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--gold); }
.consent.is-invalid { color: var(--danger); }

.alert { background: var(--danger-bg); color: var(--danger); padding: 12px 14px; font-size: 14px; font-weight: 500; }

/* Honeypot */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Danke ---------- */
.thanks {
  background: var(--soft); padding: clamp(24px, 4vw, 48px);
  display: flex; flex-direction: column; gap: 14px; align-items: flex-start; max-width: 720px;
}
.thanks__icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.thanks__title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.85px; line-height: 1.3; }
.thanks p { margin: 0; }
.thanks__lines { margin: 0; padding: 0 0 0 18px; color: #4a4a4a; }

/* ---------- Rechtstexte / 404 ---------- */
.legal h2 { margin: 36px 0 10px; font-size: 19px; font-weight: 600; letter-spacing: -.4px; line-height: 1.4; }
.legal p, .legal ul { margin: 0 0 14px; color: #3a3a3a; }
.legal ul { padding-left: 20px; }
.legal__facts { display: grid; grid-template-columns: minmax(150px, 240px) 1fr; gap: 6px 24px; margin: 0 0 14px; }
.legal__facts dt { font-weight: 600; }
.legal__facts dd { margin: 0; color: #3a3a3a; }
@media (max-width: 560px) {
  .legal__facts { grid-template-columns: 1fr; gap: 0; }
  .legal__facts dd { margin-bottom: 10px; }
}

.ph { background: #fff3a8; color: #5c4a00; padding: 0 4px; border-radius: 2px; font-style: normal; }

.section--notfound { min-height: 50vh; }
.notfound__code { margin: 0 0 8px; font-size: 96px; font-weight: 700; letter-spacing: -4px; line-height: 1; color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #c9c9c9; padding: 48px var(--gutter) 40px; font-size: 13px; line-height: 1.8; }
.site-footer__grid {
  max-width: 1180px; margin: 0 auto; display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.site-footer img { width: 160px; height: auto; display: block; }
.site-footer h2 { margin: 0 0 22px; font-size: 20px; font-weight: 400; color: #fff; line-height: 1.3; }
.site-footer p { margin: 0; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { display: flex; gap: 12px; align-items: center; }
.site-footer a { color: #c9c9c9; text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ---------- Mobil ---------- */
@media (max-width: 700px) {
  html { scroll-padding-top: 110px; }
  .site-header { padding-left: 16px; min-height: 0; }
  .site-nav { display: contents; }
  .site-header__logo { order: 1; padding: 6px 0; }
  .site-header__logo img { width: 116px; }
  .site-nav__cart { order: 2; margin-left: auto; border-left: 0; padding: 0 16px; }
  .site-nav__links {
    order: 3; width: 100%; justify-content: space-between; gap: 8px;
    padding: 0 16px 0 0; border-top: 1px solid rgba(255, 255, 255, .12);
  }
  .site-nav__links a { padding: 8px 0; }
}

@media (max-width: 560px) {
  .product { padding: 22px 0 0 20px; }
  .order-form__cart { padding: 18px; }
  .cart-line { flex-wrap: wrap; gap: 10px 12px; }
  .cart-line__name { flex-basis: calc(100% - 90px); }
  .cart-line__sum { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

.legal__trades { margin: 0; padding-left: 18px; }
.legal__trades li { margin-bottom: 6px; }

.legal h3 { margin: 24px 0 8px; font-size: 16px; font-weight: 600; }
.legal__address { padding-left: 18px; border-left: 2px solid var(--gold); }
.legal__form { border: 1px solid #cfcfcf; padding: 18px 22px; margin: 0 0 14px; background: var(--soft); }
.legal__form p { margin: 0 0 18px; }
.legal__form-note { margin: 0 !important; font-size: 13px; color: var(--muted); }

/* ---------- Header-Animationen ---------- */
.site-header {
  transition: min-height .25s ease, box-shadow .25s ease;
  animation: header-in .55s cubic-bezier(.2, .7, .2, 1) both;
}
.site-header.is-scrolled { min-height: 56px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }

.site-header__logo img { transition: width .25s ease, transform .25s ease; }
.site-header__logo:hover img { transform: scale(1.04); }
.site-header.is-scrolled .site-header__logo img { width: 110px; }

/* Links: goldene Linie wächst beim Hover von links nach rechts */
.site-nav__links a { position: relative; transition: color .2s ease; }
.site-nav__links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px;
  background: var(--gold-light); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.site-nav__links a:hover::after,
.site-nav__links a:focus-visible::after { transform: scaleX(1); }

/* Links erscheinen nacheinander */
.site-nav__links a { animation: nav-in .5s ease both; }
.site-nav__links a:nth-child(1) { animation-delay: .15s; }
.site-nav__links a:nth-child(2) { animation-delay: .22s; }
.site-nav__links a:nth-child(3) { animation-delay: .29s; }
.site-nav__links a:nth-child(4) { animation-delay: .36s; }

/* Warenkorb: Icon kippt leicht beim Hover, Zähler „poppt“ bei Änderung */
.site-nav__cart svg { transition: transform .25s ease; }
.site-nav__cart:hover svg { transform: rotate(-12deg) scale(1.1); }
.badge.bump { animation: badge-pop .4s ease; }

@keyframes header-in { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nav-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes badge-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

@media (max-width: 700px) {
  .site-header.is-scrolled .site-header__logo img { width: 96px; }
  .site-nav__links a::after { bottom: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .site-nav__links a, .badge.bump { animation: none; }
  .site-header, .site-header__logo img, .site-nav__links a::after, .site-nav__cart svg { transition: none; }
}

/* ---------- Hero-Animation ---------- */
.hero::before { animation: hero-bg 1.6s ease-out both, hero-drift 22s ease-in-out 1.6s infinite alternate; }
.hero h1 img { animation: hero-logo 1.1s cubic-bezier(.2, .7, .2, 1) .25s both; will-change: transform; }

@keyframes hero-bg { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1); } }
@keyframes hero-drift { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes hero-logo { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero h1 img { animation: none; }
}

/* ---------- Produkt-Animationen ---------- */
.product {
  position: relative;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease;
}
.product:hover { transform: translateY(-6px); box-shadow: 0 14px 28px rgba(0, 0, 0, .12); }

/* Packung neigt sich beim Hover leicht und hebt ab */
.product__img {
  transform-origin: 50% 100%;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.product:hover .product__img { transform: translateY(-8px) rotate(-3deg) scale(1.04); }

/* Einblenden beim Scrollen (Klassen setzt products.js) */
.product.is-reveal:not(.is-visible) { opacity: 0; }
.product.is-visible { animation: product-in .7s cubic-bezier(.2, .7, .2, 1) calc(var(--i, 0) * 90ms) backwards; }
.product.is-visible .product__img { animation: product-img-in .8s cubic-bezier(.2, .7, .2, 1) calc(var(--i, 0) * 90ms + 200ms) backwards; }

@keyframes product-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes product-img-in { from { opacity: 0; transform: translateY(24px) rotate(4deg); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .product, .product__img { transition: none; }
  .product:hover, .product:hover .product__img { transform: none; }
  .product.is-visible, .product.is-visible .product__img { animation: none; }
}
