/* docshelf.org — Editorial / Magazine storefront */
*{box-sizing:border-box;margin:0;padding:0}

:root {
  --brand: #5a7a6a;
  --ink: #3a3632;
  --paper: #f8f6f3;
  --mute: #9a9590;
  --rule: #e8e4de;
  --feat-bg: #3d524a;
  --btn: #5a7a6a;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --max-w: 1400px;
}

body { font-family: var(--sans); background: var(--paper); color: var(--ink); }

nav {
  display: flex; align-items: baseline; gap: 2rem;
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid var(--rule);
  max-width: var(--max-w); margin: 0 auto;
}
nav .nav-tag { font-size: 0.75rem; color: var(--mute); text-transform: uppercase; letter-spacing: 1.5px; }

.logo {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 900;
  letter-spacing: -1.5px; text-decoration: none; color: var(--ink);
}

/* ── Hero ── */
.hero {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
  max-width: var(--max-w); margin: 0 auto;
}
.hero-text {
  padding: 3rem 2.5rem;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; justify-content: center;
}
.hero-text h1 {
  font-family: var(--serif); font-size: 3rem; font-weight: 900;
  line-height: 1.05; letter-spacing: -2px; margin-bottom: 1rem;
}
.hero-text p { font-size: 0.9rem; color: #7a756f; line-height: 1.7; max-width: 340px; }

.hero-featured {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--feat-bg); overflow: hidden;
  min-height: 280px;
}
.feat-img {
  width: 100%; height: 100%; object-fit: contain;
  background: #f5f3f0; padding: 1.5rem;
}
.feat-info {
  padding: 2rem 2.5rem;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.feat-info .feat-tag { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px; color: var(--mute); margin-bottom: 0.5rem; }
.feat-info h2 { font-family: var(--serif); font-size: 1.4rem; color: #fff; margin-bottom: 0.5rem; line-height: 1.3; }
.feat-info .feat-price { font-size: 1.1rem; font-weight: 700; color: #c8dcc8; }

/* ── Filters ── */
.filters {
  display: flex; gap: 0; border-bottom: 1px solid var(--rule);
  max-width: var(--max-w); margin: 0 auto;
}
.filters button {
  padding: 0.75rem 1.5rem; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 1.5px; cursor: pointer; border: none; border-right: 1px solid var(--rule);
  background: transparent; color: var(--mute); font-family: var(--sans);
}
.filters button.active { color: var(--ink); }

/* ── Product grid ── */
.grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  max-width: var(--max-w); margin: 0 auto;
}
.item {
  padding: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.15s;
}
.item:nth-child(4n) { border-right: none; }
.item:hover { background: #f2efea; }
.item-img {
  width: 100%; aspect-ratio: 4/3; overflow: hidden;
  background: #fff; border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
}
.item-img img {
  max-width: 90%; max-height: 90%; object-fit: contain;
}
.item .num { font-size: 0.65rem; color: #b5b0aa; margin: 0.75rem 1.25rem 0; font-variant-numeric: tabular-nums; }
.item h3 {
  font-family: var(--serif); font-size: 0.95rem; line-height: 1.35;
  margin: 0.4rem 1.25rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.item .cat { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--mute); margin: 0 1.25rem 0.75rem; }
.item .row { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1.25rem; }
.item .price { font-weight: 700; font-size: 0.9rem; }
.item .buy-btn {
  font-size: 0.7rem; background: var(--btn); color: #fff;
  padding: 0.3rem 0.7rem; border-radius: 3px; border: none;
  cursor: pointer; font-family: var(--sans); white-space: nowrap;
}
.item .buy-btn:hover { background: #4a6858; }

.empty { padding: 4rem 2rem; text-align: center; color: var(--mute); font-size: 0.9rem; max-width: var(--max-w); margin: 0 auto; }

footer {
  text-align: center; padding: 2rem; font-size: 0.75rem; color: var(--mute);
  border-top: 1px solid var(--rule); margin-top: 2rem;
  max-width: var(--max-w); margin-left: auto; margin-right: auto;
}

@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; }
  .hero-text { border-right: none; border-bottom: 1px solid var(--rule); }
  .hero-text h1 { font-size: 2rem; }
  .hero-featured { grid-template-columns: 1fr; }
  .feat-img { height: 200px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .item:nth-child(2n) { border-right: none; }
  .item:nth-child(4n) { border-right: 1px solid var(--rule); }
  nav { padding: 1rem 1.5rem; gap: 1rem; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .item { border-right: none; }
}

/* ── Product detail ── */
.back {
  display: inline-block; padding: 1rem 2.5rem; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--mute);
  text-decoration: none; border-bottom: 1px solid var(--rule);
  width: 100%; max-width: var(--max-w); margin: 0 auto;
}
.back:hover { color: var(--ink); }

.detail { max-width: var(--max-w); margin: 0 auto; }

.detail-layout {
  display: grid; grid-template-columns: 1fr 360px;
  min-height: 60vh;
}

.detail-main {
  padding: 2.5rem;
  border-right: 1px solid var(--rule);
}

.detail-preview {
  background: #fff; border: 1px solid var(--rule);
  border-radius: 4px; padding: 2rem;
  margin-bottom: 2rem; text-align: center;
}
.detail-preview img {
  max-width: 100%; max-height: 500px; object-fit: contain;
}

.detail-tag {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px;
  color: var(--mute); margin-bottom: 1rem;
}

.detail-title {
  font-family: var(--serif); font-size: 2.2rem; font-weight: 900;
  line-height: 1.15; letter-spacing: -1.5px; margin-bottom: 1.5rem;
}

.detail-desc {
  font-size: 0.95rem; line-height: 1.8; color: #5a5650;
  max-width: 560px; margin-bottom: 2rem;
}

.detail-features {
  list-style: none; padding: 0;
}
.detail-features li {
  font-size: 0.8rem; color: #5a5650; padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.detail-features li::before {
  content: "\2713  "; color: var(--brand); font-weight: 700;
}

.detail-sidebar {
  padding: 2.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
  position: sticky; top: 0; align-self: start;
}

.detail-price {
  font-family: var(--serif); font-size: 2.5rem; font-weight: 900;
}

.detail-buy {
  display: block; width: 100%; padding: 1rem;
  background: var(--btn); color: #fff; border: none;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; cursor: pointer;
  font-family: var(--sans); border-radius: 3px;
}
.detail-buy:hover { background: #4a6858; }
.detail-buy:disabled { opacity: 0.5; cursor: wait; }

.detail-meta {
  font-size: 0.75rem; color: var(--mute); line-height: 2;
  border-top: 1px solid var(--rule); padding-top: 1rem;
}

@media (max-width: 768px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-main { border-right: none; border-bottom: 1px solid var(--rule); }
  .detail-title { font-size: 1.6rem; }
  .detail-price { font-size: 2rem; }
}
