/* mysportdesignfactory.com — közös stíluslap */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; }

/* A `hidden` ATTRIBÚTUM MINDIG ERŐSEBB A SAJÁT DISPLAY-SZABÁLYUNKNÁL.
   A böngésző alapértelmezése `[hidden] { display: none }`, de ezt bármelyik
   saját osztályunk felülírja, ha `display`-t állít — és a szerzői szabály
   erősebb a felhasználóügynökénél. Emiatt a `#designer-loading` (amin
   `.designer-loading { display: flex }` van) NEM tűnt el az `el.hidden = true`
   hatására: a tervező betöltött, a kézfogás lefutott, de a fehér betöltő réteg
   ott maradt fölötte — kívülről ez látszott „az iframe nem tölt be"-nek.
   Ugyanez érintett minden más `hidden` elemet is (üres állapotok, méretsáv,
   hibasáv). Ez az egy sor mindet rendbe teszi. */
[hidden] { display: none !important; }

:root {
  --bg:       #0B0C0E;
  --surface:  #15171A;
  --border:   #24272C;
  --text:     #F2F3F5;
  --muted:    #9AA0A6;
  --accent:   #F0653A;
  --accent-d: #D2502A;
  --success:  #2FA36B;
  --font-display: 'Archivo', -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --radius:   11px;
  --radius-lg: 16px;
  --max-w:    1180px;
}

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -.02em;
  line-height: 1.12;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #FF7A52; }

img { max-width: 100%; display: block; }

.mono { font-family: var(--font-mono); }

/* ─── LAYOUT ─────────────────────────────────────────────────── */

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
}

/* ─── FEJLÉC ─────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: 68px;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,12,14,.92);
  backdrop-filter: blur(12px);
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -.01em;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--muted);
}

.site-header nav a { color: var(--muted); }
.site-header nav a:hover, .site-header nav a.active { color: var(--text); }

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--muted);
  background: none;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  text-decoration: none;
}
.cart-btn:hover { border-color: var(--muted); color: var(--text); }
.cart-btn .cart-count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .site-header nav { display: none; }
}

/* ─── LÁBLÉC ─────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px;
  margin-top: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer .footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer .footer-right {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--border);
  letter-spacing: .06em;
}

.demo-badge {
  display: inline-block;
  background: rgba(240,101,58,.12);
  color: var(--accent);
  border: 1px solid rgba(240,101,58,.25);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: .08em;
  font-weight: 500;
}

/* ─── GOMBOK ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 13px 24px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
  border: none;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #0B0C0E;
}
.btn-primary:hover { background: #FF7A52; color: #0B0C0E; }
.btn-primary:active { background: var(--accent-d); }

.btn-lg {
  padding: 16px 32px;
  font-size: 15px;
  border-radius: var(--radius-lg);
}

.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--muted); }

.btn-ghost {
  background: none;
  color: var(--muted);
  padding: 10px 16px;
}
.btn-ghost:hover { color: var(--text); }

.btn:disabled, .btn[aria-busy="true"] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── KÁRTYÁK ────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ─── ÉRTESÍTÉS / TOAST ──────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  z-index: 999;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast .toast-undo {
  margin-left: 12px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}

/* ─── DEMÓ SÁV ───────────────────────────────────────────────── */

.demo-bar {
  background: rgba(240,101,58,.08);
  border-bottom: 1px solid rgba(240,101,58,.2);
  text-align: center;
  padding: 8px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: .04em;
}

/* ─── TERMÉKLISTA RÁCS ────────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 1023px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s;
}
.product-card:hover { border-color: var(--muted); }

.product-card-image {
  aspect-ratio: 4/3;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.product-card-image img { width: 100%; height: 100%; object-fit: contain; }
.product-card-image .img-placeholder {
  width: 80px;
  height: 100px;
  opacity: .15;
}

.product-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}

.product-card-meta {
  font-size: 13px;
  color: var(--muted);
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
}

.price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
}

.price-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ─── TERMÉKOLDAL ─────────────────────────────────────────────── */

.product-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 56px;
  padding: 56px 0 80px;
  align-items: start;
}

@media (max-width: 1023px) {
  .product-layout { grid-template-columns: 1fr; gap: 32px; padding: 32px 0 56px; }
}

.product-gallery { position: sticky; top: 84px; }

.gallery-main {
  aspect-ratio: 4/3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }

.gallery-thumbs {
  display: flex;
  gap: 8px;
}

.gallery-thumb {
  width: 60px;
  height: 60px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.gallery-thumb:hover { border-color: var(--muted); }
.gallery-thumb.active { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }

.product-info { display: flex; flex-direction: column; gap: 20px; }

.product-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
}

.size-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-chip {
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

.size-chip.unavailable {
  opacity: .35;
  cursor: not-allowed;
}

/* ─── IFRAME WRAPPER ──────────────────────────────────────────── */

.designer-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.designer-wrap iframe {
  border: none;
  width: 100%;
  flex: 1;
  min-height: 600px;
}

.designer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  z-index: 10;
}

.designer-loading .spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.designer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.designer-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}
.designer-status.connected .dot { background: var(--success); }
.designer-status.error .dot { background: var(--accent); }

/* ─── KOSÁR ───────────────────────────────────────────────────── */

.kosar-empty {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}

.kosar-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.kosar-item-kep {
  width: 80px;
  height: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kosar-item-kep img { width: 100%; height: 100%; object-fit: contain; }

.kosar-item-info { display: flex; flex-direction: column; gap: 6px; }
.kosar-item-nev { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.kosar-item-meta { font-size: 13px; color: var(--muted); }

.kosar-sorok { margin-top: 8px; }
.kosar-sor {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--muted);
}
.kosar-sor .meret-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--border);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--text);
}

.kosar-item-ar {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  white-space: nowrap;
}

/* Összesítő oldalsáv */
.osszesito {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 84px;
}

.osszesito-sor {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
}

.osszesito-sor.total {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-weight: 600;
  font-size: 16px;
}

.osszesito-sor .label { color: var(--muted); }
.osszesito-sor .val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.osszesito-note { font-size: 11px; color: var(--muted); text-align: center; }

/* ─── PÉNZTÁR ─────────────────────────────────────────────────── */

.penztar-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  padding: 40px 0 80px;
  align-items: start;
}

@media (max-width: 900px) {
  .penztar-layout { grid-template-columns: 1fr; }
  .penztar-osszesito { order: -1; }
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  width: 100%;
  transition: border-color .15s;
  outline: none;
}
.form-input:focus { border-color: var(--muted); }
.form-input.error { border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }

.form-hint {
  font-size: 12px;
  color: var(--muted);
}
.form-hint.error-msg { color: var(--accent); }

.section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

/* Demo kártya doboz */
.demo-card-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.demo-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(240,101,58,.1);
  border: 1px solid rgba(240,101,58,.25);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .08em;
}

.demo-card-fields { display: flex; flex-direction: column; gap: 10px; }

.demo-card-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-card-field label {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.demo-card-field input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  width: 100%;
  pointer-events: none;
  user-select: none;
}

.demo-card-explain {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── VISSZAIGAZOLÁS ──────────────────────────────────────────── */

.visszaig-hero {
  text-align: center;
  padding: 64px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.visszaig-icon {
  width: 64px;
  height: 64px;
  background: rgba(47,163,107,.12);
  border: 1px solid rgba(47,163,107,.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}

.visszaig-rendsz {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--text);
  letter-spacing: .04em;
}

.visszaig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}

@media (max-width: 640px) { .visszaig-grid { grid-template-columns: 1fr; } }

.visszaig-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.visszaig-cell .cimke {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.visszaig-cell .ertek {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* ─── ÜRES ÁLLAPOTOK ──────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 72px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-state p { max-width: 40ch; margin: 0; }

/* ─── HIBAJELZŐK ──────────────────────────────────────────────── */

.api-error-bar {
  background: rgba(240,101,58,.06);
  border: 1px solid rgba(240,101,58,.15);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ─── UTILITY ─────────────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.divider { height: 1px; background: var(--border); margin: 0; border: none; }

.label-accent {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ─── MOBIL ─────────────────────────────────────────────────────── */

/* 44px minimum érintési célméretek minden interaktív elemen */
@media (max-width: 640px) {
  .btn { min-height: 44px; padding: 12px 20px; }
  .gallery-thumb { width: 52px; height: 52px; }
  .cart-btn { min-width: 44px; min-height: 44px; }
  .header-actions a, .header-actions button { min-height: 44px; }
  .kosar-item-torl { min-width: 44px; min-height: 44px; }
  nav a { padding: 10px 8px; min-height: 44px; display: inline-flex; align-items: center; }
  .form-input { padding: 14px 14px; font-size: 16px; }
  .product-title { font-size: 22px; }
}

/* Lebegő kosár sáv mobilon (kosár.html és termék oldalon) */
.mobile-bar {
  display: none;
}
@media (max-width: 640px) {
  .mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    gap: 12px;
    align-items: center;
  }
  .mobile-bar .btn { flex: 1; justify-content: center; }
  /* Helyet ad a fixed sávnak */
  .main-content-padded { padding-bottom: 88px; }
}

/* ─── TERVEZŐ — MINDIG TELJES KÉPERNYŐS OVERLAY ──────────────── */

/* A tervező minden ablakméretben a böngésző teljes területét foglalja el.
   position:fixed mindig kiveszi a dokumentum-flow-ból, a viewport-hoz igazodik.
   A bezárás gomb visszaadja a termékoldalt. */
#designer-section:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#designer-section:not([hidden]) .designer-wrap {
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
}
#designer-section:not([hidden]) .designer-wrap iframe {
  height: 100%;
}

/* ─── BEZÁRÁS GOMB ────────────────────────────────────────────── */

.designer-bezaro {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.designer-bezaro:hover { background: var(--bg); border-color: var(--muted); }
