/* =========================================================================
   BÜCKWARE – STYLE (Layer-Look: Grün vorne, Rot + Indigo/Lila als Schatten)
   Farben & Font kommen als CSS-Variablen aus js/app.js (aus CONFIG).
   ========================================================================= */

/* ---- Kirilir-Font ---------------------------------------------------- */
@font-face {
  font-family: "Kirilir";
  src: url("../fonts/Kirilir.woff2") format("woff2"),
       url("../fonts/Kirilir.otf")   format("opentype"),
       url("../fonts/Kirilir.ttf")   format("truetype");
  font-weight: normal; font-style: normal; font-display: swap;
}

/* ---- Variablen ------------------------------------------------------- */
:root {
  --green: #39b54a;   /* Vordergrund / Hauptfarbe / Hover */
  --red: #ff0000;     /* Schatten 1 */
  --indigo: #2e3192;  /* Schatten 2 */
  --lila: #662d91;    /* Akzent / 3. Rahmenfarbe */
  --paper: #ffffff;
  --placeholder: #e6e6e6;
  --text: #141414;
  --tx-gray: #cfcfcf;   /* hellgrauer Versatz-Schatten unter schwarzem Text */

  --font-display: "Kirilir", "Space Mono", "Arial Black", system-ui, sans-serif;
  --font-body: system-ui, "Helvetica Neue", Arial, sans-serif;

  /* Layer-Offset-Schatten */
  --sh-btn:  3px 3px 0 var(--red), 5px 5px 0 var(--indigo);
  --sh-tile: 7px 7px 0 var(--red), 14px 14px 0 var(--indigo);

  --maxw: 640px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body); color: var(--text);
  background: #f2f2f0; line-height: 1.5; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ---- Text-Behandlung ------------------------------------------------
   .tx-layer  = Menütitel & Co: grün mit rot/indigo Versatz (gelayerd)
   .tx-shadow = schwarz mit hellgrauem Versatz-Schatten drunter
   (beide nutzen die Display-Font = Kirilir, sobald die Datei da ist) */
.tx-layer {
  font-family: var(--font-display); color: var(--green);
  text-shadow: 2px 2px 0 var(--red), 4px 4px 0 var(--indigo);
}
.tx-shadow {
  font-family: var(--font-display); color: #000;
  text-shadow: 2px 2px 0 var(--tx-gray);
}

/* ---- Rahmen (offen, weiß) ------------------------------------------- */
.frame { max-width: var(--maxw); margin: 0 auto; padding: 10px; min-height: 100vh; }
.frame-inner {
  background: var(--paper); min-height: calc(100vh - 20px);
  display: flex; flex-direction: column;
  border-top: 4px solid var(--green);
}

/* ---- Layer-Button (Basis für Nav/Footer/Größen/Warenkorb) ----------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-display); font-size: 15px; letter-spacing: .02em;
  color: #000; background: var(--paper);
  border: 2px solid var(--green);
  padding: 9px 16px; border-radius: 999px;
  box-shadow: var(--sh-btn);
  transition: background .12s, color .12s, box-shadow .12s, transform .05s;
}
.btn:hover { background: var(--green); color: #fff; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--indigo); }

/* ---- Topbar ---------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 6px;
}
.topbar .brandmark { width: 30px; color: var(--green); }
.topbar .brandmark svg { width: 100%; height: auto; }
.topbar .back {
  font-family: var(--font-display); font-size: 14px; color: var(--indigo);
}
.cart-btn { /* nutzt .btn-Style zusätzlich, siehe HTML */ }
.cart-btn .count {
  background: var(--green); color: #fff;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
}

/* ---- Header / Wordmark ---------------------------------------------- */
.site-header { padding: 14px 20px 6px; text-align: center; }
.site-header .wordmark { width: min(80%, 420px); margin: 0 auto; }
.site-header .wordmark svg { width: 100%; height: auto; }
.site-header .tagline {
  font-family: var(--font-display); font-size: 13px; letter-spacing: .03em;
  color: #000; text-shadow: 2px 2px 0 var(--tx-gray); margin-top: 8px;
}
.shipnote { text-align: center; font-size: 12px; opacity: .6; padding: 0 20px; }

/* ---- Nav-Button-Reihe ------------------------------------------------ */
.navrow {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  padding: 16px 20px 22px;
}

/* ---- Produktliste: große Einzelkacheln, alternierend versetzt ------- */
.product-grid {
  display: flex; flex-direction: column; gap: 34px;
  padding: 6px 22px 30px; flex: 1;
}
.card { display: block; color: inherit; width: 84%; }
.card:nth-child(odd)  { align-self: flex-start; }
.card:nth-child(even) { align-self: flex-end; }
.card .thumb {
  position: relative; aspect-ratio: 1 / 1; background: var(--placeholder);
  box-shadow: var(--sh-tile);
}
.card .thumb .art {
  position: relative; z-index: 1; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--placeholder); overflow: hidden;
}
.card .thumb .art img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .art .ph { width: 78%; height: 78%; color: var(--green); }
.card .thumb .art .ph svg { width: 100%; height: 100%; }
.card.soldout .thumb .art { filter: grayscale(1); opacity: .7; }
.card .badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--green); color: #fff; font-family: var(--font-display);
  font-size: 12px; padding: 4px 10px; letter-spacing: .04em;
}
.card .meta {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 2px 0; gap: 8px;
}
.card .meta .name { font-family: var(--font-display); font-size: 18px; color: #000; text-shadow: 2px 2px 0 var(--tx-gray); }
.card .meta .price { font-size: 15px; white-space: nowrap; }

/* ---- Produktseite ---------------------------------------------------- */
.product { padding: 10px 22px 30px; flex: 1; display: grid; gap: 20px; }
.gallery .main {
  position: relative; aspect-ratio: 1 / 1; background: var(--placeholder);
  box-shadow: var(--sh-tile);
}
.gallery .main .art {
  position: relative; z-index: 1; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gallery .main .art img { width: 100%; height: 100%; object-fit: cover; }
.gallery .main .art .ph { width: 76%; height: 76%; color: var(--green); }
.gallery .thumbs { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.gallery .thumbs .t {
  width: 58px; height: 58px; background: var(--placeholder);
  border: 2px solid transparent; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.gallery .thumbs .t.active { border-color: var(--green); }
.gallery .thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs .t .ph { width: 68%; color: var(--green); }

.p-info h1 { font-family: var(--font-display); font-size: 28px; color: var(--green); text-shadow: 2px 2px 0 var(--red), 4px 4px 0 var(--indigo); }
.p-info .p-price { font-size: 19px; margin: 4px 0 16px; }
.p-info .p-desc { font-size: 14px; margin-bottom: 20px; white-space: pre-line; }

.sizes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.sizes .size {
  min-width: 46px; padding: 8px 12px;
  font-family: var(--font-display); color: var(--indigo);
  background: var(--paper); border: 2px solid var(--green); border-radius: 999px;
  box-shadow: var(--sh-btn); transition: background .12s, color .12s;
}
.sizes .size:hover { background: var(--green); color: #fff; }
.sizes .size.active { background: var(--green); color: #fff; }

.buy {
  width: 100%; padding: 15px; font-family: var(--font-display);
  font-size: 18px; letter-spacing: .03em; color: #fff;
  background: var(--green); border: 2px solid var(--green); border-radius: 999px;
  box-shadow: var(--sh-btn); transition: transform .05s, box-shadow .12s, background .12s;
}
.buy:hover { background: #2e9c3e; }
.buy:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--indigo); }
.buy[disabled] {
  background: var(--placeholder); border-color: var(--placeholder);
  color: #888; box-shadow: none; cursor: not-allowed;
}
.preorder-hint { font-size: 12px; opacity: .7; margin-top: 12px; text-align: center; }

/* ---- Textseiten: dünner Tricolor-Rahmen (grün/rot/lila) ------------- */
.textpage { padding: 16px 22px 34px; flex: 1; }
.textpage .box {
  max-width: 520px; margin: 0 auto; background: var(--paper);
  border: 2px solid var(--green);
  box-shadow: 5px 5px 0 var(--red), 10px 10px 0 var(--lila);
  padding: 22px 22px 24px;
}
.textpage h1 { font-family: var(--font-display); color: var(--green); text-shadow: 2px 2px 0 var(--red), 4px 4px 0 var(--indigo); font-size: 26px; margin-bottom: 14px; }
.textpage p { margin-bottom: 12px; font-size: 14px; }
.textpage a { color: var(--green); text-decoration: underline; }

/* ---- Footer ---------------------------------------------------------- */
.site-footer {
  padding: 22px 20px 26px; display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center; align-items: center;
}
.site-footer .foot-mark { width: 100%; text-align: center; margin-top: 14px; }
.site-footer .foot-mark svg { width: 38px; height: auto; color: var(--green); margin: 0 auto; }

/* ---- Warenkorb-Drawer (Platzhalter) --------------------------------- */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(360px, 88vw);
  background: var(--paper); border-left: 3px solid var(--green);
  transform: translateX(100%); transition: transform .25s ease; z-index: 50;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer .c-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--placeholder);
  font-family: var(--font-display); color: var(--green); text-shadow: 2px 2px 0 var(--red), 4px 4px 0 var(--indigo); font-size: 18px;
}
.cart-drawer .c-head .close { font-size: 22px; color: var(--green); line-height: 1; }
.cart-drawer .c-body { flex: 1; overflow-y: auto; padding: 8px 16px; }
.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--placeholder); }
.cart-line .ci-thumb {
  width: 56px; height: 56px; background: var(--placeholder); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.cart-line .ci-thumb .ph { width: 70%; color: var(--green); }
.cart-line .ci-info { flex: 1; font-size: 13px; }
.cart-line .ci-info .n { font-family: var(--font-display); color: var(--indigo); }
.cart-line .ci-info .s { opacity: .6; }
.cart-line .ci-price { font-size: 13px; white-space: nowrap; }
.cart-drawer .c-foot { padding: 14px 16px; border-top: 1px solid var(--placeholder); }
.cart-drawer .c-foot .sum {
  display: flex; justify-content: space-between;
  font-family: var(--font-display); color: var(--indigo); margin-bottom: 12px;
}
.cart-drawer .c-foot .checkout {
  width: 100%; padding: 13px; background: var(--green); color: #fff;
  font-family: var(--font-display); font-size: 16px; border-radius: 999px;
}
.cart-drawer .c-note { font-size: 11px; opacity: .6; text-align: center; margin-top: 10px; }
.cart-empty { padding: 40px 10px; text-align: center; opacity: .6; font-size: 14px; }

.hidden { display: none !important; }
