/* ============================================================
   productList.css — Toywallah Product Listing Page
   ============================================================ */

.pl-page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.pl-breadcrumb {
  font-size: 13px;
  color: var(--tw-muted);
  margin-bottom: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.pl-breadcrumb a { color: var(--tw-blue); text-decoration: none; }
.pl-breadcrumb a:hover { text-decoration: underline; color: var(--tw-red); }

.pl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.pl-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--tw-text);
  margin: 0;
  font-family: var(--font);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.pl-result-count { font-size: 14px; font-weight: 400; color: var(--tw-muted); }
.pl-sort-form  { display: flex; align-items: center; gap: 8px; }
.pl-sort-label { font-size: 13px; color: var(--tw-muted); font-weight: 500; }
.pl-sort-select {
  padding: 7px 12px;
  border: 1px solid var(--tw-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--tw-white);
  color: var(--tw-text);
  cursor: pointer;
  outline: none;
}
.pl-sort-select:focus { border-color: var(--tw-orange); }

/* ── Layout ── */
.pl-body { display: flex; gap: 20px; align-items: flex-start; }

/* ══════════════
   SIDEBAR
   ══════════════ */
.pl-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--tw-white);
  border: 1px solid var(--tw-border);
  border-radius: 16px;
  padding: 20px 16px;
  position: sticky;
  top: 80px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sf-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tw-bg);
}
.sf-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.sf-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tw-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  font-family: var(--font);
}
.sf-options { display: flex; flex-direction: column; gap: 8px; }
.sf-opt {
  font-size: 13px;
  color: var(--tw-text);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s;
}
.sf-opt:hover { color: var(--tw-orange); }
.sf-opt input { cursor: pointer; accent-color: var(--tw-orange); width: 14px; height: 14px; flex-shrink: 0; }
.sf-price-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sf-price-input {
  width: 76px;
  padding: 6px 8px;
  border: 1px solid var(--tw-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--tw-text);
  outline: none;
  transition: border-color 0.15s;
}
.sf-price-input:focus { border-color: var(--tw-orange); }
.sf-apply-btn {
  width: 100%;
  padding: 10px;
  background: var(--tw-orange);
  color: var(--tw-navy);
  border: none;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}
.sf-apply-btn:hover { background: var(--tw-orange-d); }
.sf-clear-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--tw-blue);
  margin-top: 10px;
  text-decoration: none;
  font-weight: 600;
}
.sf-clear-link:hover { color: var(--tw-red); text-decoration: underline; }

/* ══════════════
   GRID
   ══════════════ */
.pl-main { flex: 1; min-width: 0; }

.pl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* ══════════════════════════════════
   PRODUCT CARD — all equal height
   KEY: pcard is flex column + height:100%
        pc-spacer grows to push buttons down
   ══════════════════════════════════ */
.pcard {
  background: var(--tw-white);
  border: 1px solid var(--tw-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  height: 100%;                          /* fill grid cell */
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.pcard:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.14);
  transform: translateY(-2px);
}

/* Image — fixed square, never compresses */
.pc-img-wrap {
  position: relative;
  background: #f5f5f5;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  overflow: hidden;
}
.pc-img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 8px;
  display: block;
  transition: transform 0.3s;
}
.pcard:hover .pc-img { transform: scale(1.06); }

/* Badges */
.badge-row {
  position: absolute;
  top: 10px; left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}
.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
  white-space: nowrap;
  line-height: 1.3;
}
.b-feat { background: #6741D9;          color: #fff; }
.b-low  { background: var(--tw-red);    color: #fff; }
.b-new  { background: var(--tw-green);  color: #fff; }
.b-type { background: var(--tw-orange); color: var(--tw-navy); }

/* Wishlist */
.pc-wish {
  position: absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--tw-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s, color 0.2s;
}
.pc-wish:hover { transform: scale(1.18); color: var(--tw-red); }

/* ── Card Body ──
   flex:1 means it fills all remaining height after the image.
   Each child inside is flex-shrink:0 so it never collapses.
   pc-spacer is flex:1 — it absorbs leftover space and
   shoves delivery + stock + buttons to the very bottom.
*/
.pc-body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Name: exactly 2 lines — same height on every card */
.pc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tw-text);
  line-height: 1.45;
  height: calc(13px * 1.45 * 2);        /* exactly 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 6px;
  font-family: var(--font);
}

/* Rating: always 18px tall even when empty */
.pc-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  min-height: 18px;
  flex-shrink: 0;
  margin-bottom: 4px;
}
.pc-stars     { color: #FF8F00; letter-spacing: 1px; }
.pc-rcount    { color: var(--tw-muted); }
.pc-no-rating { color: #ccc; font-size: 11px; font-style: italic; }

/* Meta rows: always 16px tall — &nbsp; fills empty ones */
.pc-meta {
  font-size: 11px;
  color: var(--tw-muted);
  font-weight: 500;
  min-height: 16px;
  flex-shrink: 0;
  line-height: 1.4;
  margin-bottom: 2px;
}

/* Price */
.pc-price-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 6px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.price-mrp { font-size: 11px; color: var(--tw-muted); }
.price-now {
  font-size: 20px;
  font-weight: 800;
  color: var(--tw-text);
  font-family: var(--font);
  line-height: 1;
}
.price-now sup { font-size: 12px; vertical-align: super; font-weight: 700; }

/* THE KEY — spacer grows to consume all leftover space
   This is what makes buttons land at the same Y on every card */
.pc-spacer {
  flex: 1;
  min-height: 8px;
}

/* Delivery — always at bottom above stock */
.pc-delivery {
  font-size: 12px;
  color: var(--tw-muted);
  line-height: 1.4;
  flex-shrink: 0;
  margin-top: 8px;
}
.pc-delivery strong { color: var(--tw-green); font-weight: 700; }

/* Stock — always 18px tall (&nbsp; = invisible placeholder) */
.pc-stock {
  font-size: 11px;
  color: var(--tw-red);
  font-weight: 700;
  min-height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  line-height: 1.4;
}

/* Buttons — always at very bottom, equal width */
.pc-btns {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-shrink: 0;
}
.btn-cart,
.btn-buy {
  flex: 1;
  padding: 9px 4px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-cart {
  background: var(--tw-orange);
  color: var(--tw-navy);
  border: 1px solid var(--tw-orange-d);
}
.btn-cart:hover  { background: var(--tw-orange-d); }
.btn-cart.added  { background: #22C55E; color: #fff; border-color: #16A34A; }
.btn-buy {
  background: #FFA41C;
  color: var(--tw-navy);
  border: 1px solid var(--tw-orange-d);
}
.btn-buy:hover { background: var(--tw-orange-d); }
.btn-oos {
  flex: 1;
  padding: 9px 4px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  background: #f0f0f0;
  color: #aaa;
  border: 1px solid var(--tw-border);
  cursor: not-allowed;
}

/* ══════════════
   PAGINATION
   ══════════════ */
.pl-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.pl-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--tw-border);
  text-decoration: none;
  font-size: 14px;
  font-family: var(--font);
  color: var(--tw-text);
  font-weight: 500;
  background: var(--tw-white);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.pl-page-btn:hover  { background: var(--tw-bg); border-color: var(--tw-orange); }
.pl-page-btn.active { background: var(--tw-orange); color: var(--tw-navy); border-color: var(--tw-orange-d); font-weight: 700; }
.pl-prev, .pl-next  { padding: 0 14px; font-weight: 700; }

/* ══════════════
   EMPTY STATE
   ══════════════ */
.pl-empty { text-align: center; padding: 60px 20px; color: var(--tw-muted); }
.pl-empty-ico  { font-size: 64px; margin-bottom: 16px; }
.pl-empty-msg  { font-size: 18px; font-weight: 700; color: var(--tw-text); margin-bottom: 12px; font-family: var(--font); }
.pl-empty-link { color: var(--tw-blue); text-decoration: none; font-size: 15px; font-weight: 600; }
.pl-empty-link:hover { color: var(--tw-red); text-decoration: underline; }

/* ══════════════
   RESPONSIVE
   ══════════════ */
@media (max-width: 1100px) { .pl-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .pl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .pl-body    { flex-direction: column; }
  .pl-sidebar { width: 100%; position: static; }
  .pl-grid    { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
  .pl-page { padding: 12px 12px 32px; }
  .pl-grid { gap: 10px; }
  .btn-cart, .btn-buy { font-size: 11px; padding: 8px 2px; }
  .price-now { font-size: 17px; }
}
