/* ============================================
   nas-depot.at – zentrales Stylesheet
   ============================================ */

/* --- Fonts (selbst gehostet, kein Google-Fonts-Cookie-Problem) --- */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-v20-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-v20-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('/fonts/open-sans-v44-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('/fonts/open-sans-v44-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* --- Grundfarben & Variablen (einmal ändern, überall wirksam) --- */
:root {
  --gruen: #7CB342;          /* HIER ÄNDERN: exakten Grünton aus Photoshop-Logo eintragen */
  --gruen-dunkel: #689F38;
  --dunkel: #1a1a1a;
  --grau-hell: #f4f4f4;
  --grau-mittel: #888;
  --grau-rand: #ddd;
  --schrift-h: 'IBM Plex Mono', monospace;
  --schrift-text: 'Open Sans', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--schrift-text);
  color: #222;
  background: #fff;
}

h1, h2, h3 {
  font-family: var(--schrift-h);
  margin: 0 0 0.5em;
}

a { color: inherit; text-decoration: none; }

/* ============================================
   LAYOUT: Kopfleiste, Sidebar, Content, Footer
   ============================================ */

.seiten-rahmen {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "kopf kopf"
    "sidebar content"
    "footer footer";
  min-height: 100vh;
}

/* --- Kopfleiste --- */
header.kopfleiste {
  grid-area: kopf;
  background: var(--dunkel);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo img {
  height: 40px;
  display: block;
}

.filter-sortierung {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.filter-sortierung select {
  font-family: var(--schrift-text);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  border: none;
}

/* --- Kopf-Taglines: Deutsch beim Logo, Englisch beim Filter -> Sortieren-Dropdown
   bleibt dadurch mittig zwischen Logo (links) und "Wir kaufen an!"-Button (rechts). --- */
.kopf-tagline {
  font-family: var(--schrift-h);
  font-size: 0.9rem;
  color: #999;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.kopf-spacer {
  flex: 1;
}

@media (max-width: 900px) {
  .kopf-tagline,
  .kopf-spacer {
    display: none;
  }
}

.ankauf-banner {
  background: var(--gruen);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.ankauf-banner:hover {
  background: var(--gruen-dunkel);
}

/* --- Sidebar (Kategorien) --- */
nav.sidebar {
  grid-area: sidebar;
  background: var(--grau-hell);
  padding: 1.5rem 1rem;
}

.kategorie-liste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kategorie-liste li { margin-bottom: 0.4rem; }

.kategorie-liste a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.kategorie-liste a:hover {
  background: #e2e2e2;
}

.kategorie-liste a.aktiv {
  background: var(--gruen);
  color: #fff;
}

.kategorie-liste li.ankauf-link,
.kategorie-liste li.sidebar-trenner {
  margin-top: 1.5rem;
  border-top: 1px solid var(--grau-rand);
  padding-top: 1rem;
}

.filter-ueberschrift {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grau-mittel);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 1rem 0 0.4rem;
}

.filter-ueberschrift:first-of-type {
  margin-top: 1rem;
}

/* --- Content-Bereich --- */
main.content-bereich {
  grid-area: content;
  padding: 1.5rem;
}

/* --- Produkt-Grid --- */
.produkt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.produkt-kachel {
  border: 1px solid var(--grau-rand);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease;
}
.produkt-kachel:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.produkt-kachel img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin-bottom: 0.75rem;
  background: #fff;
}

.produkt-kachel h2 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.preis-kachel {
  font-family: var(--schrift-h);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gruen-dunkel);
  margin: 0 0 0.5rem;
}

.produkt-kachel .kurzbeschreibung {
  font-size: 0.85rem;
  color: #444;
  flex-grow: 1;
  margin-bottom: 0.75rem;
}

.kachel-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--gruen);
  background: #fff;
  color: var(--gruen-dunkel);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--gruen);
  color: #fff;
}

.btn-anfragen {
  background: var(--gruen);
  color: #fff;
}
.btn-anfragen:hover {
  background: var(--gruen-dunkel);
}

/* --- Verkauft-Badge --- */
.badge-verkauft {
  position: relative;
}
.badge-verkauft::after {
  content: "VERKAUFT";
  position: absolute;
  top: 1rem;
  right: -0.5rem;
  background: var(--dunkel);
  color: #fff;
  font-family: var(--schrift-h);
  font-size: 0.7rem;
  padding: 0.3rem 1rem;
  transform: rotate(8deg);
  border-radius: 3px;
  opacity: 0.9;
}

/* --- Produkt-Detailseite (Bilder + Beschreibung) --- */
.produkt-bilder {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.produkt-bilder img {
  cursor: zoom-in;
  border: 1px solid var(--grau-rand);
  border-radius: 6px;
}
.bild-hauptansicht { width: 320px; height: 320px; object-fit: contain; }
.bild-thumbnail { width: 140px; height: 140px; object-fit: contain; }

.preis {
  font-family: var(--schrift-h);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gruen-dunkel);
}

.produkt-beschreibung ul { padding-left: 1.2rem; }
.produkt-beschreibung li { margin-bottom: 0.3rem; }

.buttons { margin-top: 1.5rem; display: flex; gap: 0.75rem; }

/* --- "Nur für den Ausdruck"-Text (z.B. "Dieses Angebot ist freibleibend...") ---
 * Die Basis-Versteck-Regel stand bisher nur in einem <style>-Block im <head> jeder
 * einzelnen Produktseite. Bei einem direkten Seitenaufruf/Reload wird der <head> normal
 * geparst, die Regel greift. Bei Klick-Navigation über ladeInhalt() (AJAX) wird aber NUR
 * der Inhalt von #produkt-content übernommen, der <head> der Zielseite (und damit diese
 * Regel) komplett verworfen - der Text blieb dann fälschlich sichtbar. Zentral hier
 * verankert, damit sie bei jeder Navigationsart konsistent gilt. Der @media-print-
 * Override weiter unten in dieser Datei macht den Text weiterhin beim Drucken sichtbar. */
.nur-print { display: none; }

.zubehoer-hinweis {
  margin-top: 0.75rem;
}
.zubehoer-hinweis a {
  color: var(--gruen-dunkel);
  font-weight: 600;
}

.refurbished-hinweis {
  margin-top: 0.5rem;
  color: #222;
}

/* --- QNAP Migrations-Kompatibilitätstool (FAQ-Seite) --- */
.migrations-tool {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--grau-hell);
  border-left: 4px solid var(--gruen);
  border-radius: 4px;
}

.migrations-tool-felder {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.migrations-tool-feld {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.migrations-tool-feld label {
  font-weight: 600;
  font-size: 0.85rem;
}

.migrations-tool-feld select {
  font-family: var(--schrift-text);
  padding: 0.5rem;
  border: 1px solid var(--grau-rand);
  border-radius: 4px;
  font-size: 0.95rem;
  min-width: 220px;
}

.migration-ergebnis {
  margin-top: 1rem;
  font-weight: 600;
}

.migration-ergebnis.migration-ok {
  color: var(--gruen-dunkel);
}

.migration-ergebnis.migration-nicht-ok {
  color: #c0392b;
}

@media (max-width: 768px) {
  .migrations-tool-feld select {
    min-width: 0;
    width: 100%;
  }
}

/* --- Footer 1: Hotline + Links --- */
footer.footer-haupt {
  grid-area: footer;
}

.footer-hotline-links {
  background: var(--grau-hell);
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  border-top: 3px solid var(--gruen);
}

.footer-hotline h3 {
  color: var(--gruen-dunkel);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.footer-hotline p { margin: 0.2rem 0; font-size: 0.9rem; }
.footer-hotline .telefon { font-weight: 700; color: #c0392b; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
  align-content: flex-start;
}
.footer-links a:hover { color: var(--gruen-dunkel); }

/* --- Footer 2: Diff.-Best.-Hinweis --- */
.footer-rechtshinweis {
  background: var(--dunkel);
  color: #aaa;
  text-align: center;
  font-size: 0.75rem;
  padding: 0.5rem;
}

/* --- Scroll-nach-oben-Pfeil --- */
#scroll-oben {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--gruen);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: background 0.15s ease;
}
#scroll-oben:hover { background: var(--gruen-dunkel); }
#scroll-oben.sichtbar { display: block; }

/* --- Rechtstext-Seiten (AGB, Widerruf, Impressum) --- */
.rechtstext {
  max-width: 800px;
  line-height: 1.6;
}
.rechtstext h2 {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  color: var(--gruen-dunkel);
}
.rechtstext p { margin: 0.5rem 0; }

.impressum-kontaktbox {
  background: var(--grau-hell);
  border-left: 4px solid var(--gruen);
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
  border-radius: 4px;
}
.impressum-kontaktbox h2 {
  margin-top: 0;
  color: var(--gruen-dunkel);
  font-size: 1rem;
}
.impressum-kontaktbox p { margin: 0.2rem 0; }
.impressum-kontaktbox .telefon { font-weight: 700; color: #c0392b; }

/* --- Ankauf-Seite / Formular --- */
.ankauf-seite {
  max-width: 700px;
}

/* --- Zubehör-Seite: eigene Klasse statt .ankauf-seite, damit das Produktgrid
   die volle Breite nutzt (nicht auf 700px wie beim Ankauf-Formular begrenzt),
   während der einleitende Fließtext trotzdem angenehm lesbar bleibt. --- */
.zubehoer-seite > p {
  max-width: 700px;
}

.ankauf-formular {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
}
.ankauf-formular label {
  font-weight: 600;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.ankauf-formular input,
.ankauf-formular select,
.ankauf-formular textarea {
  font-family: var(--schrift-text);
  padding: 0.5rem;
  border: 1px solid var(--grau-rand);
  border-radius: 4px;
  font-size: 0.95rem;
}
.ankauf-formular button {
  margin-top: 1rem;
  align-self: flex-start;
}

/* Antispam-Feld: für Menschen unsichtbar, aber für Screenreader/Bots im DOM vorhanden */
.antispam-feld {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Leerer Zustand (Filter ohne Treffer) --- */
.leer-hinweis {
  color: var(--grau-mittel);
  font-style: italic;
  padding: 2rem;
  text-align: center;
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }

  .seiten-rahmen {
    grid-template-columns: 1fr;
    grid-template-areas:
      "kopf"
      "sidebar"
      "content"
      "footer";
  }

  /* --- Kopfleiste: gestapelt statt nebeneinander --- */
  header.kopfleiste {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .logo { text-align: center; }
  .filter-sortierung {
    justify-content: space-between;
    width: 100%;
  }
  .filter-sortierung select {
    flex-grow: 1;
    max-width: 60%;
  }
  .ankauf-banner {
    text-align: center;
    width: 100%;
  }

  nav.sidebar {
    padding: 0.5rem 1rem;
    overflow: hidden;
  }

  /* --- Kategorie-Leiste: horizontal scrollbar, kein Textumbruch/Schrumpfen --- */
  .kategorie-liste {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .kategorie-liste li {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .kategorie-liste a {
    white-space: nowrap;
  }
  .kategorie-liste li.ankauf-link,
  .kategorie-liste li.sidebar-trenner {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
    border-left: 1px solid var(--grau-rand);
    padding-left: 0.5rem;
  }

  .produkt-grid {
    grid-template-columns: 1fr; /* mobil immer nur eine Kachel pro Zeile */
  }

  .produkt-bilder { flex-direction: column; }
  .bild-hauptansicht, .bild-thumbnail { width: 100%; height: auto; }
}

/* ============================================
   DRUCKANSICHT
   Zentral hier statt einzeln pro Seite gepflegt.
   !important ist hier bewusst nötig: header.kopfleiste, nav.sidebar
   und footer.footer-haupt sind spezifischer als ein bloßer Tag-Selektor
   und würden ein einfaches "display:none" sonst überstimmen.
   ============================================ */
@media print {
  header.kopfleiste,
  nav.sidebar,
  footer.footer-haupt,
  #scroll-oben,
  #bild-overlay,
  .buttons,
  .druck-button {
    display: none !important;
  }

  .seiten-rahmen {
    display: block !important;
    min-height: 0 !important;
  }

  main.content-bereich {
    padding: 0 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .nur-print {
    display: block !important;
  }

  .produkt-bilder {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
  }

  .bild-hauptansicht,
  .bild-thumbnail {
    width: 140px !important;
    height: 140px !important;
    object-fit: contain !important;
  }
}
