/* ──────────────────────────────────────────
   products.css — products.php (product directory / search)
────────────────────────────────────────── */
:root {
  --ink:     #0f1409;
  --ink2:    #2a3020;
  --forest:  #1e4620;
  --moss:    #3a6b3c;
  --sage:    #6d9b6f;
  --cream:   #f5f0e8;
  --parchment: #ede7d9;
  --warm:    #e8dfc8;
  --amber:   #c8861a;
  --amber2:  #e09a20;
  --rust:    #c04a1a;
  --border:  #d4cabb;
  --border2: #c0b8a8;

  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-head:    'Syne', sans-serif;
  --ff-body:    'Instrument Sans', sans-serif;

  --r:   14px;
  --r2:  22px;
  --r3:  32px;
  --sh:  0 4px 24px rgba(15,20,9,.10);
  --sh2: 0 12px 48px rgba(15,20,9,.16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--ff-body);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
}

/* ── WRAP ── */
.pw { max-width: 1260px; margin: 0 auto; padding: 0 24px 80px; }

/* ──────────────────────────────────────────
   MASTHEAD
────────────────────────────────────────── */
.masthead {
  position: relative;
  background: var(--forest);
  overflow: hidden;
  padding: 52px 52px 48px;
  margin-bottom: 36px;
}

/* decorative ruled lines */
.masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,.04) 0px,
      rgba(255,255,255,.04) 1px,
      transparent 1px,
      transparent 80px
    );
  pointer-events: none;
}

/* large faded letterform */
.masthead::after {
  content: 'P';
  position: absolute;
  right: -24px;
  bottom: -40px;
  font-family: var(--ff-display);
  font-size: 320px;
  font-weight: 900;
  color: rgba(255,255,255,.04);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.masthead-eyebrow {
  font-family: var(--ff-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--amber2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.masthead-eyebrow::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--amber2);
  opacity: .6;
}

.masthead h1 {
  font-family: var(--ff-display);
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 900;
  color: var(--cream);
  line-height: 1.0;
  letter-spacing: -1.5px;
  margin-bottom: 10px;
}

.masthead h1 em {
  font-style: italic;
  color: var(--amber2);
}

.masthead-sub {
  color: rgba(245,240,232,.65);
  font-size: 15px;
  line-height: 1.6;
  max-width: 440px;
  margin-bottom: 32px;
}

/* count badge */
.count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--ff-head);
  font-size: 12px;
  font-weight: 700;
  color: rgba(245,240,232,.85);
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
}
.count-badge strong { color: var(--amber2); }

/* ── Search form ── */
.search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.search-wrap i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(245,240,232,.5);
  font-size: 14px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  border-radius: var(--r2);
  border: 1.5px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color: var(--cream);
  font-family: var(--ff-body);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, background .2s;
  backdrop-filter: blur(8px);
}
.search-input::placeholder { color: rgba(245,240,232,.5); }
.search-input:focus {
  border-color: var(--amber2);
  background: rgba(255,255,255,.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--r2);
  font-family: var(--ff-head);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-amber {
  background: linear-gradient(135deg, var(--amber), var(--amber2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(200,134,26,.4);
}
.btn-amber:hover { box-shadow: 0 8px 24px rgba(200,134,26,.5); }

.btn-outline-light {
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.22);
  color: var(--cream);
  backdrop-filter: blur(8px);
}
.btn-outline-light:hover { background: rgba(255,255,255,.14); }

/* ──────────────────────────────────────────
   FILTER BAR
────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: var(--sh);
}
.filter-bar-label {
  font-family: var(--ff-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--sage);
  white-space: nowrap;
  margin-right: 4px;
}
.filter-select {
  padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--ff-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236d9b6f'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color .18s;
}
.filter-select:focus { border-color: var(--forest); }
.filter-divider { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }
.filter-clear {
  margin-left: auto;
  font-family: var(--ff-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--rust);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  transition: all .15s;
}
.filter-clear:hover { border-color: var(--rust); background: rgba(192,74,26,.05); }
.active-filter-count {
  background: var(--forest);
  color: var(--cream);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 2px;
}

/* ──────────────────────────────────────────
   TOOLBAR
────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.toolbar-left {
  font-family: var(--ff-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar-left .q-tag {
  background: var(--forest);
  color: var(--cream);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
}

/* ──────────────────────────────────────────
   PRODUCT GRID
────────────────────────────────────────── */
.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

/* ── Card ── */
.pcard {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s;
  animation: cardIn .4s ease both;
}
.pcard:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh2);
}
.pcard.is-sponsored {
  border-color: rgba(200,134,26,.72);
  box-shadow: 0 8px 30px rgba(200,134,26,.14);
}
.sponsored-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff4d5;
  color: #79530b;
  border: 1px solid rgba(200,134,26,.35);
  font-family: var(--ff-head);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* staggered delay via nth-child */
.pcard:nth-child(1)  { animation-delay: .04s }
.pcard:nth-child(2)  { animation-delay: .08s }
.pcard:nth-child(3)  { animation-delay: .12s }
.pcard:nth-child(4)  { animation-delay: .16s }
.pcard:nth-child(5)  { animation-delay: .20s }
.pcard:nth-child(6)  { animation-delay: .24s }
.pcard:nth-child(7)  { animation-delay: .28s }
.pcard:nth-child(8)  { animation-delay: .32s }
.pcard:nth-child(9)  { animation-delay: .36s }
.pcard:nth-child(10) { animation-delay: .40s }
.pcard:nth-child(11) { animation-delay: .44s }
.pcard:nth-child(12) { animation-delay: .48s }

/* ── Image area ── */
.pcard-img {
  width: 100%;
  height: 190px;
  background: var(--parchment);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.pcard-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.pcard:hover .pcard-img img { transform: scale(1.05); }

/* Fallback placeholder icon */
.pcard-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px;
  color: var(--border2);
}
.pcard-img-placeholder i { font-size: 38px; opacity: .5; }
.pcard-img-placeholder span { font-family: var(--ff-head); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; opacity: .45; }

/* Kind badge on image */
.kind-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--forest);
  color: var(--cream);
  font-family: var(--ff-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Stock badge on image */
.stock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--ff-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
}

/* ── Card body ── */
.pcard-body {
  padding: 18px 20px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pcard-origin {
  font-family: var(--ff-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pcard-name {
  font-family: var(--ff-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 14px;
  flex: 1;
}

/* price + moq row */
.pcard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.pcard-price {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pcard-price-label {
  font-family: var(--ff-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sage);
}
.pcard-price-val {
  font-family: var(--ff-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.pcard-price-val span { font-size: 14px; font-weight: 400; color: var(--sage); }

.pcard-moq {
  text-align: right;
}
.pcard-moq-label {
  font-family: var(--ff-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sage);
}
.pcard-moq-val {
  font-family: var(--ff-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink2);
  margin-top: 2px;
}

/* ── Card footer ── */
.pcard-footer {
  padding: 12px 20px 16px;
  display: flex;
  gap: 10px;
}

.btn-view {
  flex: 1;
  justify-content: center;
  background: var(--forest);
  color: var(--cream);
  border-radius: var(--r);
  padding: 11px 16px;
  font-size: 13px;
  box-shadow: 0 3px 12px rgba(30,70,32,.25);
}
.btn-view:hover { box-shadow: 0 6px 20px rgba(30,70,32,.35); }

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all .18s;
  flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-2px); }

/* date chip */
.pcard-date {
  font-family: var(--ff-head);
  font-size: 10px;
  color: var(--border2);
  font-weight: 600;
  letter-spacing: .5px;
  text-align: right;
  padding: 0 20px 10px;
}

/* ──────────────────────────────────────────
   EMPTY STATE
────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r2);
}
.empty-state-icon {
  width: 80px; height: 80px;
  background: var(--parchment);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px; color: var(--border2);
}
.empty-state h3 {
  font-family: var(--ff-display);
  font-size: 26px;
  color: var(--ink);
  margin-bottom: 8px;
}
.empty-state p { color: var(--sage); font-size: 15px; line-height: 1.6; }

/* ──────────────────────────────────────────
   PAGINATION
────────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pager-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink2);
  font-family: var(--ff-head);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all .18s;
  box-shadow: 0 2px 8px rgba(15,20,9,.06);
}
.pager-btn:hover {
  border-color: var(--forest);
  color: var(--forest);
  transform: translateY(-2px);
}
.pager-btn.active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30,70,32,.30);
}
.pager-btn.wide { width: auto; padding: 0 18px; }
.pager-dots { color: var(--border2); font-weight: 700; padding: 0 4px; }

/* ──────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 720px) {
  .masthead { padding: 36px 24px 32px; }
  .masthead h1 { font-size: 38px; }
  .masthead::after { font-size: 180px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .filter-bar { gap: 8px; }
  .filter-divider { display: none; }
}
@media (max-width: 480px) {
  .pgrid { grid-template-columns: 1fr; }
  .search-form { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .filter-select { width: 100%; }
}
