/*
 * portal.css – Gemeinsames modernes Stylesheet für das Secondhand-Portal
 * Verwendet CSS Custom Properties, CSS Grid / Flexbox, kein Float-Layout.
 * Google Font "Inter" wird inline per @import geladen.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   Design-Token (CSS Custom Properties)
   ============================================================ */
:root {
  --color-primary:       #6c63ff;
  --color-primary-dark:  #574fd6;
  --color-accent:        #ff6584;
  --color-bg:            #f8f7fc;
  --color-surface:       #ffffff;
  --color-border:        #e2e0ef;
  --color-text:          #1e1b2e;
  --color-text-muted:    #6e6b82;
  --color-error:         #e53935;
  --color-success:       #43a047;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.10);
  --shadow-md:  0 4px 16px rgba(108,99,255,.12);
  --shadow-lg:  0 8px 32px rgba(108,99,255,.18);

  --transition: .2s ease;

  --font-base:  'Inter', system-ui, -apple-system, sans-serif;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }
a:visited { color: #9c8fe0; }

h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; color: var(--color-text); text-align: center; margin-bottom: 0.4rem; }
h1 span { font-size: .65em; font-weight: 400; color: var(--color-text-muted); display: block; }
h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: .5rem; }
h3 { font-size: 1rem; font-weight: 600; }

/* ============================================================
   Layout
   ============================================================ */
.portal-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: .75rem 1rem;
  text-align: center;
}
.portal-header img { max-height: 60px; width: auto; }

.portal-main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Zentrierter Inhaltsbereich */
.about-center {
  max-width: 760px;
  margin: 0 auto;
  font-size: .95rem;
}

/* ============================================================
   Karten / Boxen
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}
.card:hover { box-shadow: var(--shadow-md); }

.card legend,
.card__legend {
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0 .4rem;
}

fieldset.card {
  border: 1px solid var(--color-border);
}

/* ============================================================
   Formular-Elemente
   ============================================================ */
.form-group {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
  gap: .5rem 1rem;
  margin-bottom: .75rem;
}
@media (max-width: 540px) {
  .form-group { grid-template-columns: 1fr; }
}

label {
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.form-control {
  width: 100%;
  padding: .6rem .9rem;
  font-size: .9rem;
  font-family: var(--font-base);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,.15);
}
.form-control::placeholder { color: #b0adcc; }

/* Zahlen ohne Spinner */
input[type='number'] { -moz-appearance: textfield; }
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Select */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c63ff' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 12px 8px;
  padding-right: 2.2rem;
  cursor: pointer;
}

/* Textarea */
textarea.form-control { min-height: 120px; resize: vertical; }

/* ============================================================
   Schaltflächen
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.4rem;
  font-size: .9rem;
  font-family: var(--font-base);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  padding: 0;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
}

/* ============================================================
   Checkbox / Custom Checkmark
   ============================================================ */
.check-group {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: .75rem;
}
.check-group input[type=checkbox] {
  margin-top: .2rem;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  cursor: pointer;
}
.check-group label { font-size: .9rem; cursor: pointer; }

/* ============================================================
   Artikel-Grid (show.php)
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.article-card__image {
  position: relative;
  background: var(--color-border);
  aspect-ratio: 3/4;
  overflow: hidden;
}
.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition);
}
.article-card__image:hover img { opacity: .88; }

.article-card__zoom {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30,27,46,.35);
  opacity: 0;
  transition: opacity var(--transition);
}
.article-card:hover .article-card__zoom { opacity: 1; }
.article-card__zoom svg { color: #fff; width: 32px; height: 32px; }

.article-card__body {
  padding: .9rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.article-card__title {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}
.article-card__meta {
  font-size: .82rem;
  color: var(--color-text-muted);
}
.article-card__price {
  margin-top: auto;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}
.article-card__price--reduced .original {
  text-decoration: line-through;
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: .85rem;
  margin-right: .3rem;
}

/* ============================================================
   Filter-Bereich
   ============================================================ */
.filter-area {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.filter-area__grid {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  align-items: flex-end;
}

.filter-area__item {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 140px;
}

.filter-area__item label {
  font-size: .8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.filter-input {
  padding: .5rem .7rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-base);
  font-size: .85rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,.12);
  background: var(--color-surface);
}

/* ============================================================
   Status-Labels / Badges
   ============================================================ */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 99px;
  letter-spacing: .02em;
}
.badge-primary { background: rgba(108,99,255,.12); color: var(--color-primary); }
.badge-success { background: rgba(67,160,71,.12);  color: var(--color-success); }
.badge-error   { background: rgba(229,57,53,.12);  color: var(--color-error);   }

/* ============================================================
   Info-/Fehlermeldungen
   ============================================================ */
.alert {
  padding: .9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 1rem;
}
.alert-error {
  background: rgba(229,57,53,.08);
  border: 1px solid rgba(229,57,53,.3);
  color: var(--color-error);
}
.alert-success {
  background: rgba(67,160,71,.08);
  border: 1px solid rgba(67,160,71,.3);
  color: var(--color-success);
}

/* ============================================================
   Cookie-Banner
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(30,27,46,.96);
  color: #e8e6f5;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  z-index: 9999;
  box-shadow: 0 -2px 12px rgba(0,0,0,.2);
}
.cookie-banner p { font-size: .88rem; flex: 1; }
.cookie-banner a { color: #a29ee8; }
.cookie-banner .btn-primary { white-space: nowrap; }

/* ============================================================
   Footer
   ============================================================ */
.portal-footer {
  background: #1e1b2e;
  color: #9c99b8;
  padding: 2rem 1.5rem 1rem;
  margin-top: 3rem;
}
.portal-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
}
.portal-footer__col h4 {
  color: #e8e6f5;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: .6rem;
}
.portal-footer__col ul { list-style: none; }
.portal-footer__col ul li { margin-bottom: .4rem; }
.portal-footer__col ul li a { color: #9c99b8; font-size: .85rem; }
.portal-footer__col ul li a:hover { color: #e8e6f5; }
.portal-footer__copyright {
  max-width: 960px;
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .8rem;
  text-align: center;
}

/* ============================================================
   Statistik-Box (showKundenArtikelliste)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}
.stat-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  text-align: center;
}
.stat-box__value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}
.stat-box__label {
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-top: .25rem;
}

/* ============================================================
   Responsive Anpassungen
   ============================================================ */
@media (max-width: 600px) {
  .portal-main   { padding: 0 .75rem; }
  .card          { padding: 1rem 1.25rem; }
  .article-grid  { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
  .filter-area__grid { gap: .5rem; }
}

/* ============================================================
   Hilfeklassen
   ============================================================ */
.text-center  { text-align: center; }
.text-muted   { color: var(--color-text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-none   { display: none !important; }
.d-block  { display: block !important; }
.hint     { font-size: .82rem; color: var(--color-text-muted); }
