/* ============================================================
   Global Styles for SCHUL-SHIRT.COM
   ============================================================ */

/* --- Design Tokens --- */
:root {
  --brand: #007bc4;
  --brand-dark: #005f96;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #ffffff;
  --surface-alt: #f8f9fb;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.15);
  --maxw: 1100px;
}

/* --- Reset --- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-alt);
}
a { color: inherit; text-decoration: none; }
a:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
button { cursor: pointer; font-family: inherit; }

/* --- Layout Utility --- */
.maxw { max-width: var(--maxw); margin: 0 auto; }
.flex { display:flex; gap:1rem; align-items:center; }
.between { justify-content: space-between; }

/* ============================================================
   Header + Navigation (Logo links oben, immer sichtbar)
   ============================================================ */
.site-header {
  background: #111;
  color: #fff;
  padding: .5rem 1rem;
}
.nav { display:flex; gap:1rem; align-items:center; }
.nav a { color:#fff; opacity:.9; font-size:.95rem; transition:opacity .2s ease; }
.nav a:hover { opacity:1; }

.brand { display:flex; align-items:center; text-decoration:none; }
.nav-logo {
  display:block;
  height: 42px;          /* kleine fixe Höhe */
  width: auto;           /* proportional */
  max-width: 130px;      /* Sicherheitsgrenze */
  object-fit: contain;   /* nie verzerren */
  margin: 0;
  padding: 0;
}

/* Auf der Startseite liegt der Header als Overlay auf dem Hero */
body.home .site-header {
  position: absolute; left: 0; right: 0; top: 0;
  background: transparent; color: #fff; z-index: 10;
}
body.home .nav a { color:#fff; }

/* ============================================================
   Main Container
   ============================================================ */
.container { max-width: var(--maxw); margin: 2rem auto; padding: 0 1rem; }

/* Auf der Startseite soll der Container keine Ränder/Max-Breite erzwingen */
body.home main.container { max-width: none; margin: 0; padding: 0; }

/* ============================================================
   Hero / Startseite (Fullscreen, randlos)
   ============================================================ */
.home-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;         /* Fallback */
  min-height: 100svh;        /* modernes mobiles Viewportmaß */
  min-height: 100dvh;        /* dynamische Höhe (iOS/Android) */

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  background-image: url('/assets/img/background.png');
  background-size: cover;            /* strecken auf gesamte Fläche */
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;      /* ruhiges Bild */
  background-color: #0e7aa9;         /* Fallback */
  color: #fff;
  overflow: hidden;
}

/* Dunkler Overlay für Lesbarkeit */
.home-hero::before {
  content:"";
  position:absolute; inset:0;
  background: rgba(0,0,0,.45);
  z-index: 0;
}

/* Großes Logo im Hero NICHT anzeigen (verhindert Doppelung mit Header-Logo) */
.hero-logo { display: none; }

/* --- Schulauswahl-Card auf dem Hero --- */
.school-chooser {
  position: relative; z-index: 1;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(3px);
  border-radius: var(--radius);
  padding: 2rem;
  width: min(92%, 540px);
  box-shadow: var(--shadow);
  text-align: left;
}
.school-chooser h1 {
  margin: 0 0 1rem;
  color: var(--brand);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}
.school-chooser input,
.school-chooser select {
  width:100%;
  padding:.85rem 1rem;
  margin:.4rem 0 1rem;
  font-size:1rem;
  border:1px solid var(--line);
  border-radius: .6rem;
  background:#fff;
}
.school-chooser input:focus,
.school-chooser select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0,123,196,.15);
  outline:none;
}
.school-chooser .btn {
  display:inline-block;
  background: var(--brand);
  color:#fff;
  border:none;
  padding:.9rem 1.4rem;
  border-radius:.7rem;
  font-weight:600;
  transition: background .2s ease, transform .08s ease;
}
.school-chooser .btn:hover { background: var(--brand-dark); }
.school-chooser .btn:active { transform: translateY(1px); }

/* ============================================================
   Product Grid & Cards
   ============================================================ */
.product-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill,minmax(260px,1fr));
  gap:1.2rem;
}
.product-card {
  background:#fff;
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:1rem;
  transition:transform .15s ease;
}
.product-card:hover { transform:translateY(-3px); }
.product-card img {
  width:100%; border-radius:.6rem; margin-bottom:.5rem;
}
.price { font-weight:700; color:var(--brand); margin:.25rem 0; }

/* ============================================================
   Auth & Formulare
   ============================================================ */
.auth-form input {
  width:100%; padding:.75rem 1rem;
  margin:.25rem 0 1rem;
  border:1px solid var(--line);
  border-radius:.6rem;
}
.msg.error {
  background:#fee;
  color:#900;
  padding:.75rem;
  border:1px solid #f99;
  border-radius:.7rem;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background:#111;
  color:#fff;
  text-align:center;
  padding:1rem;
}

/* ============================================================
   Responsive Tweaks
   ============================================================ */
@media (max-width: 720px) {
  .nav a { font-size: .85rem; }
}


/* === Shop Overview Cards === */
.product-link { display:block; color:inherit; }
.product-card h2 { margin:.4rem 0 .2rem; font-size:1.05rem; }
.product-card .card-cta { color: var(--muted); margin:.1rem 0 0; }
.product-card img { aspect-ratio: 1 / 1; object-fit: cover; }

/* === Product Detail Layout === */
.breadcrumb { margin: 1rem 0; }
.breadcrumb a { color: var(--brand); }

.product-detail {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}
.pd-media img {
  width: 100%;
  height: auto;
  border-radius: .8rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background:#fff;
}
.pd-info h1 { margin: 0 0 .25rem; }
.pd-price { font-size: 1.25rem; font-weight: 700; color: var(--brand); margin: 0 0 .75rem; }
.pd-desc { color: var(--muted); }

.pd-form select,
.pd-form input[type=number] {
  width: 100%;
  padding: .8rem 1rem;
  margin: .25rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: #fff;
}

.pd-cta {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: .9rem 1.4rem;
  border-radius: .7rem;
  font-weight: 600;
}
.pd-cta:hover { background: var(--brand-dark); }

.pd-colors { margin: 1rem 0; border: 0; padding: 0; }
.pd-colors legend { font-weight: 600; margin-bottom: .5rem; }
.pd-color-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .6rem;
}
.pd-color-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: .5rem;
  align-items: center;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: #fff;
}
.pd-color-item img {
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  border-radius: .4rem;
  border: 1px solid #eee;
  margin-top: .25rem;
}

@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; }
}

/* ===== Produktdetail (zentriert, clean) ===== */
.breadcrumb { max-width: var(--maxw); margin: 1rem auto; padding: 0 1rem; }
.breadcrumb a { color: var(--brand); }

.pd-card{
  max-width: 980px;
  margin: 1.5rem auto 3rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(280px, 520px);
  justify-content: center;
  gap: 1.25rem;
}
.pd-media { display:flex; justify-content:center; }
.pd-media img{
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: .8rem;
  border: 1px solid var(--line);
  background: #fff;
}

.pd-info { max-width: 640px; margin: 0 auto; }
.pd-title{ margin: .25rem 0; text-align:center; }
.pd-price{ text-align:center; font-weight:700; color:var(--brand); margin: .25rem 0 1rem; }
.pd-desc { color: var(--muted); text-align:center; }

.pd-form { margin-top: 1rem; }

.pd-colors { border:0; padding:0; margin: 1rem 0 1.25rem; }
.pd-colors legend { font-weight: 600; margin-bottom: .5rem; text-align:center; }
.pd-swatch-row{
  display:flex; flex-wrap:wrap; gap:.5rem; justify-content:center;
}
.pd-swatch{
  display:flex; gap:.5rem; align-items:center;
  border:1px solid var(--line);
  background:#fff;
  padding:.5rem .75rem;
  border-radius:.6rem;
  cursor:pointer;
  transition: border .15s ease, box-shadow .15s ease, transform .06s ease;
}
.pd-swatch:hover{ box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.pd-swatch.is-active{ border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0,123,196,.12); }
.pd-swatch-chip{
  width: 18px; height:18px; border-radius:50%;
  border: 1px solid rgba(0,0,0,.2);
}
.pd-swatch-name{ font-size:.95rem; }

.pd-sizes { border:0; padding:0; margin: 1rem 0; }
.pd-sizes legend { font-weight:600; margin-bottom:.6rem; text-align:center; }
.pd-size-grid{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap:.6rem;
}
.pd-size-cell{
  display:grid; grid-template-columns: 1fr 72px; align-items:center;
  gap:.5rem; border:1px solid var(--line); border-radius:.6rem; padding:.55rem .6rem; background:#fff;
}
.pd-size-label{ font-weight:600; }
.pd-qty{
  width:100%; padding:.6rem .6rem; border:1px solid var(--line); border-radius:.5rem;
}
.pd-total{ text-align:right; color:var(--muted); margin:.5rem 0 0; }

.pd-cta{
  display:block; width:100%;
  background: var(--brand);
  color:#fff; border:none; border-radius:.8rem;
  padding: 1rem 1.25rem; font-weight:700;
}
.pd-cta[disabled]{ opacity:.6; cursor:not-allowed; }
.pd-cta:not([disabled]):hover{ background: var(--brand-dark); }

@media (min-width: 860px){
  .pd-card{
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
    padding: 1.5rem 1.75rem;
  }
  .pd-info { margin: 0; }
}
.cart-btn {
  background:none; border:none; color:#fff; font-size:1.1rem;
  cursor:pointer; position:relative;
}
#cart-count {
  background:#f44; color:#fff; border-radius:50%;
  font-size:.75rem; padding:2px 6px; position:absolute;
  top:-8px; right:-10px;
}
.cart-popup.hidden { display:none; }
.cart-popup {
  position:fixed; inset:0; background:rgba(0,0,0,.5);
  display:flex; align-items:center; justify-content:center;
  z-index:9999;
}
.cart-popup-content {
  background:#fff; border-radius:1rem; padding:2rem;
  width:min(90%,480px); max-height:90vh; overflow:auto;
  box-shadow:0 10px 30px rgba(0,0,0,.3);
}
.cart-popup-actions { display:flex; justify-content:space-between; gap:1rem; margin-top:1.5rem; }
.btn-outline { background:#fff; border:1px solid var(--brand); color:var(--brand); border-radius:.5rem; padding:.7rem 1.2rem; }
