/* ----------------------------------------------------------------
   Matloub public catalogue — clean, fast, mobile-first.
   ---------------------------------------------------------------- */
:root {
  --ink: #1e293b;
  --muted: #64748b;
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- header ---------------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 1.1rem;
}

.search {
  flex: 1;
  display: flex;
  max-width: 520px;
  margin-inline-start: auto;
}

.search input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-inline-end: 0;
  border-radius: 10px 0 0 10px;
  font-size: 1rem;
  background: #fff;
}
.search input:focus { outline: 2px solid var(--brand); border-color: transparent; }

.search button {
  padding: 0 16px;
  border: 0;
  border-radius: 0 10px 10px 0;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}
.search button:hover { background: var(--brand-dark); }

/* ---------------- categories ---------------- */
.cat-bar { border-top: 1px solid var(--line); }
.cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: .95rem;
}
.chip:hover { border-color: var(--brand); text-decoration: none; }
.chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chip small { opacity: .75; font-size: .8em; margin-inline-start: 2px; }

/* ---------------- type filter ---------------- */
.type-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
}
.type-label { color: var(--muted); font-weight: 600; }

.type-chip {
  padding: 5px 13px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: .9rem;
}
.type-chip:hover { border-color: var(--brand); text-decoration: none; }
.type-chip.on { background: #ecfdf5; border-color: var(--brand); color: var(--brand-dark); }

/* ---------------- catalogue ---------------- */
.result-count { color: var(--muted); margin: 14px 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding-bottom: 32px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.photo {
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.placeholder { color: var(--muted); font-size: .9rem; }

.card-body { padding: 12px 14px 14px; }
.card-body h3 { margin: 0 0 4px; font-size: 1.02rem; font-weight: 650; }
.size { margin: 0; color: var(--brand-dark); font-weight: 600; font-size: .9rem; }
.size.big { font-size: 1.1rem; }

.card-types { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: .78rem;
}

/* ---------------- detail ---------------- */
.crumbs { margin: 16px 0; color: var(--muted); }

.detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  padding: 8px 0 32px;
}
.detail-photo {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-photo img { width: 100%; display: block; }
.detail-info h1 { margin: 0 0 10px; font-size: 1.7rem; }
.notes { margin-top: 14px; color: var(--muted); }

.section-title { margin: 24px 0 12px; font-size: 1.2rem; }

/* ---------------- misc ---------------- */
.btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }

.empty {
  text-align: center;
  padding: 64px 16px;
  color: var(--muted);
}

.muted { color: var(--muted); }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 24px 0 32px;
  margin-top: 24px;
}
.site-footer p { margin: 4px 0; }

/* ---------------- small screens ---------------- */
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .detail { grid-template-columns: 1fr; }
  .brand { font-size: 1.15rem; }
}
