/* ============================================================
   RJS EXPORTS — Product catalogue
   ============================================================ */

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink-muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.chip:hover {
  border-color: var(--gold-500);
  color: var(--gold-700);
}

.chip.is-active {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: var(--gold-300);
}

.search {
  position: relative;
  flex: 0 1 290px;
  min-width: 200px;
}

.search input {
  width: 100%;
  padding: 11px 40px 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--ink);
}

.search input::placeholder {
  color: var(--ink-soft);
}

.search svg {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
}

.results {
  margin-bottom: 16px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

/* ---------- Product cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: var(--shadow-md);
}

.product-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ivory-200);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.product-card:hover .product-card__media img {
  transform: scale(1.06);
}

.material-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(7, 20, 38, 0.84);
  color: var(--gold-300);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  padding: 14px 16px 16px;
}

.product-card__body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.25;
}

.product-card__body p {
  flex: 1;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.product-card__meta {
  margin-top: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-700);
}

.product-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.btn--tiny {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.btn--ghost {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  color: var(--gold-700);
  border-color: var(--gold-500);
}

.empty {
  padding: 46px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: 0.92rem;
}

/* ---------- Detail dialog ---------- */
dialog.modal {
  width: min(880px, 92vw);
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

dialog.modal::backdrop {
  background: rgba(5, 15, 28, 0.74);
  backdrop-filter: blur(3px);
}

.modal__wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal__media {
  background: var(--ivory-200);
}

.modal__media img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

.modal__body {
  max-height: 88vh;
  padding: clamp(22px, 2.4vw, 32px);
  overflow-y: auto;
}

.modal__body h2 {
  margin: 6px 0 10px;
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
}

.modal__body p {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--ink-muted);
}

.modal__body p + p {
  margin-top: 10px;
}

.modal__specs {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 14px 0;
  border-block: 1px solid var(--line);
  font-size: 0.86rem;
}

.modal__specs div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.modal__specs dt {
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.modal__specs dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--ink);
}

.modal__close svg {
  width: 15px;
  height: 15px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .modal__wrap {
    grid-template-columns: 1fr;
  }

  .modal__media img {
    min-height: 200px;
    max-height: 220px;
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    align-items: stretch;
  }

  .search {
    flex: 1 1 100%;
  }

  .product-card__actions .btn {
    flex: 1;
    justify-content: center;
  }
}
