:root {
  --pearl: #F6F2F5;
  --velvet: #3E1736;
  --velvet-deep: #2A0F25;
  --talli: #C99B3B;
  --talli-ink: #8A6417;
  --rose: #E9C7D1;
  --ink: #24161F;
  --muted: #6E5A67;
  --line: #E4D9E0;
  --white: #FFFFFF;
  --wa: #1F8F55;
  --display: 'Reem Kufi', 'Readex Pro', system-ui, sans-serif;
  --body: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --arch: 50% 50% 10px 10px / 30% 30% 10px 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--pearl);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
  padding-bottom: calc(72px + var(--safe-b));
}
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--talli); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* header */
.top {
  background: var(--velvet);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.mark { width: 40px; height: 40px; display: block; }
.mark-arch { fill: none; stroke: var(--talli); stroke-width: 3; }
.mark-braid { fill: none; stroke: var(--rose); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.lang {
  background: transparent;
  border: 1px solid rgba(233, 199, 209, 0.5);
  color: var(--rose);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}
.braid { height: 14px; background: url('/assets/braid.svg') repeat-x center / auto 14px; }

/* hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px 8px;
}
.hero h1 {
  font: 600 clamp(1.9rem, 7vw, 3.4rem)/1.15 var(--display);
  color: var(--velvet);
  margin: 0 0 8px;
}
.hero h1 { max-width: 16em; }


/* toolbar */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--pearl);
  padding: 12px 16px 10px;
  max-width: 1200px;
  margin: 0 auto;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--muted);
}
.search input { border: 0; outline: 0; background: transparent; width: 100%; padding: 11px 0; font-size: 16px; color: var(--ink); }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
}
.chip[aria-selected="true"] { background: var(--velvet); border-color: var(--velvet); color: var(--white); }

/* grid */
.grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px;
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 22px; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.item { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card { text-align: start; background: none; border: 0; padding: 0; cursor: pointer; display: block; width: 100%; flex: 1; }
.card-wa { padding: 9px 12px; border-radius: 10px; font-size: 0.92rem; width: 100%; }
.card-wa svg { width: 18px; height: 18px; }
.frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--arch);
  overflow: hidden;
  background: var(--velvet);
  outline: 1px solid rgba(201, 155, 59, 0.55);
  outline-offset: 3px;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    url('/assets/braid.svg') repeat-x center / auto 14px,
    var(--velvet);
}
.placeholder span {
  background: var(--velvet);
  color: var(--talli);
  font: 600 1rem/1 var(--display);
  padding: 8px 12px;
}
.badge {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-start: 10px;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--talli);
  color: var(--velvet-deep);
  font-weight: 500;
}
.badge.out { background: var(--white); color: var(--muted); }
.card-body { padding: 12px 2px 0; }
.card-code { font-size: 0.78rem; color: var(--talli-ink); margin: 0; }
.card-name { font-weight: 500; margin: 2px 0 0; line-height: 1.35; }
.card-price { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }

.note { text-align: center; color: var(--muted); padding: 40px 16px; max-width: 30em; margin: 0 auto; }
.note button { margin-top: 12px; }
.skeleton .frame { background: var(--line); outline-color: var(--line); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* contact */
.contact { max-width: 560px; margin: 0 auto; padding: 32px 16px; }
.contact h1 { font: 600 clamp(1.8rem, 7vw, 2.6rem)/1.2 var(--display); color: var(--velvet); margin: 0 0 8px; }
.contact > p { color: var(--muted); margin: 0 0 24px; }
.contact-list { display: grid; gap: 12px; }
.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
}
.contact-row .icon {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pearl);
  color: var(--velvet);
}
.contact-row.wa { background: var(--wa); border-color: var(--wa); color: var(--white); }
.contact-row.wa .icon { background: rgba(255, 255, 255, 0.16); color: var(--white); }
.contact-row strong { display: block; font-weight: 500; }
.contact-row small { display: block; opacity: 0.75; direction: ltr; text-align: start; unicode-bidi: plaintext; }

/* tab bar */
.tabbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 0 8px;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--muted);
}
.tabbar a[aria-current="page"] { color: var(--velvet); font-weight: 500; }
.tabbar a[aria-current="page"] svg { color: var(--talli-ink); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  background: var(--velvet);
  color: var(--white);
}
.btn-wa { background: var(--wa); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }

/* item sheet */
.sheet {
  padding: 0;
  border: 0;
  width: 100%;
  max-width: 560px;
  max-height: 100dvh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--pearl);
  color: var(--ink);
  overflow-y: auto;
}
@media (min-width: 720px) {
  .sheet { height: auto; max-height: calc(100dvh - 48px); margin: 24px auto; border-radius: 18px; }
}
.sheet::backdrop { background: rgba(42, 15, 37, 0.6); }
.sheet[open] { animation: rise 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.sheet-close {
  position: sticky;
  top: 12px;
  float: inline-end;
  margin: 12px 12px -56px;
  z-index: 2;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--velvet);
  display: grid; place-items: center;
  cursor: pointer;
}
.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: var(--velvet);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery > * { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 3 / 4; position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; min-height: 18px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--talli-ink); }
.sheet-body { padding: 8px 20px calc(24px + var(--safe-b)); }
.sheet-body .code { color: var(--talli-ink); margin: 0; font-size: 0.85rem; }
.sheet-body h2 { font: 600 1.6rem/1.25 var(--display); color: var(--velvet); margin: 2px 0 4px; }
.sheet-body .price { font-size: 1.15rem; margin: 0 0 16px; }
.facts { display: grid; gap: 10px; margin: 0 0 16px; }
.facts div { display: flex; gap: 12px; align-items: baseline; }
.facts dt { color: var(--muted); font-size: 0.88rem; min-width: 5.5em; }
.facts dd { margin: 0; }
.desc { white-space: pre-line; color: var(--ink); margin: 0 0 20px; }
.sheet-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* English */
html[lang="en"] .hero h1, html[lang="en"] .contact h1 { letter-spacing: -0.01em; }
