/* =====================================================================
   PDP REDESIGN — Krishna Supermarket
   Conversion-first, mobile-first Product Details Page.
   Extends the existing design system (style.css tokens).
   ===================================================================== */

:root {
  --pd-line: #e8eeea;
  --pd-line-soft: #f1f4f2;
  --pd-muted: #6c757d;
  --pd-ink: #1f2a24;
  --pd-green-soft: #f0fff6;
  --pd-green-tint: #eaf7ef;
  --pd-amber: #b86e00;
  --pd-amber-soft: #fff7e6;
  --pd-star: #f5a623;
  --pd-radius: 14px;
  --pd-shadow-card: 0 1px 2px rgba(16, 40, 28, .04), 0 6px 24px rgba(16, 40, 28, .06);
  --pd-shadow-pop: 0 12px 34px rgba(16, 40, 28, .12);
}

.pd-page { background-color: #fafbfa; padding-bottom: 96px; }
@media (min-width: 992px) { .pd-page { padding-bottom: 32px; } }

/* ---------- generic surface card ---------- */
.pd-card {
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: var(--pd-radius);
  box-shadow: var(--pd-shadow-card);
}
.pd-section-title {
  font-size: var(--font-size-18);
  font-weight: var(--font-weight-700);
  color: var(--dark-color);
  margin: 0;
}
.pd-section-sub { font-size: var(--font-size-12); color: var(--pd-muted); }
.pd-link {
  color: var(--primary-color);
  font-weight: var(--font-weight-600);
  font-size: var(--font-size-13, 13px);
  text-decoration: none;
  white-space: nowrap;
}
.pd-link:hover { color: var(--secondary-color); }

/* =====================================================================
   GALLERY
   ===================================================================== */
.pd-gallery-wrap { display: flex; gap: 12px; }
.pd-thumb-rail {
  display: flex; flex-direction: column; gap: 10px;
  width: 68px; flex-shrink: 0; max-height: 460px; overflow-y: auto;
}
.pd-thumb-rail::-webkit-scrollbar { width: 4px; }
.pd-thumb-rail::-webkit-scrollbar-thumb { background: #d6e7dc; border-radius: 10px; }
.pd-thumb {
  width: 64px; height: 64px; padding: 4px; border: 2px solid var(--pd-line);
  border-radius: 10px; background: #fff; cursor: pointer; flex-shrink: 0;
  transition: border-color var(--transition-speed), transform var(--transition-speed);
}
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumb:hover { border-color: #9ccbae; }
.pd-thumb.active { border-color: var(--primary-color); }

.pd-stage {
  position: relative; flex: 1; background: #fff;
  border: 1px solid var(--pd-line); border-radius: var(--pd-radius);
  min-height: 360px; display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: hidden;
}
.pd-stage img {
  width: 100%; max-height: 410px; object-fit: contain;
  transition: opacity .15s ease, transform .25s ease; cursor: zoom-in;
}
.pd-stage.zoomed img { transform: scale(1.9); cursor: zoom-out; }

.pd-badge-discount {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: var(--primary-color); color: #fff;
  font-size: var(--font-size-12); font-weight: var(--font-weight-700);
  padding: 5px 10px; border-radius: 8px; line-height: 1.2; text-align: center;
}
.pd-icon-btn {
  position: absolute; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--pd-line); background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--dark-color); transition: all var(--transition-speed);
}
.pd-icon-btn:hover { box-shadow: var(--pd-shadow-card); color: var(--primary-color); }
.pd-icon-btn .material-symbols-rounded { font-size: 20px; }
.pd-wish { top: 14px; right: 14px; }
.pd-wish.active { color: var(--secondary-color); }
.pd-wish.active .material-symbols-rounded { font-variation-settings: 'FILL' 1; }
.pd-full { bottom: 14px; right: 14px; }

/* mobile swipe track + dots (hidden on desktop) */
.pd-swipe { display: none; }
.pd-dots { display: none; }

/* =====================================================================
   BUY COLUMN
   ===================================================================== */
.pd-brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pd-brand {
  font-size: var(--font-size-13, 13px); font-weight: var(--font-weight-600);
  color: var(--primary-color); text-transform: uppercase; letter-spacing: .4px;
}
.pd-verified {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px;
  color: var(--primary-color); background: var(--pd-green-tint);
  padding: 2px 7px; border-radius: 20px; font-weight: var(--font-weight-600);
}
.pd-verified .material-symbols-rounded { font-size: 13px; }

.pd-title {
  font-size: var(--font-size-22); font-weight: var(--font-weight-700);
  color: var(--dark-color); line-height: 1.3; margin-bottom: 8px;
}

.pd-rating-inline { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pd-rating-pill {
  display: inline-flex; align-items: center; gap: 4px; background: var(--primary-color);
  color: #fff; font-weight: var(--font-weight-700); font-size: var(--font-size-13, 13px);
  padding: 3px 9px; border-radius: 7px;
}
.pd-rating-pill .material-symbols-rounded { font-size: 15px; font-variation-settings: 'FILL' 1; }
.pd-rating-count { font-size: var(--font-size-13, 13px); color: var(--pd-muted); }
.pd-rating-count a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.pd-stars { color: var(--pd-star); font-size: 16px; line-height: 1; letter-spacing: 1px; }

/* pack/variant pills */
.pd-pack-label { font-size: var(--font-size-13,13px); font-weight: 600; color: var(--dark-color); margin-bottom: 8px; }
.pd-pack-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.pd-pack {
  border: 1.5px solid var(--pd-line); border-radius: 12px; background: #fff;
  padding: 8px 12px; cursor: pointer; min-width: 92px; text-align: left;
  transition: all var(--transition-speed); position: relative;
}
.pd-pack .pd-pack-size { font-size: var(--font-size-13,13px); font-weight: 600; color: var(--dark-color); display: block; }
.pd-pack .pd-pack-price { font-size: var(--font-size-12); color: var(--pd-muted); }
.pd-pack:hover { border-color: #9ccbae; }
.pd-pack.active { border-color: var(--primary-color); background: var(--pd-green-soft); }
.pd-pack .pd-pack-tag {
  position: absolute; top: -9px; right: 8px; background: var(--secondary-color); color: #fff;
  font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 10px; letter-spacing: .3px;
}

/* =====================================================================
   STICKY BUY CARD (desktop)
   ===================================================================== */
.pd-buy-card { padding: 18px; }
@media (min-width: 992px) {
  .pd-buy-card { position: sticky; top: 16px; }
}

.pd-price-block { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.pd-price-now { font-size: var(--font-size-30); font-weight: var(--font-weight-800); color: var(--pd-ink); line-height: 1; }
.pd-price-mrp { font-size: var(--font-size-16); color: #9aa3a0; text-decoration: line-through; }
.pd-price-off { font-size: var(--font-size-14); font-weight: 700; color: var(--primary-color); }
.pd-save {
  display: inline-block; margin-top: 8px; background: var(--pd-amber-soft); color: var(--pd-amber);
  font-size: var(--font-size-12); font-weight: 600; padding: 3px 9px; border-radius: 7px;
}
.pd-tax-note { font-size: var(--font-size-12); color: #99a09c; margin-top: 6px; }

/* stock indicator */
.pd-stock { display: flex; align-items: center; gap: 6px; font-size: var(--font-size-13,13px); font-weight: 600; margin: 12px 0; }
.pd-stock.in { color: var(--primary-color); }
.pd-stock.low { color: var(--pd-amber); }
.pd-stock .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* delivery / pincode */
.pd-delivery {
  border: 1px dashed var(--pd-line); border-radius: 12px; padding: 12px;
  background: #fcfdfc; margin: 14px 0;
}
.pd-delivery-eta { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-13,13px); font-weight: 600; color: var(--dark-color); }
.pd-delivery-eta .material-symbols-rounded { color: var(--primary-color); font-size: 20px; }
.pd-delivery-eta b { color: var(--primary-color); }
.pd-pin {
  display: flex; gap: 8px; margin-top: 10px;
}
.pd-pin input {
  flex: 1; border: 1px solid var(--pd-line); border-radius: 8px; padding: 8px 12px;
  font-size: var(--font-size-13,13px); outline: none;
}
.pd-pin input:focus { border-color: var(--primary-color); }
.pd-pin button {
  border: none; background: var(--pd-green-tint); color: var(--primary-color);
  font-weight: 600; font-size: var(--font-size-13,13px); padding: 0 14px; border-radius: 8px; cursor: pointer;
}

/* qty stepper */
.pd-qty-row { display: flex; align-items: center; gap: 14px; margin: 16px 0; }
.pd-qty-label { font-size: var(--font-size-13,13px); font-weight: 600; color: var(--dark-color); }
.pd-qty {
  display: inline-flex; align-items: center; border: 1.5px solid var(--primary-color);
  border-radius: 10px; overflow: hidden;
}
.pd-qty button {
  width: 38px; height: 40px; border: none; background: var(--pd-green-soft);
  color: var(--primary-color); font-size: 20px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.pd-qty button:disabled { opacity: .4; cursor: not-allowed; }
.pd-qty span { width: 44px; text-align: center; font-weight: 700; color: var(--dark-color); }

/* CTAs */
.pd-cta-row { display: flex; gap: 12px; margin-top: 6px; }
.pd-cta {
  flex: 1; border: none; border-radius: 12px; padding: 14px 12px; font-size: var(--font-size-15,15px);
  font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; transition: all var(--transition-speed); letter-spacing: .2px;
}
.pd-cta .material-symbols-rounded { font-size: 20px; }
.pd-cta-add {
  background: #fff; color: var(--primary-color); border: 1.5px solid var(--primary-color);
}
.pd-cta-add:hover { background: var(--pd-green-soft); }
.pd-cta-buy { background: var(--primary-color); color: #fff; box-shadow: 0 6px 16px rgba(5,103,41,.28); }
.pd-cta-buy:hover { background: #04561f; }

/* =====================================================================
   TRUST ROW
   ===================================================================== */
.pd-trust-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px;
}
.pd-trust-item { text-align: center; }
.pd-trust-item .ic {
  width: 42px; height: 42px; margin: 0 auto 6px; border-radius: 12px; background: var(--pd-green-soft);
  display: flex; align-items: center; justify-content: center; color: var(--primary-color);
}
.pd-trust-item .ic .material-symbols-rounded { font-size: 22px; }
.pd-trust-item span.t { display: block; font-size: 11px; font-weight: 600; color: var(--dark-color); line-height: 1.3; }

/* offers */
.pd-offers { margin-top: 16px; }
.pd-offer {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--pd-line-soft);
}
.pd-offer:last-child { border-bottom: none; }
.pd-offer .material-symbols-rounded { color: var(--primary-color); font-size: 20px; }
.pd-offer p { margin: 0; font-size: var(--font-size-13,13px); color: var(--dark-color); }
.pd-offer p b { color: var(--primary-color); }
.pd-offer small { color: var(--pd-muted); }

/* =====================================================================
   FREQUENTLY BOUGHT TOGETHER
   ===================================================================== */
.pd-fbt { padding: 20px; }
.pd-fbt-track { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-fbt-item {
  display: flex; flex-direction: column; align-items: center; width: 132px; text-align: center;
  border: 1px solid var(--pd-line); border-radius: 12px; padding: 12px 10px; position: relative;
}
.pd-fbt-item img { width: 84px; height: 84px; object-fit: contain; margin-bottom: 8px; }
.pd-fbt-item .nm { font-size: var(--font-size-12); color: var(--dark-color); line-height: 1.3; min-height: 32px; }
.pd-fbt-item .pr { font-size: var(--font-size-13,13px); font-weight: 700; color: var(--pd-ink); margin-top: 4px; }
.pd-fbt-item .chk { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; accent-color: var(--primary-color); }
.pd-fbt-plus { font-size: 26px; color: #b8c2bd; font-weight: 300; }
.pd-fbt-summary {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--pd-line);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.pd-fbt-total { font-size: var(--font-size-14); color: var(--dark-color); }
.pd-fbt-total b { font-size: var(--font-size-20); color: var(--pd-ink); }
.pd-fbt-add {
  background: var(--primary-color); color: #fff; border: none; border-radius: 10px;
  padding: 11px 22px; font-weight: 700; font-size: var(--font-size-14); cursor: pointer; white-space: nowrap;
}
.pd-fbt-add:hover { background: #04561f; }

/* =====================================================================
   PRODUCT INFO ACCORDION
   ===================================================================== */
.pd-acc { border: 1px solid var(--pd-line); border-radius: var(--pd-radius); overflow: hidden; background: #fff; }
.pd-acc-item + .pd-acc-item { border-top: 1px solid var(--pd-line-soft); }
.pd-acc-head {
  width: 100%; border: none; background: #fff; text-align: left; padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  font-size: var(--font-size-15,15px); font-weight: 600; color: var(--dark-color);
}
.pd-acc-head .material-symbols-rounded { transition: transform var(--transition-speed); color: var(--primary-color); }
.pd-acc-head[aria-expanded="true"] .material-symbols-rounded { transform: rotate(180deg); }
.pd-acc-body { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s ease; }
.pd-acc-body.open { max-height: 1200px; padding: 0 18px 18px; }
.pd-acc-body p { font-size: var(--font-size-14); color: #444; line-height: 1.65; margin: 0 0 10px; }
.pd-spec-row { display: flex; padding: 9px 0; border-bottom: 1px solid var(--pd-line-soft); font-size: var(--font-size-14); }
.pd-spec-row:last-child { border-bottom: none; }
.pd-spec-row .k { width: 42%; color: var(--pd-muted); }
.pd-spec-row .v { width: 58%; color: var(--dark-color); font-weight: 500; }
.pd-feature-list { list-style: none; margin: 0; padding: 0; }
.pd-feature-list li { display: flex; gap: 8px; font-size: var(--font-size-14); color: #444; padding: 5px 0; }
.pd-feature-list .material-symbols-rounded { color: var(--primary-color); font-size: 18px; }
.pd-faq-q { font-size: var(--font-size-14); font-weight: 600; color: var(--dark-color); margin: 12px 0 4px; }
.pd-faq-q:first-child { margin-top: 0; }

/* =====================================================================
   REVIEWS
   ===================================================================== */
.pd-reviews { padding: 20px; }
.pd-rev-summary { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.pd-rev-score { text-align: center; min-width: 120px; }
.pd-rev-score .big { font-size: 44px; font-weight: 800; color: var(--pd-ink); line-height: 1; }
.pd-rev-score .of { font-size: var(--font-size-14); color: var(--pd-muted); }
.pd-rev-score .cnt { font-size: var(--font-size-12); color: var(--pd-muted); margin-top: 4px; }
.pd-rev-bars { flex: 1; min-width: 220px; }
.pd-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: var(--font-size-12); color: var(--pd-muted); }
.pd-bar-row .lbl { width: 34px; display: flex; align-items: center; gap: 2px; color: var(--dark-color); }
.pd-bar-row .lbl .material-symbols-rounded { font-size: 13px; color: var(--pd-star); font-variation-settings: 'FILL' 1; }
.pd-bar-track { flex: 1; height: 8px; background: var(--pd-line-soft); border-radius: 10px; overflow: hidden; }
.pd-bar-fill { height: 100%; background: var(--primary-color); border-radius: 10px; }

.pd-rev-photos { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; }
.pd-rev-photos img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--pd-line); }

.pd-rev-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.pd-chip {
  border: 1px solid var(--pd-line); background: #fff; border-radius: 20px; padding: 5px 14px;
  font-size: var(--font-size-12); color: var(--dark-color); cursor: pointer; transition: all var(--transition-speed);
}
.pd-chip.active, .pd-chip:hover { background: var(--pd-green-soft); border-color: var(--primary-color); color: var(--primary-color); }

.pd-review { padding: 14px 0; border-top: 1px solid var(--pd-line-soft); }
.pd-review-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pd-review-top .av {
  width: 34px; height: 34px; border-radius: 50%; background: var(--pd-green-tint); color: var(--primary-color);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--font-size-13,13px);
}
.pd-review-top .nm { font-weight: 600; font-size: var(--font-size-14); color: var(--dark-color); }
.pd-review-vp { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--primary-color); }
.pd-review-vp .material-symbols-rounded { font-size: 13px; }
.pd-review .rstars { color: var(--pd-star); font-size: 13px; letter-spacing: 1px; }
.pd-review p { font-size: var(--font-size-14); color: #444; line-height: 1.6; margin: 6px 0 0; }
.pd-review .when { font-size: var(--font-size-12); color: var(--pd-muted); }

/* =====================================================================
   PRODUCT RAILS (similar / also bought / recently viewed)
   ===================================================================== */
.pd-rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pd-rail { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.pd-rail::-webkit-scrollbar { height: 6px; }
.pd-rail::-webkit-scrollbar-thumb { background: #d6e7dc; border-radius: 10px; }
.pd-prod {
  flex: 0 0 168px; scroll-snap-align: start; background: #fff; border: 1px solid var(--pd-line);
  border-radius: 12px; padding: 12px; position: relative; transition: box-shadow var(--transition-speed), transform var(--transition-speed);
}
.pd-prod:hover { box-shadow: var(--pd-shadow-pop); transform: translateY(-2px); }
.pd-prod .ribbon {
  position: absolute; top: 10px; left: 10px; background: var(--secondary-color); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
}
.pd-prod-img { height: 110px; display: flex; align-items: center; justify-content: center; }
.pd-prod-img img { max-height: 110px; max-width: 100%; object-fit: contain; }
.pd-prod .nm { font-size: var(--font-size-13,13px); color: var(--dark-color); line-height: 1.35; margin: 8px 0 4px; min-height: 36px; }
.pd-prod .rt { font-size: 11px; color: var(--pd-muted); display: flex; align-items: center; gap: 3px; margin-bottom: 4px; }
.pd-prod .rt .material-symbols-rounded { font-size: 12px; color: var(--pd-star); font-variation-settings: 'FILL' 1; }
.pd-prod .pr { font-weight: 700; color: var(--pd-ink); font-size: var(--font-size-14); }
.pd-prod .pr s { font-weight: 400; color: #9aa3a0; font-size: var(--font-size-12); margin-left: 4px; }
.pd-prod .add {
  position: absolute; bottom: 12px; right: 12px; width: 32px; height: 32px; border-radius: 9px;
  border: 1.5px solid var(--primary-color); background: var(--pd-green-soft); color: var(--primary-color);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pd-prod .add .material-symbols-rounded { font-size: 18px; }

/* =====================================================================
   MOBILE STICKY ACTION BAR
   ===================================================================== */
.pd-mobile-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: #fff;
  border-top: 1px solid var(--pd-line); box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px;
}
.pd-mobile-bar .mp { line-height: 1.1; }
.pd-mobile-bar .mp .now { font-size: var(--font-size-18); font-weight: 800; color: var(--pd-ink); }
.pd-mobile-bar .mp .mrp { font-size: var(--font-size-12); color: #9aa3a0; text-decoration: line-through; }
.pd-mobile-bar .mp .off { font-size: 11px; color: var(--primary-color); font-weight: 700; }
.pd-mobile-bar .acts { display: flex; gap: 8px; margin-left: auto; }
.pd-mobile-bar .acts .pd-cta { padding: 11px 16px; font-size: var(--font-size-14); border-radius: 10px; }

@media (min-width: 992px) { .pd-mobile-bar { display: none; } }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 991px) {
  /* gallery → swipe mode */
  .pd-thumb-rail { display: none; }
  .pd-stage { display: none; }
  .pd-swipe {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius); background: #fff; position: relative;
  }
  .pd-swipe::-webkit-scrollbar { display: none; }
  .pd-swipe-slide {
    flex: 0 0 100%; scroll-snap-align: center; min-height: 300px; display: flex;
    align-items: center; justify-content: center; padding: 20px;
  }
  .pd-swipe-slide img { max-height: 280px; max-width: 100%; object-fit: contain; }
  .pd-gallery-mobile { position: relative; }
  .pd-dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
  .pd-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: #cdd8d2; transition: all var(--transition-speed); }
  .pd-dots .dot.active { background: var(--primary-color); width: 20px; border-radius: 4px; }
  /* hide in-page CTAs (mobile uses sticky bar) */
  .pd-buy-card .pd-cta-row { display: none; }
  .pd-buy-card .pd-qty-row { display: none; }
}

@media (max-width: 575px) {
  .pd-title { font-size: var(--font-size-18); }
  .pd-price-now { font-size: var(--font-size-26); }
  .pd-trust-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .pd-fbt-item { width: 116px; }
  .pd-rev-summary { gap: 16px; }
}
