/* ===== PRODUCT DETAILS PAGE ===== */
.pd-header {
  position: fixed; top: 0; left: 0; right: 0; height: 60px;
  background: var(--white); border-bottom: 1px solid var(--border);
  z-index: 200; box-shadow: var(--shadow-xs);
}
.pd-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 14px; max-width: var(--max-w); margin: 0 auto; gap: 10px;
}
.pd-h-left { display: flex; gap: 6px; align-items: center; }
.pd-iconbtn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.pd-iconbtn:hover { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.pd-iconbtn.active i { color: #e53935; }
.pd-h-title { font-size: 1.05rem; font-weight: 900; color: var(--text); margin: 0;
  display: inline-flex; align-items: center; gap: 6px; }
.pd-h-chev { color: var(--text-muted); font-size: 0.78rem; }

.pd-main { padding-top: 0; padding-bottom: 90px; background: var(--bg); min-height: 100vh; }

/* HERO */
.pd-hero {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  margin: 14px 12px 0; padding: 16px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-xs);
}
.pd-hero-imgwrap {
  position: relative;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; min-height: 220px;
}
.pd-hero-imgwrap img { max-width: 100%; max-height: 280px; object-fit: contain; }
.pd-discount-badge {
  position: absolute; top: 12px; inset-inline-start: 12px;
  background: #e53935; color: #fff;
  font-size: 0.82rem; font-weight: 900;
  padding: 5px 12px; border-radius: var(--r-pill);
  z-index: 3;
}
.pd-fav-btn {
  position: absolute; top: 12px; inset-inline-end: 12px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all 0.18s;
}
.pd-fav-btn:hover, .pd-fav-btn.active { background: #ffebee; color: #e53935; border-color: #e53935; }
.pd-slide-indicator {
  position: absolute; bottom: 12px; inset-inline-start: 12px;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  padding: 4px 10px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 4px;
}

.pd-product-info { text-align: start; }
.pd-product-name { font-size: 1.4rem; font-weight: 900; color: var(--text); margin: 0 0 4px; }
.pd-product-desc { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.pd-product-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pd-pbadge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 800;
  background: var(--bg); color: var(--text);
  padding: 4px 10px; border-radius: var(--r-pill);
}
.pd-pbadge-green { background: var(--green-bg); color: var(--green); }
.pd-rating-row {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  margin-top: 10px; font-size: 0.78rem;
}
.pd-rating { display: inline-flex; align-items: center; gap: 4px; color: var(--yellow); font-weight: 800; }
.pd-rating span { color: var(--text); }
.pd-rating-count { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; }
.pd-trend-pill {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 700; color: var(--green);
  background: var(--green-bg);
  padding: 6px 12px; border-radius: var(--r-pill);
}
.pd-trend-pill strong { font-weight: 900; }

/* MINI STATS */
.pd-mini-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 12px 0;
}
.pd-ms-item {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 8px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pd-ms-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.pd-ms-blue { background: #e3f2fd; color: #1976d2; }
.pd-ms-yellow { background: #fff8e1; color: #f57c00; }
.pd-ms-green { background: var(--green-bg); color: var(--green); }
.pd-ms-num { font-size: 1rem; font-weight: 900; color: var(--text); line-height: 1; }
.pd-ms-lbl { font-size: 0.66rem; color: var(--text-muted); font-weight: 700; }

/* OFFERS */
.pd-offers {
  margin: 14px 12px 0; padding: 14px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-xs);
}
.pd-offers-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 10px; flex-wrap: wrap;
}
.pd-offers-title { font-size: 1rem; font-weight: 800; color: var(--text); margin: 0; text-align: start;
  display: inline-flex; align-items: center; gap: 6px; }
.pd-offers-title i { color: var(--yellow); }
.pd-count { color: var(--green); font-weight: 900; }
.pd-sort-btn {
  background: var(--green-bg); color: var(--green);
  border: none; border-radius: var(--r-pill);
  padding: 6px 12px; font-family: var(--font); font-size: 0.74rem; font-weight: 800;
  cursor: pointer;
}
.pd-sort-btn i { font-size: 0.6rem; margin-inline-start: 4px; }

.pd-offer {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  background: var(--white);
}
.pd-offer-best {
  border-color: var(--green); border-width: 2px;
  background: linear-gradient(135deg, #f1f8e9 0%, #ffffff 60%);
}
.pd-best-tag, .pd-rank-tag {
  position: absolute; top: -10px; inset-inline-start: 14px;
  font-size: 0.66rem; font-weight: 900;
  padding: 3px 12px; border-radius: var(--r-pill);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  display: inline-flex; align-items: center; gap: 4px;
}
.pd-best-tag { background: var(--green); color: #fff; }
.pd-best-tag i { color: var(--yellow); }
.pd-rank-tag {
  width: 26px; height: 26px;
  border-radius: 50%;
  padding: 0;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.pd-rank-silver { background: #90a4ae; }
.pd-rank-bronze { background: #a1887f; }

.pd-offer-store { display: flex; align-items: flex-start; gap: 10px; }
.pd-offer-store > img {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: contain; background: #fff; padding: 3px;
  border: 1px solid var(--border); flex-shrink: 0;
}
.pd-offer-store-text { flex: 1; min-width: 0; text-align: start; }
.pd-os-name { font-size: 0.92rem; font-weight: 900; color: var(--text); }
.pd-os-rate { font-size: 0.72rem; font-weight: 800; color: var(--text); margin: 2px 0 6px; }
.pd-os-rate i { color: var(--yellow); font-size: 0.7rem; }
.pd-os-rate span { color: var(--text-muted); font-weight: 600; font-size: 0.66rem; }
.pd-os-cta {
  display: inline-block;
  width: auto;
  min-width: 120px;
  padding: 6px 16px;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font); font-size: 0.72rem; font-weight: 800; color: #fff;
  cursor: pointer; transition: opacity 0.18s;
}
.pd-os-cta:hover { opacity: 0.9; }
.pd-cta-green { background: var(--green); }
.pd-cta-blue { background: #1976d2; }
.pd-cta-yellow { background: var(--yellow); color: #1b5e20; }

.pd-offer-mid { font-size: 0.74rem; text-align: center; line-height: 1.6; }
.pd-mid-row { color: var(--text); font-weight: 700; }
.pd-mid-mut { color: var(--text-muted); font-weight: 600; font-size: 0.7rem; }
.pd-tick { color: var(--green); font-size: 0.7rem; }
.pd-pin { color: var(--text-muted); font-size: 0.7rem; }

.pd-offer-price { text-align: end; }
.pd-price-now {
  font-size: 1.4rem; font-weight: 900; color: var(--green);
  line-height: 1.1;
}
.pd-pdot { color: var(--green); }
.pd-pcur { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; }
.pd-price-row {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.pd-price-was { font-size: 0.72rem; color: var(--text-light); text-decoration: line-through; }
.pd-price-disc {
  background: #ffebee; color: #e53935;
  font-size: 0.66rem; font-weight: 900;
  padding: 2px 8px; border-radius: var(--r-pill);
}
.pd-price-truck {
  margin-top: 6px;
  font-size: 0.7rem; color: var(--green); font-weight: 700;
}
.pd-price-truck i { font-size: 0.7rem; }

.pd-show-all { text-align: center; margin-top: 10px; }
.pd-show-all-btn {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 18px;
  font-family: var(--font); font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: all 0.18s;
}
.pd-show-all-btn:hover { background: var(--green-bg); color: var(--green); border-color: var(--green); }

/* INFO + CHART */
.pd-info-row {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  margin: 14px 12px 0;
}
.pd-info-card, .pd-chart-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-xs);
}
.pd-info-title { font-size: 0.92rem; font-weight: 800; color: var(--text); margin: 0 0 10px; text-align: start; }
.pd-info-list { list-style: none; padding: 0; margin: 0; }
.pd-info-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.78rem;
}
.pd-info-list li:last-child { border-bottom: none; }
.pd-info-list li i {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; flex-shrink: 0;
}
.pd-info-list li span { flex: 0 0 auto; text-align: start; color: var(--text-muted); font-weight: 600; }
.pd-info-list li strong { flex: 1; text-align: start; color: var(--text); font-weight: 800; }

.pd-chart-wrap { position: relative; }
.pd-chart { width: 100%; height: 180px; display: block; }
.pd-chart .grid { stroke: var(--border); stroke-dasharray: 3 3; }
.pd-chart .axis { fill: var(--text-muted); font-size: 9px; font-family: var(--font); text-anchor: end; }
.pd-chart .line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.pd-chart .area { fill: var(--green); opacity: 0.12; }
.pd-chart .dot { fill: var(--green); stroke: #fff; stroke-width: 2; }
.pd-chart-tip {
  position: absolute; transform: translateX(-50%);
  background: var(--green); color: #fff;
  padding: 5px 10px; border-radius: var(--r-sm);
  font-size: 0.7rem; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.pd-chart-tip strong { font-weight: 900; }
.pd-chart-x {
  display: flex; justify-content: space-between;
  /* Pinned to LTR: it labels an SVG whose coordinates never mirror. */
  direction: ltr;
  padding: 4px 6px 0 30px;
  font-size: 0.66rem; color: var(--text-muted); font-weight: 600;
}

/* SIMILAR */
.pd-similar { margin: 14px 12px 0; padding-bottom: 14px; }
.pd-similar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.pd-similar-title { font-size: 0.95rem; font-weight: 800; color: var(--text); margin: 0; }
.pd-similar-all { font-size: 0.74rem; color: var(--green); font-weight: 800; text-decoration: none; }
/* Typography - IBM Plex Sans Arabic for all major titles */
.pd-h-title,
.pd-product-name,
.pd-offers-title,
.pd-info-title,
.pd-similar-title {
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
}

/* Breadcrumb Styles */
.pd-crumb {
  font-family: var(--font);
  padding: 10px 16px;
  margin: 12px 12px 4px;
  background: var(--white);
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: all 0.25s ease;
  overflow: hidden;
}
.pd-crumb .breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0 0 7px;
  margin: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-color: #9ca3af #e5e7eb;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.pd-crumb .breadcrumb-list::-webkit-scrollbar {
  height: 5px;
}
.pd-crumb .breadcrumb-list::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 999px;
}
.pd-crumb .breadcrumb-list::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 999px;
}
.pd-crumb .breadcrumb-item {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.pd-crumb .breadcrumb-item a {
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.pd-crumb .breadcrumb-home-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.pd-crumb .breadcrumb-item a:hover {
  color: var(--green);
}
.pd-crumb .breadcrumb-item a:hover .breadcrumb-home-icon {
  color: var(--green);
}
.pd-crumb .breadcrumb-item + .breadcrumb-item::before {
  content: "\f104"; /* FontAwesome chevron-left */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.65rem;
  color: var(--text-light);
  margin-inline-end: 8px;
  margin-inline-start: 2px;
}
.pd-crumb .breadcrumb-item.active {
  color: var(--green);
  font-weight: 800;
}

/* Similar Products Carousel */
.pd-similar-wrap {
  position: relative;
}
.pd-similar-row {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.pd-similar-row::-webkit-scrollbar { display: none; }
.pd-sim-card {
  position: relative;
  flex-shrink: 0; width: 140px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px;
  text-align: center;
  transition: transform 0.18s, box-shadow 0.18s;
  scroll-snap-align: start;
}
.pd-sim-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.pd-sim-disc {
  position: absolute; top: 6px; inset-inline-start: 6px;
  background: #e53935; color: #fff;
  font-size: 0.62rem; font-weight: 900;
  padding: 2px 7px; border-radius: var(--r-pill);
}
.pd-sim-fav {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
}
.pd-sim-fav:hover, .pd-sim-fav.active { background: #ffebee; color: #e53935; border-color: #e53935; }
.pd-sim-img {
  height: 90px; display: flex; align-items: center; justify-content: center;
  background: var(--bg); border-radius: var(--r-sm);
  margin: 12px 0 8px; padding: 6px;
}
.pd-sim-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pd-sim-name { font-size: 0.72rem; font-weight: 700; color: var(--text); line-height: 1.3; }

/* Arrows custom positioning adjustments */
.pd-similar-wrap .slider-arrow {
  top: 50%;
  transform: translateY(-50%);
}

@media (min-width: 768px) {
  .pd-main { padding-bottom: 0; } /* Remove bottom nav space on desktop */
  .pd-hero { grid-template-columns: 1fr 1fr; }
  .pd-info-row { grid-template-columns: 1fr 1.4fr; }
  .pd-product-name { font-size: 1.6rem; }
  .pd-crumb, .pd-hero, .pd-mini-stats, .pd-offers, .pd-info-row, .pd-similar { margin-inline: 20px; }
  .pd-crumb { padding: 10px 20px; }
}
@media (min-width: 1024px) {
  .pd-main { max-width: none; }
  .pd-crumb, .pd-hero, .pd-mini-stats, .pd-offers, .pd-info-row, .pd-similar { margin-inline: 28px; }
  .pd-crumb { padding: 12px 28px; }
}
@media (min-width: 1200px) {
  .pd-crumb, .pd-hero, .pd-mini-stats, .pd-offers, .pd-info-row, .pd-similar { margin-inline: 48px; }
  .pd-crumb { padding: 12px 32px; }
}
@media (max-width: 480px) {
  .pd-offer { grid-template-columns: 1fr 1fr; padding: 12px; }
  .pd-offer-price { grid-column: 1 / -1; text-align: start; border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 4px; }
  .pd-price-now { font-size: 1.6rem; }
}

/* OFFERS — collapsed extras + empty state */
.pd-offer-hidden { display: none; }
.pd-offers.is-expanded .pd-offer-hidden { display: grid; }
a.pd-os-cta { text-decoration: none; text-align: center; }
.pd-offers-empty {
  text-align: center; padding: 28px 14px; color: var(--text-muted);
  background: var(--white); border: 1px dashed var(--border); border-radius: var(--r-md);
}
.pd-offers-empty i { font-size: 1.6rem; color: var(--text-light); margin-bottom: 8px; display: block; }
.pd-offers-empty p { margin: 0; font-size: 0.85rem; font-weight: 700; }

/* OFFERS — multiple prices from one retailer */
.pd-os-count {
  display: inline-block; vertical-align: middle; margin-inline-start: 6px;
  background: var(--green-bg); color: var(--green);
  border: 1px solid rgba(46,125,50,0.22);
  font-size: 0.62rem; font-weight: 800;
  padding: 1px 7px; border-radius: var(--r-pill); white-space: nowrap;
}
.pd-price-pack { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); margin-top: 2px; }

.pd-variants { grid-column: 1 / -1; margin-top: 4px; }
.pd-variants-toggle {
  width: 100%; display: flex; align-items: center; gap: 7px;
  background: transparent; border: 0; border-top: 1px dashed var(--border);
  padding: 9px 2px 0; margin-top: 4px; cursor: pointer;
  font-family: inherit; font-size: 0.72rem; font-weight: 800; color: var(--text-muted);
  transition: color 0.18s;
}
.pd-variants-toggle:hover { color: var(--green); }
.pd-variants-toggle > span { flex: 1; text-align: start; }
.pd-variants-toggle i:first-child { color: var(--green); font-size: 0.72rem; }
.pd-variants-chev { transition: transform 0.22s; font-size: 0.66rem; }
.pd-variants.is-open .pd-variants-chev { transform: rotate(180deg); }

.pd-variants-list { display: none; list-style: none; margin: 8px 0 0; padding: 0; }
.pd-variants.is-open .pd-variants-list { display: block; }
.pd-variant {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 9px; border-radius: var(--r-sm, 8px);
  background: var(--bg); margin-bottom: 5px;
}
.pd-variant.is-best { background: var(--green-bg); }
.pd-variant-pack { font-size: 0.74rem; font-weight: 800; color: var(--text); }
.pd-variant-flag {
  font-style: normal; font-size: 0.6rem; font-weight: 900;
  background: var(--green); color: #fff; padding: 1px 6px;
  border-radius: var(--r-pill); margin-inline-start: 5px;
}
.pd-variant-prices { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pd-variant-prices b { font-size: 0.82rem; font-weight: 900; color: var(--green); }
.pd-variant-prices s { font-size: 0.68rem; color: var(--text-light); }
.pd-variant-disc {
  font-style: normal; font-size: 0.62rem; font-weight: 900;
  color: #c62828; background: #ffebee; padding: 1px 5px; border-radius: var(--r-pill);
}
.pd-variant-prices small { font-size: 0.62rem; color: var(--text-muted); font-weight: 700; }
@media (max-width: 600px) {
  .pd-variant { flex-direction: column; align-items: flex-start; gap: 4px; }
  .pd-variant-prices { justify-content: flex-start; }
}
.pd-variant-value { background: #1976d2; }

/* PRICE HISTORY — empty state + dynamic tip */
.pd-chart-empty {
  text-align: center; padding: 30px 14px; color: var(--text-muted);
}
.pd-chart-empty i { font-size: 1.6rem; color: var(--text-light); margin-bottom: 8px; display: block; }
.pd-chart-empty p { margin: 0; font-size: 0.82rem; font-weight: 700; }
.pd-chart .dot { cursor: pointer; }
.pd-chart-x span { direction: rtl; unicode-bidi: isolate; }

/* SIMILAR PRODUCTS — same white card as .pd-offers / .pd-info-card.
   Padding only: the margin-inline breakpoints above must still win. */
.pd-similar {
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.pd-similar-row { padding-bottom: 2px; }
.pd-sim-card { background: var(--bg); }

/* The fixed bottom-nav clearance was sitting between <main> and the footer,
   showing as a large empty gap. Move it into the footer instead. */
.pd-main { padding-bottom: 16px; }
@media (max-width: 767px) {
  .app-footer-custom { padding-bottom: calc(var(--bnav-h, 64px) + 12px); }
}
/* Similar cards are links now — keep them looking like cards, not text links. */
a.pd-sim-card { text-decoration: none; color: inherit; display: block; }
a.pd-sim-card .pd-sim-name { color: var(--text); }
.pd-sim-fav { display: inline-flex; align-items: center; justify-content: center; }
