/* ======================================================
   REREADIA — Shop/Category pages shared styles
   (jee, neet, novels, text listing pages)
====================================================== */

/* ── Google Fonts (already in style.css but ensure Playfair) ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800;900&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── Category hero banner ── */
.cat-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4338ca 100%);
  padding: 3.5rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cat-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(129,140,248,.18) 0%, transparent 60%),
                    radial-gradient(circle at 80% 20%, rgba(99,102,241,.14) 0%, transparent 50%);
  pointer-events: none;
}
.cat-hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.cat-hero-label {
  display: inline-block;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.88);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: .3rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2);
  margin-bottom: 1rem;
}
.cat-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: .6rem;
}
.cat-hero p {
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  line-height: 1.6;
}

/* ── Toolbar: breadcrumb + filters ── */
.shop-toolbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 69px;
  z-index: 80;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.shop-toolbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: .75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.shop-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: #9ca3af;
  flex-shrink: 0;
}
.shop-breadcrumb a {
  color: #6b7280;
  text-decoration: none;
  transition: color .15s;
}
.shop-breadcrumb a:hover { color: #4f46e5; }
.shop-breadcrumb-sep { color: #d1d5db; }
.shop-breadcrumb-cur { color: #374151; font-weight: 600; }

.shop-filters {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-left: auto;
}
.filter-label {
  font-size: .72rem;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.shop-select {
  appearance: none;
  -webkit-appearance: none;
  background: #f9fafb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  background-size: 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: .48rem 2rem .48rem .8rem;
  font-size: .78rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  min-width: 110px;
}
.shop-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background-color: #fff;
}
.shop-select:hover { border-color: #a5b4fc; }

/* ── Products main area ── */
.products-page { padding: 0; }
.shop-grid-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}
.shop-result-count {
  font-size: .78rem;
  color: #9ca3af;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

/* ── Product grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.5rem;
}

/* ── New product card ── */
.product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, border-color .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(79,70,229,.13);
  border-color: #a5b4fc;
}

/* Image area */
.pc-img-link { display: block; text-decoration: none; }
.pc-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4 !important;
  height: auto !important;
  overflow: hidden;
  background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
  flex-shrink: 0;
}
/* Override style.css height:210px rule with higher specificity */
.product-card .pc-img-box img,
.product-card > .pc-img-link > .pc-img-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top !important;
  display: block !important;
  transition: transform .55s cubic-bezier(.16,1,.3,1) !important;
}
.product-card:hover .pc-img-box img {
  transform: scale(1.07) !important;
}
.pc-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: #cbd5e1;
  background: linear-gradient(145deg, #f8fafc, #f1f5f9);
}

/* Stock badge on image */
.pc-stock-pill {
  position: absolute;
  top: .7rem;
  left: .7rem;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .28rem .75rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.pill-in  { background: rgba(5,150,105,.82); color: #fff; }
.pill-out { background: rgba(220,38,38,.75); color: #fff; }

/* Card body */
.pc-body {
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  flex: 1;
}
.pc-lang {
  font-size: .6rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}
.pc-title {
  font-size: .88rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
  transition: color .15s;
}
.pc-title:hover { color: #4f46e5; }
.pc-desc {
  font-size: .75rem;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: -.1rem;
}
.pc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .1rem;
}

/* Card actions */
.pc-actions {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-top: auto;
  padding-top: .65rem;
}
.pc-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}
.pc-btn-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .58rem .6rem;
  background: #fff;
  color: #4f46e5;
  border: 1.5px solid #4f46e5;
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .12s;
  white-space: nowrap;
  position: relative;
  z-index: 10;
}
.pc-btn-cart:hover:not(:disabled) {
  background: #eef2ff;
  transform: translateY(-1px);
}
.pc-btn-cart:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
}
.pc-btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .58rem .6rem;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .12s, box-shadow .15s;
  box-shadow: 0 3px 10px rgba(79,70,229,.3);
  white-space: nowrap;
  position: relative;
  z-index: 10;
}
.pc-btn-buy:hover:not(:disabled) {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(79,70,229,.38);
}
.pc-btn-buy:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}
.pc-btn-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .42rem .6rem;
  background: transparent;
  color: #6b7280;
  border: none;
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: color .15s;
  letter-spacing: .01em;
}
.pc-btn-view:hover { color: #4f46e5; }

/* Loading / empty state */
.loading-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: #9ca3af;
  font-size: .95rem;
  font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .cat-hero h1 { font-size: 2.4rem; }
}

@media (max-width: 768px) {
  /* Hero */
  .cat-hero { padding: 2.2rem 1.25rem 1.75rem; }
  .cat-hero h1 { font-size: 2rem; }
  .cat-hero p { font-size: .8rem; }

  /* Toolbar — stack breadcrumb above filters */
  .shop-toolbar { top: var(--mob-header-stack-h, 56px); }
  .shop-toolbar-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: .6rem 1rem;
    gap: .55rem;
  }
  .filter-label { display: none; }
  .shop-filters {
    margin-left: 0;
    width: 100%;
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .shop-filters::-webkit-scrollbar { display: none; }
  .shop-select {
    flex: 1;
    min-width: 100px;
    font-size: .72rem;
    padding: .42rem .55rem;
  }

  /* Grid & cards */
  .shop-grid-wrap { padding: 1rem .9rem; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: .85rem; }
  .pc-body { padding: .75rem .75rem .85rem; }
  .pc-title { font-size: .82rem; }
  .pc-btn-cart, .pc-btn-buy { font-size: .69rem; padding: .5rem .4rem; }
  .pc-btn-view { font-size: .66rem; padding: .36rem .4rem; }
}

@media (max-width: 480px) {
  .cat-hero h1 { font-size: 1.75rem; }
  .cat-hero p { font-size: .76rem; }
  .shop-breadcrumb { font-size: .7rem; }
  .product-grid { gap: .6rem; }
  .pc-body { padding: .65rem .65rem .75rem; }
  .pc-title { font-size: .78rem; }
  .pc-btn-cart, .pc-btn-buy { font-size: .65rem; padding: .46rem .35rem; gap: .2rem; }
  .pc-actions-row { gap: .35rem; }
}

@media (max-width: 360px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .pc-btn-cart, .pc-btn-buy { font-size: .62rem; padding: .42rem .28rem; }
}
