:root {
  --bg: #ffffff;
  --tile: #f2f2f2;
  --ink: #111111;
  --mute: #8a8a8a;
  --rule: #e6e6e6;
  --bar-h: clamp(50px, 4.2vw, 68px);
  --pad: clamp(12px, 2.2vw, 44px);
  --gap: clamp(6px, 0.7vw, 14px);
  --max: 3200px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(13px, 0.25vw + 12px, 16px);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
main, .foot { width: 100%; max-width: var(--max); margin-inline: auto; }
ul { list-style: none; }

/* ---------- üst bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left));
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
}
.logo { font-weight: 600; font-size: clamp(12px, 0.5vw + 10px, 17px); letter-spacing: 0.34em; text-transform: uppercase; }
.bar nav { display: flex; gap: clamp(18px, 2vw, 40px); }
.bar nav a { padding: 10px 0; }
.bar nav a { color: var(--mute); transition: color .15s; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--ink); }

main { flex: 1; padding-top: var(--bar-h); }

/* ---------- görsel kutuları ---------- */
.fig { position: relative; overflow: hidden; background: var(--tile); aspect-ratio: 3 / 4; }
.fig img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .6s ease;
}
.fig img.ready { opacity: 1; }
.fig img.cropped { inset: auto; max-width: none; object-fit: fill; }

/* ---------- koleksiyon ---------- */
.tools {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 8px var(--pad) 20px;
  color: var(--mute);
}
.tools button { color: var(--mute); transition: color .15s; padding: 6px 0; }
.tools button:hover, .tools button[aria-pressed="true"] { color: var(--ink); }

.grid {
  display: grid;
  gap: var(--gap);
  padding: 0 var(--pad);
  grid-template-columns: repeat(2, 1fr);
}

.card { display: block; }
@media (hover: hover) { .card:hover .fig img:not(.cropped) { transform: scale(1.04); } }
.card .meta { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: clamp(10px, 1vw, 20px) 4px clamp(22px, 2.4vw, 48px); text-align: center; }
.card .meta .brand { font-size: clamp(9px, 0.15vw + 8.5px, 11px); letter-spacing: 0.22em; text-transform: uppercase; color: var(--mute); }
.card .meta .name { font-size: clamp(13px, 0.3vw + 11.5px, 17px); font-weight: 500; letter-spacing: -0.005em; line-height: 1.25; }
.card .meta .sub { font-size: clamp(11px, 0.2vw + 10px, 14px); color: var(--mute); }

/* ---------- varyasyon sayfası ---------- */
.page-head { padding: 24px var(--pad) 32px; display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; }
.crumb { color: var(--mute); margin-bottom: 10px; }
.crumb a:hover { color: var(--ink); }
.page-head h1 { font-size: clamp(24px, 2vw + 12px, 48px); font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; }
.page-head p { color: #555; max-width: 46ch; }

/* ---------- ürün sayfası ---------- */
.pdp { display: grid; grid-template-columns: 1fr; gap: var(--gap); padding: 0 var(--pad) 48px; align-items: start; }
.pdp-media { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.pdp-media .fig { cursor: zoom-in; }
.pdp-media .fig:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3.4; }
.pdp-media.odd .fig:last-child { grid-column: 1 / -1; aspect-ratio: 4 / 3.4; }

.pdp-info { order: -1; padding: 4px 2px 20px; display: flex; flex-direction: column; gap: 32px; }
.pdp-info h1 { font-size: clamp(20px, 0.8vw + 16px, 30px); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.pdp-info .code { font-family: var(--mono); font-size: 12px; color: var(--mute); margin-top: 8px; }
.pdp-info .desc { color: #444; }
.label { color: var(--mute); margin-bottom: 8px; }

.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--rule); }
.specs div:last-child { border-bottom: 1px solid var(--rule); }
.specs dt { color: var(--mute); }
.specs dd { text-align: right; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.swatches a { display: inline-flex; align-items: center; gap: 8px; color: var(--mute); }
.swatches a:hover, .swatches a[aria-current="true"] { color: var(--ink); }
.swatches i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px #0002; }
.swatches a[aria-current="true"] i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ink); }

.avail { color: var(--mute); }
.avail strong { color: var(--ink); font-weight: 500; display: block; }

/* ---------- showroom ---------- */
.info-page { padding: 48px var(--pad); max-width: 680px; }
.info-page h1 { font-size: clamp(26px, 2vw + 14px, 48px); font-weight: 500; margin-bottom: 12px; letter-spacing: -0.01em; }
.info-page p { color: #555; margin-bottom: 32px; }
.info-page dl div { display: flex; gap: 24px; padding: 12px 0; border-top: 1px solid var(--rule); }
.info-page dl div:last-child { border-bottom: 1px solid var(--rule); }
.info-page dt { width: 120px; color: var(--mute); flex: none; }

/* ---------- alt bilgi ---------- */
.foot { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 20px max(var(--pad), env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left)); color: var(--mute); font-size: 12px; }

/* ---------- lightbox ---------- */
.lightbox[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: var(--tile); display: grid; grid-template-columns: clamp(40px, 5vw, 96px) 1fr clamp(40px, 5vw, 96px); align-items: center; }
.lb-stage { height: 100%; padding: 56px 0 40px; display: grid; place-items: center; min-height: 0; }
.lb-stage img { max-height: 100%; max-width: 100%; object-fit: contain; }
.lb-close { position: absolute; top: 18px; right: var(--pad); color: var(--mute); }
.lb-prev, .lb-next { font-size: 24px; height: 100%; touch-action: manipulation; color: var(--mute); }
.lb-prev:hover, .lb-next:hover, .lb-close:hover { color: var(--ink); }
.lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: var(--mute); }

/* ---------- ekran boyutları ---------- */
/* küçük telefon altı: tek sütun ürün fotoğrafları zaten varsayılan */

/* telefon yatay / küçük tablet */
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .pdp-media { grid-template-columns: 1fr 1fr; }
}

/* tablet dikey ve üstü: ürün sayfasında bilgi üstte, fotoğraflar altta */
@media (min-width: 760px) {
  .pdp-info { flex-direction: row; flex-wrap: wrap; gap: 24px 48px; align-items: flex-start; padding-bottom: 28px; }
  .pdp-info > * { flex: 1 1 260px; }
  .page-head { padding-top: 32px; }
}

/* tablet yatay / küçük dizüstü: ürün sayfası iki sütun */
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .pdp { grid-template-columns: 1fr minmax(320px, 22vw); }
  .pdp-info { position: sticky; top: var(--bar-h); order: 0; flex-direction: column; flex-wrap: nowrap; padding: 4px 8px 0 clamp(16px, 2vw, 40px); gap: 32px; }
  .pdp-info > * { flex: none; }
}

/* geniş ekran */
@media (min-width: 1800px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 2400px) {
  .grid { grid-template-columns: repeat(6, 1fr); }
  .pdp-media { grid-template-columns: repeat(3, 1fr); }
  .pdp-media .fig:first-child { grid-column: 1 / -1; }
  .pdp-media.odd .fig:last-child { grid-column: auto; aspect-ratio: 3 / 4; }
}

/* telefon: kolay dokunma, alt çubuk */
@media (max-width: 559px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 24px; }
  .info-page { padding-top: 32px; }
  .intro-num, .intro-tag { bottom: max(24px, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .tools { gap: 14px; }
  .bar nav { gap: 14px; }
}

/* yatay telefon: dar yükseklik */
@media (max-height: 480px) and (orientation: landscape) {
  .lb-stage { padding: 40px 0 28px; }
  .intro-logo { font-size: 13px; }
}

/* ---------- bağlantılar ---------- */
.link { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #0004; transition: text-decoration-color .15s; }
.link:hover { text-decoration-color: currentColor; }
.avail .link { color: var(--ink); margin-top: 2px; display: inline-block; }
.wa { display: inline-block; margin-top: 32px; padding: 16px 32px; background: var(--ink); color: #fff; transition: opacity .15s; }
.wa:hover { opacity: .8; }

/* ---------- açılış ekranı ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100;
  background: #fff;
  display: grid; place-items: center;
  transition: opacity .7s ease, visibility .7s;
}
.intro.out { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-logo { font-weight: 600; font-size: clamp(13px, 1.2vw + 8px, 24px); letter-spacing: 0.6em; padding-left: 0.6em; text-transform: uppercase; }
.intro-num, .intro-tag {
  position: absolute; bottom: 24px;
  font-family: var(--mono); font-size: 11px; color: var(--mute);
}
.intro-num { left: var(--pad); }
.intro-tag { right: var(--pad); text-transform: uppercase; letter-spacing: 0.2em; }
.intro-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); transform-origin: left; transform: scaleX(0); }
body.is-loading { overflow: hidden; }

/* ---------- sayfa geçişleri ---------- */
#app { transition: opacity .2s ease; }
#app.leaving { opacity: 0; }
#app > * { animation: pageIn .6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #app > * { animation: none; }
  .fig img { transition: none; }
}
