:root {
  --brand: #b5532a;
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #1f1a16;
  --muted: #7a7068;
  --line: #ece5db;
  --chip: #f1ebe2;
  --shadow: 0 1px 2px rgba(40, 25, 10, .06), 0 6px 20px rgba(40, 25, 10, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120f;
    --card: #1e1a16;
    --ink: #f3ece4;
    --muted: #a59a8f;
    --line: #2d2721;
    --chip: #27221d;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.loading { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wrap { max-width: 640px; margin: 0 auto; }

.hero { padding: 40px 20px 22px; text-align: center; position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 180px; z-index: -1;
  background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%);
}
.logo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 14px; background: var(--card); box-shadow: var(--shadow); }
.logo-txt { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand); color: #fff; font: 600 28px Fraunces, serif; }
h1 { font: 650 30px/1.15 Fraunces, Georgia, serif; margin: 0; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 6px 0 0; }

.nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.chips::-webkit-scrollbar { display: none; }
.alg { font-size: 12px; color: var(--muted, #777); margin-top: 2px; }
.chip { flex: none; border: 0; background: var(--chip); color: var(--ink); padding: 8px 14px; border-radius: 999px; font: 500 14px Inter, sans-serif; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--brand); color: #fff; }
.icon-btn { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--chip); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.search { flex: 1; display: none; }
.search input { width: 100%; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: 16px Inter, sans-serif; outline: none; }
.search input:focus { border-color: var(--brand); }
.nav.searching .chips { display: none; }
.nav.searching .search { display: block; }

section { padding: 22px 16px 4px; }
h2 { font: 650 22px/1.2 Fraunces, Georgia, serif; margin: 0 4px 12px; }
.list { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: flex-start; }
.item:first-child { border-top: 0; }
.item.has-img { cursor: pointer; }
.item .txt { flex: 1; min-width: 0; }
.item .name { font-weight: 600; font-size: 16px; }
.item .desc { color: var(--muted); font-size: 13.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.price { color: var(--brand); font-weight: 600; white-space: nowrap; }
.item .price { display: block; margin-top: 6px; }
.price .sz { font-size: 11px; font-weight: 600; color: var(--muted); margin-right: 4px; letter-spacing: .03em; }
.price .sep { color: var(--line); margin: 0 8px; }
.item img { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; flex: none; background: var(--chip); }
.item.compact { padding-top: 12px; padding-bottom: 12px; }
.item.compact .txt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.item.compact .price { margin-top: 0; text-align: right; }
.item.off { opacity: .5; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--chip); color: var(--muted); padding: 2px 8px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); }
footer .note { margin-bottom: 14px; white-space: pre-line; }
footer a { color: inherit; opacity: .7; text-decoration: none; }

.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; overscroll-behavior: contain; touch-action: none; }
.sheet-card { touch-action: pan-y; overscroll-behavior: contain; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); animation: fade .2s; }
.sheet-card { position: relative; width: 100%; max-width: 560px; background: var(--card); border-radius: 20px 20px 0 0; animation: up .25s ease-out; max-height: 92vh; overflow-y: auto; }
.sheet-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--chip); }
.sheet-body { padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.sheet-head h3 { margin: 0; font: 650 22px/1.2 Fraunces, serif; }
.sheet-head .price { font-size: 18px; }
.sheet-body p { color: var(--muted); margin: 8px 0 0; white-space: pre-line; }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; z-index: 1; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-card { border-radius: 20px; overflow: hidden; } }

/* 3D model / AR */
.item.has-model { cursor: pointer; }
.mudavim-link { display: block; width: fit-content; margin: 14px auto 6px; padding: 10px 18px; border-radius: 999px; background: var(--brand); color: #fff !important; font-weight: 650; text-decoration: none; }
.sheet-card img[hidden], .btn-3d[hidden], .sheet-3d[hidden], .ar-ipucu[hidden], .btn-olcu[hidden], .dims[hidden] { display: none; }
/* Ölçüler: çizgiler kanvasın üstünde, etiketler model-viewer hotspot'ları; yalnız "Ölçüler" açıkken görünür */
.btn-olcu { position: absolute; left: 12px; top: 12px; border: 0; border-radius: 999px; padding: 7px 14px; background: rgba(255, 255, 255, .9); color: #1f1a16; font: 600 13px Inter, sans-serif; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); cursor: pointer; }
.btn-olcu.on { background: var(--brand); color: #fff; }
.dims { position: absolute; inset: 0; pointer-events: none; }
.dim-lines { width: 100%; height: 100%; }
.dim-lines line { stroke: #1f1a16; stroke-width: 1.5; stroke-dasharray: 4 3; }
.dim-dot, .dim-lbl { display: none; pointer-events: none; }
model-viewer[data-olcu] .dim-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: #1f1a16; transform: translate(-3px, -3px); }
model-viewer[data-olcu] .dim-lbl { display: block; padding: 3px 8px; border-radius: 999px; background: #1f1a16; color: #fff; font: 600 12px Inter, sans-serif; white-space: nowrap; transform: translate(-50%, -50%); }
/* AR ekranında üstte yönlendirme; dokunmaları engellemesin (sürükleme ve çevirme çalışsın) */
.ar-ipucu { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 16px; right: 64px; padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, .65); color: #fff; font: 500 14px/1.4 Inter, sans-serif; text-align: center; pointer-events: none; }
.badge.b3d { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.sheet-3d { width: 100%; aspect-ratio: 1; background: #eeece8; }
.sheet-3d model-viewer { display: block; width: 100%; height: 100%; --poster-color: transparent; }
.btn-3d { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--chip); color: var(--ink); padding: 9px 16px; border-radius: 999px; font: 600 14px Inter, sans-serif; cursor: pointer; margin-bottom: 14px; }
.btn-3d::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 2 3 7v10l9 5 9-5V7z'/%3E%3Cpath d='m3 7 9 5 9-5M12 12v10'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 2 3 7v10l9 5 9-5V7z'/%3E%3Cpath d='m3 7 9 5 9-5M12 12v10'/%3E%3C/svg%3E") center/contain no-repeat; }
.btn-3d:disabled { opacity: .6; cursor: default; }
.btn-ar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); border: 0; background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 999px; font: 600 14px Inter, sans-serif; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.err-3d { color: #b42318; font-size: 14px; margin: 0 0 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
