/* KJ Verleihplattform – Design. Farben zentral als Variablen, damit sie leicht änderbar bleiben. */
:root {
  --brand: #c50346;
  --brand-dark: #98022f;
  --brand-soft: #fdeef3;
  --ink: #1f2430;
  --muted: #667085;
  --line: #e7e9ee;
  --bg: #f6f6f8;
  --card: #ffffff;
  --ok: #1a7f4b;
  --warn: #b25e09;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);
  --bs-primary: var(--brand);
  --bs-primary-rgb: 197,3,70;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 197,3,70;
  --bs-link-hover-color-rgb: 152,2,47;
  --bs-link-hover-color: var(--brand-dark);
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
}
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5 { letter-spacing: -.01em; font-weight: 700; }
.btn { border-radius: 10px; font-weight: 600; padding: .55rem 1rem; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); }
.form-control, .form-select { border-radius: 10px; border-color: #d5d8df; padding: .6rem .8rem; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(197,3,70,.15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.card-soft { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.text-brand { color: var(--brand) !important; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 2000; }
.skip-link:focus { left: .5rem; top: .5rem; }
:focus-visible { outline: 3px solid rgba(197,3,70,.45); outline-offset: 2px; }

/* ---------- Kopf / Fuß ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header .brand-logo { height: 44px; width: auto; }
.site-header .title { line-height: 1.15; }
.site-header .title small { color: var(--muted); font-size: .8rem; }
.site-footer { margin-top: 4rem; padding: 2rem 0 5.5rem; color: var(--muted); font-size: .88rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.site-footer img { height: 26px; width: auto; opacity: .85; }

/* ---------- Hero / Suche ---------- */
.hero { background: linear-gradient(135deg, var(--brand) 0%, #e0245f 100%); color: #fff; padding: 2.2rem 0 4.2rem; }
.hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); margin-bottom: .35rem; }
.hero p { opacity: .92; margin-bottom: 0; max-width: 46rem; }
.search-wrap { margin-top: -2.6rem; }
.search-box { display: flex; align-items: center; gap: .6rem; background: #fff; border-radius: 16px; padding: .35rem .5rem .35rem 1rem;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.search-box i { color: var(--muted); font-size: 1.15rem; }
.search-box input { border: 0; box-shadow: none; font-size: 1.1rem; padding: .8rem .25rem; background: transparent !important; }
.search-box input:focus { box-shadow: none; }
.search-box .clear { border: 0; background: none; color: var(--muted); font-size: 1.2rem; display: none; padding: .25rem .5rem; }
.search-box.has-text .clear { display: block; }
.search-hint { color: var(--muted); font-size: .85rem; margin-top: .55rem; }

/* ---------- Filter ---------- */
.period-card { padding: 1rem 1.1rem; margin-top: 1.1rem; }
.period-card label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: .25rem .1rem .6rem; scrollbar-width: thin; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: .38rem .9rem;
  font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: .12s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip i { margin-right: .25rem; }
.filter-label { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: .8rem 0 .15rem; }

/* ---------- Katalog ---------- */
.cat-title { display: flex; align-items: baseline; gap: .6rem; margin: 2rem 0 .8rem; font-size: 1.25rem; }
.cat-title .count { font-size: .85rem; color: var(--muted); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1rem; }
.item-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s, border-color .12s; }
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.item-card.in-cart { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(197,3,70,.18), var(--shadow); }
.item-card.unavailable { opacity: .62; }
.item-photo { position: relative; aspect-ratio: 4/3; background: #f0f1f4; display: block; width: 100%; border: 0; padding: 0; cursor: zoom-in; overflow: hidden; }
.item-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.item-photo .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #b4b9c4; font-size: 2.4rem; }
.item-photo .photo-count { position: absolute; right: .5rem; bottom: .5rem; background: rgba(16,24,40,.72); color: #fff;
  border-radius: 999px; font-size: .75rem; padding: .15rem .55rem; }
.item-body { padding: .8rem .9rem .35rem; flex: 1; }
.item-name { font-weight: 700; font-size: .98rem; line-height: 1.25; margin-bottom: .25rem; word-break: break-word; }
.item-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .35rem; }
.badge-soft { background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; font-size: .72rem; font-weight: 700; padding: .2rem .55rem; }
.badge-soft.loc { background: #eef2ff; color: #3b49a8; }
.badge-soft.tag { background: #f1f2f5; color: #4a5160; }
.item-desc { color: var(--muted); font-size: .84rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-foot { padding: .6rem .9rem .9rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stock { font-size: .8rem; font-weight: 600; color: var(--ok); }
.stock.none { color: var(--brand); }
.stock.low { color: var(--warn); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--brand); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; background: #fff; color: var(--brand); width: 34px; height: 34px; font-size: 1.1rem; font-weight: 700; line-height: 1; }
.stepper button:hover:not(:disabled) { background: var(--brand-soft); }
.stepper button:disabled { color: #c3c7d0; }
.stepper .n { min-width: 2.1rem; text-align: center; font-weight: 700; }
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2.6rem; color: #c7cbd5; }
.results-info { color: var(--muted); font-size: .9rem; margin: 1.1rem 0 -.6rem; }
#catalog.loading { opacity: .5; transition: opacity .15s; }

/* ---------- Warenkorb-Leiste ---------- */
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(16,24,40,.08); transform: translateY(110%); transition: transform .2s; }
.cart-bar.show { transform: none; }
.cart-bar .inner { max-width: 1140px; margin: auto; display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
.cart-count { background: var(--brand); color: #fff; font-weight: 700; border-radius: 999px; min-width: 1.7rem; height: 1.7rem; display: inline-grid; place-items: center; padding: 0 .5rem; }
.cart-line { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .nm { font-weight: 600; min-width: 0; word-break: break-word; }
.cart-line .avail { font-size: .78rem; color: var(--muted); }

/* ---------- Modal Galerie ---------- */
.gallery-main { aspect-ratio: 4/3; background: #f0f1f4; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #f0f1f4; }
.gallery-thumbs { display: flex; gap: .45rem; margin-top: .55rem; overflow-x: auto; }
.gallery-thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; width: 68px; height: 52px; flex: 0 0 auto; background: #f0f1f4; }
.gallery-thumbs button.active { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); }
.pre-wrap { white-space: pre-wrap; }

/* ---------- Seiten ---------- */
.page-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.success-badge { width: 72px; height: 72px; border-radius: 50%; background: #e7f6ee; color: var(--ok); display: grid; place-items: center; font-size: 2.2rem; margin: 0 auto 1rem; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-nav { background: #1b1e29; color: #c9cdd8; padding: 1.2rem .9rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-nav .logo { background: #fff; border-radius: 10px; padding: .55rem .7rem; margin-bottom: 1.2rem; display: block; }
.admin-nav .logo img { width: 100%; height: auto; display: block; }
.admin-nav a.nav-link { color: #c9cdd8; border-radius: 10px; padding: .6rem .8rem; display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .94rem; }
.admin-nav button.nav-link { color: #c9cdd8; border-radius: 10px; padding: .6rem .8rem; display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .94rem; }
.admin-nav button.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a.nav-link.active { background: var(--brand); color: #fff; }
.admin-nav .section { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; color: #7e8496; margin: 1.1rem .8rem .35rem; font-weight: 700; }
.admin-nav .badge-count { margin-left: auto; background: #fff; color: var(--brand); border-radius: 999px; font-size: .72rem; padding: .1rem .5rem; }
.admin-main { padding: 1.6rem 1.8rem 3rem; min-width: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.3rem; }
.admin-top h1 { font-size: 1.55rem; margin: 0; }
.stat { padding: 1rem 1.1rem; }
.stat .v { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat .l { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.table > :not(caption) > * > * { padding: .7rem .8rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafafb; border-bottom: 1px solid var(--line); }
.thumb { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; background: #f0f1f4; display: block; }
.thumb-ph { width: 52px; height: 40px; border-radius: 8px; background: #f0f1f4; display: grid; place-items: center; color: #b4b9c4; }
.status { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; font-weight: 700; }
.status.offen { background: #fff3e0; color: #b25e09; }
.status.genehmigt { background: #e7f6ee; color: var(--ok); }
.status.abgelehnt { background: #fdeaea; color: #b42318; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.photo-tile { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.photo-tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photo-tile .cover { position: absolute; left: .4rem; top: .4rem; }
.photo-tile .acts { display: flex; gap: .3rem; padding: .4rem; }
.photo-tile .acts form { flex: 1; }
.photo-tile .acts .btn { width: 100%; padding: .25rem .4rem; font-size: .78rem; }
.dropzone { border: 2px dashed #cfd3dc; border-radius: 12px; padding: 1.2rem; text-align: center; color: var(--muted); background: #fafafb; }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.preview-strip { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; justify-content: center; }
.preview-strip img { width: 76px; height: 58px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.admin-toggle { display: none; }

@media (max-width: 991px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; height: auto; display: none; }
  .admin-nav.open { display: block; }
  .admin-toggle { display: inline-flex; }
  .admin-main { padding: 1rem; }
  .site-header .brand-logo { height: 36px; }
}
@media (max-width: 575px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .item-foot { flex-direction: column; align-items: stretch; }
  .item-foot .stepper, .item-foot .btn { width: 100%; justify-content: space-between; }
  .item-name { font-size: .92rem; }
  .hero { padding-bottom: 3.6rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Sammelaktionen ---------- */
.bulk-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .8rem 1rem; background: #fff;
  border-top: 2px solid var(--brand); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 18px rgba(16,24,40,.08); }
.bulk-bar.d-none { display: none !important; }

/* ---------- RhekTec-Hinweis ---------- */
.topbar { background: #1b1e29; color: #9aa0b4; font-size: .74rem; letter-spacing: .02em; padding: .3rem 0; }
.topbar a { color: #fff; font-weight: 700; text-decoration: none; }
.topbar a:hover { color: #ff6b97; }
.nav-credit { margin: 1.4rem .8rem 0; font-size: .72rem; color: #7e8496; }
.nav-credit a { color: #c9cdd8; font-weight: 700; text-decoration: none; }
.nav-credit a:hover { color: #fff; }
