.product-detail-page {
  /* Issue 13: page background gradient — navy (tint) at the TOP fading down to
     cream at the BOTTOM (was a flat white / reversed fill). */
  background: linear-gradient(180deg, #d7e0f1 0%, #eef1f8 22%, #faf5ea 100%);
  background-attachment: fixed;
  color: var(--blue-900);
  direction: rtl;
  text-align: right;
}

.pdp-container {
  /* Match the Home/Landing content container exactly: capped at --page-max
     (1600px) and centered, with a 24px side gutter (16px on ≤767 mobile — see
     the media query below). Horizontal container only. */
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-inline: 24px;
  box-sizing: border-box;
}

.pdp-breadcrumb {
  margin-top: 24px;
  margin-left: auto;
  margin-right: 0;
  width: 311px;
  height: 24px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  color: #a1a1a1;
  font-size: 14px;
  line-height: 20px;
  direction: ltr;
  text-align: right;
}

.pdp-breadcrumb a {
  direction: rtl;
  white-space: nowrap;
}

.pdp-breadcrumb a:first-child {
  color: #525252;
}

/* RTL: flip the chevron separator so it points left (‹) for Arabic. */
.pdp-breadcrumb svg {
  transform: scaleX(-1);
}

.pdp-hero {
  margin-top: 16px;
  position: relative;
  height: 829.2338px;
  direction: rtl;
}

.pdp-info,
.pdp-gallery {
  direction: rtl;
  position: absolute;
  top: 0;
}

.pdp-info {
  left: 0;
  width: 598px;
  height: 829.2338px;
  text-align: right;
}

.pdp-gallery {
  left: 630px;
  width: 650px;
  height: 722px;
}

.pdp-title-row {
  position: absolute;
  top: 0;
  left: 0;
  width: 598px;
  height: 56px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  direction: ltr;
}

.pdp-actions {
  width: 86px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}

.pdp-icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e7edf5;
  border-radius: 50%;
  background: #fff;
}

.pdp-title {
  margin: 0;
  width: 512px;
  height: 56px;
  color: #282828;
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  direction: rtl;
  text-align: right;
}

.pdp-rating {
  position: absolute;
  top: 64px;
  right: 0;
  width: 228px;
  height: 24px;
  margin: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  direction: rtl;
}

.pdp-stars {
  color: #c04a65;
  display: inline-flex;
  align-items: center;
  gap: 0;
  line-height: 1;
}

.pdp-stars--empty {
  color: #d4d4d4;
}

.pdp-stars svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.pdp-rating span {
  color: #90a1b9;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

.pdp-price {
  position: absolute;
  top: 104px;
  right: 0;
  width: 254px;
  height: 36px;
  margin: 0;
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 8px;
  direction: rtl;
  text-align: right;
}

.pdp-price del {
  color: #99a1af;
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
  text-decoration: line-through;
}

.pdp-price strong {
  color: #a50036;
  font-size: 30px;
  line-height: 36px;
  font-weight: 700;
}

.pdp-discount {
  align-self: center;
  margin-inline-start: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #f0445b;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 20px;
  direction: ltr;
  unicode-bidi: isolate;
}

.pdp-divider {
  position: absolute;
  top: 156px;
  left: 0;
  width: 598px;
  height: 1px;
  margin: 0;
  background: #e5e5e5;
}

.pdp-compare {
  position: absolute;
  top: 175.6172px;
  right: 0;
  width: 149px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: var(--blue-700);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  direction: rtl;
  text-align: right;
}

.pdp-feature-list {
  position: absolute;
  top: 221.6172px;
  left: 0;
  width: 598px;
  height: 56px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: start;
  gap: 8px 44px;
  direction: rtl;
  text-align: right;
}

.pdp-feature-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #000;
  font-size: 16px;
  line-height: 24px;
}

.pdp-feature-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ad0ff;
}

.pdp-sale {
  position: absolute;
  top: 293.6172px;
  left: 0;
  margin: 0;
  width: 598px;
  height: 90px;
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 2px;
  background: #ffe7ed;
}

.pdp-sale__title {
  width: auto;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  direction: ltr;
}

.pdp-sale__title b {
  color: #a02830;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.pdp-sale__timer {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  color: #db2c34;
  font-family: Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
}

.pdp-sale__timer b {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.pdp-sale__timer i {
  font-style: normal;
  font-size: 24px;
  font-weight: 700;
}

.pdp-purchase {
  position: absolute;
  top: 419.2334px;
  left: 0;
  margin: 0;
  width: 598px;
  height: 160px;
}

.pdp-info::after {
  content: "";
  position: absolute;
  top: 399.6165px;
  left: 0;
  width: 598px;
  height: 1px;
  background: #e5e5e5;
}

.pdp-qty {
  width: 172px;
  height: 48px;
  margin-right: 0;
  margin-left: auto;
  display: grid;
  grid-template-columns: 41px 58px 41px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  direction: ltr;
}

.pdp-qty button,
.pdp-qty span {
  height: 48px;
  display: grid;
  place-items: center;
  color: #000;
  font-size: 20px;
}

.pdp-qty span {
  background: #fafafa;
  font-size: 18px;
}

.pdp-button {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 99px; /* Figma: pill (rounded-[99px]) */
  border: 1px solid var(--blue-700);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500; /* Figma: GE SS Two Medium */
}

/* "اشتري الآن" = solid navy (primary action); "أضف للسلة" = ghost (outline). */
.pdp-button--cart {
  background: #fff;
  color: var(--blue-700);
}

.pdp-button--buy {
  background: var(--blue-700);
  color: #fff;
}

.pdp-payments {
  position: absolute;
  top: 591.2334px;
  left: 0;
  width: 598px;
  height: 46px;
  margin: 0;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  direction: ltr;
}

.pdp-payments span {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #142688;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.pdp-payments span:nth-child(1),
.pdp-payments span:nth-child(2),
.pdp-payments span:nth-child(3) {
  width: 50px;
}

.pdp-payments span:nth-child(4) {
  width: 65px;
}

.pdp-service-list {
  position: absolute;
  top: 653.2334px;
  left: 0;
  width: 598px;
  height: 176px;
  margin: 0;
  padding: 0 16px;
  display: grid;
  gap: 16px;
}

.pdp-service {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  direction: rtl;
}

.pdp-service > div {
  direction: rtl;
  text-align: right;
}

.pdp-service-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3f8ff;
  color: var(--blue-700);
  font-size: 22px;
}

.pdp-service-icon img,
.pdp-service-icon svg {
  width: 28px;
  height: 28px;
}

.pdp-service h3 {
  margin: 0;
  color: var(--blue-850);
  font-size: 16px;
  line-height: 24px;
}

.pdp-service p {
  margin: 2px 0 0;
  color: var(--blue-800);
  font-size: 14px;
  line-height: 20px;
}

.pdp-gallery-main {
  position: relative;
  width: 566px;
  height: 542px;
  margin: 0;
  padding: 24px;
  border-radius: 8px;
  background: #fafbfc;
  overflow: hidden;
}

.pdp-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pdp-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  left: auto;
  min-width: 96px;
  min-height: 24px;
  padding: 2px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: #5574cc;
  color: #fff;
  font-size: 14px;
  line-height: 20px;
}

.pdp-expand {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: auto;
  top: auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--blue-700);
}

.pdp-thumbs {
  width: 64px;
  height: 353px;
  position: absolute;
  top: 0;
  left: 586px;
  display: grid;
  gap: 10px;
}

.pdp-thumbs img {
  width: 64px;
  height: 65px;
  object-fit: contain;
  padding: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

/* Active thumbnail is driven by the .active class (set on load, on click, and on
   variation change) — not by :first-child, so the highlight tracks the real image. */
.pdp-thumbs img.active {
  border: 2px solid #1d3d7c;
  border-radius: 4px;
}

.pdp-ar {
  position: absolute;
  top: 479px;
  left: 213.5px;
  width: 162px;
  height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #4ad0ff;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.pdp-buyer-card {
  position: relative;
  margin-top: 24px;
  min-height: 156px;
  padding: 16px;
  border-radius: 8px;
  background: #fef1f4;
}

.pdp-buyer-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--blue-700);
}

.pdp-buyer-card p {
  margin: 10px 0 0;
  color: #45556c;
  font-size: 14px;
  line-height: 20px;
}

.pdp-buyer-card strong {
  display: block;
  margin-top: 8px;
  color: #62748e;
  font-size: 16px;
  line-height: 22px;
}

.pdp-section {
  padding: 24px 0;
  border-top: 1px solid #e5e7eb;
}

.pdp-hero + .pdp-section {
  margin-top: 24px;
}

.pdp-section-title {
  margin: 0 0 16px;
  color: var(--blue-850);
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
}

.pdp-details {
  color: var(--blue-850);
  font-size: 16px;
  line-height: 28px;
}

.pdp-details ul {
  margin: 0 0 12px;
  padding-inline-start: 20px;
}

.pdp-video {
  position: relative;
  width: 100%;
  /* Issue 23: proper 16:9 aspect-ratio container instead of a fixed height that
     cropped the video / left black bars. */
  aspect-ratio: 16 / 9;
  height: auto;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}

.pdp-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;              /* Issue 23: no dimming of the video/thumbnail */
}
.pdp-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.pdp-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 30px;
}

.pdp-figma-section {
  width: 100vw;
  margin-inline: calc((100vw - 100%) / -2);
  overflow: hidden;
}

.pdp-figma-section img {
  display: block;
  width: 100%;
  height: auto;
}

/* Technical specs — structured key/value table built from product attributes.
   Full-bleed band with a light background to separate it from the content. */
.pdp-tech-specs {
  width: 100vw;
  margin-inline: calc((100vw - 100%) / -2);
  padding: 56px 0;
  background: #f4f6fb;
  border-top: 1px solid var(--blue-050);
  border-bottom: 1px solid var(--blue-050);
}

.pdp-tech-specs__inner {
  max-width: 960px;
  margin: 0 auto;
  padding-inline: 24px;
}

.pdp-tech-specs__title {
  margin: 0 0 24px;
  padding-bottom: 14px;
  color: var(--blue-850);
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  text-align: center;
  position: relative;
}

.pdp-tech-specs__title::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 50%;
  transform: translateX(50%);
  width: 64px;
  height: 4px;
  border-radius: 4px;
  background: var(--blue-700);
}

.pdp-tech-specs__table {
  margin: 0;
  border: 1px solid var(--blue-050);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.pdp-tech-specs__row {
  display: grid;
  grid-template-columns: 40% 60%;
  align-items: stretch;
}

.pdp-tech-specs__row:nth-child(even) {
  background: #f4f6fb;
}

.pdp-tech-specs__row + .pdp-tech-specs__row {
  border-top: 1px solid var(--blue-050);
}

.pdp-tech-specs__key,
.pdp-tech-specs__val {
  margin: 0;
  padding: 14px 20px;
  color: var(--blue-850);
  font-size: 16px;
  line-height: 26px;
}

.pdp-tech-specs__key {
  font-weight: 700;
  border-inline-end: 1px solid var(--blue-050);
}

.pdp-tech-specs__val {
  font-weight: 400;
}

.pdp-figma-section--specs {
  height: 766px;
}

.pdp-figma-section--specs img {
  height: 766px;
  object-fit: cover;
}

.pdp-figma-section--why {
  height: 986px;
}

.pdp-figma-section--why img {
  height: 986px;
  object-fit: cover;
  object-position: top center;
}

.product-detail-page [data-figma-id="8927:49284"] {
  height: 168px;
  padding: 0 0 32px;
  border-top: 0;
  border-bottom: 1px solid #e5e7eb;
}

.product-detail-page [data-figma-id="8927:49284"] .pdp-section-title {
  margin-bottom: 8px;
}

.product-detail-page [data-figma-id="9213:58309"] {
  height: 525px;
  margin-top: 24px;
  padding: 0;
  border-top: 0;
}

.product-detail-page [data-figma-id="9213:58309"] .pdp-section-title {
  margin-bottom: 16px;
}

.product-detail-page [data-figma-id="8933:31704"] {
  margin-top: 9px;
  padding: 24px 0;
}

.product-detail-page [data-figma-id="8933:31704"] .pdp-section-title {
  margin-bottom: 24px;
}

.product-detail-page [data-figma-id="8933:31901"] {
  margin-top: 24px;
  padding: 24px 0 0;
}

.product-detail-page [data-figma-id="8933:31901"] > .pdp-section-title {
  margin-bottom: 12px;
}

.pdp-review-add {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--blue-700);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.pdp-related-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  direction: rtl;
}

.pdp-related-grid .fp-card--desktop {
  width: 308px;
  min-height: 427px;
}

.pdp-related-grid .fp-stars {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.pdp-related-grid .fp-stars svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.pdp-faq-review {
  display: grid;
  grid-template-columns: 687px 548px;
  width: var(--content-max);
  min-height: 423px;
  margin: 24px auto 0;
  padding: 24px 16.5px 0;
  border-top: 1px solid #e5e7eb;
  gap: 12px;
  justify-content: start;
  align-items: start;
  direction: ltr;
}

.pdp-faq-list,
.pdp-faq-intro {
  direction: rtl;
  text-align: right;
}

.pdp-faq-list {
  display: grid;
  gap: 32px;
}

.pdp-faq-item {
  border-bottom: 1px solid #e5e7eb;
}

.pdp-faq-item summary {
  min-height: 40px;
  cursor: pointer;
  color: #002563;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.pdp-faq-item p {
  margin: 0 0 24px;
  color: #00266d;
  font-size: 15px;
  line-height: 24px;
}

.pdp-faq-intro h2,
.pdp-review-side h3 {
  margin: 0 0 12px;
  color: #002563;
  font-size: 28px;
  line-height: 36px;
}

.pdp-faq-intro p {
  margin: 0;
  color: #1d3d7c;
  font-size: 18px;
  line-height: 28px;
}

.pdp-reviews-layout {
  display: grid;
  grid-template-columns: 835px 433px;
  gap: 12px;
  justify-content: start;
  align-items: start;
  direction: ltr;
}

.pdp-reviews-layout > *,
.pdp-review-side {
  direction: rtl;
  text-align: right;
}

.pdp-review-images {
  display: flex;
  gap: 8px;
  direction: rtl;
}

.pdp-review-images img {
  width: 132px;
  height: 132px;
  object-fit: cover;
}

.pdp-review {
  padding: 28px 0;
  border-bottom: 1px solid #e5e7eb;
}

.pdp-review-head {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  color: #0d0702;
  font-size: 14px;
}

.pdp-review p {
  margin: 12px 0;
  color: #434f5c;
  font-size: 15px;
  line-height: 24px;
}

.pdp-review-detail-images {
  margin: 20px 0 10px;
  display: flex;
  gap: 8px;
  direction: rtl;
}

.pdp-review-detail-images img {
  width: 106px;
  height: 106px;
  object-fit: cover;
}

.pdp-review-side {
  color: #1d3d7c;
}

.pdp-score {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.pdp-score strong {
  color: #002563;
  font-size: 32px;
}

.pdp-bars {
  margin-top: 28px;
  display: grid;
  gap: 10px;
}

.pdp-bar {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  gap: 12px;
  align-items: center;
  color: #737373;
  font-size: 14px;
}

.pdp-bar span:nth-child(2) {
  height: 8px;
  border-radius: 99px;
  background: #d4d4d4;
  overflow: hidden;
}

.pdp-bar span:nth-child(2)::before {
  content: "";
  display: block;
  width: var(--value, 0%);
  height: 100%;
  background: #c04a65;
}

.pdp-review-add {
  width: 281px;
  margin-top: 28px;
  color: var(--blue-700);
  background: #fff;
  border: 1px solid var(--blue-700);
}

.pdp-ugc {
  height: 388px;
  margin-top: 24px;
  padding: 32px 0 8px;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  grid-template-rows: 326px 5px;
  align-items: center;
  column-gap: 16px;
  row-gap: 16px;
}

.pdp-ugc-list {
  display: grid;
  grid-template-columns: repeat(5, 193px);
  gap: 16px;
  justify-content: center;
  direction: ltr;
}

.pdp-ugc-card {
  position: relative;
  height: 326px;
  overflow: hidden;
  background: #000;
}

.pdp-ugc-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .75;
}

.pdp-ugc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #565555;
  color: #fff;
}

.pdp-ugc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: auto;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #fff;
  transform: translateX(2px);
}

.pdp-ugc-dots {
  grid-column: 1 / -1;
  width: 56px;
  height: 5px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pdp-ugc-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--blue-700);
}

.pdp-ugc-dots span:last-child {
  width: 29px;
}

body.review-modal-open {
  overflow: hidden;
}

.pdp-review-modal {
  --review-primary: var(--blue-700);
  --review-primary-dark: var(--blue-850);
  --review-focus: rgba(0, 78, 173, 0.16);
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  direction: rtl;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.pdp-review-modal[hidden] {
  display: none;
}

.pdp-review-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pdp-review-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 7, 2, 0.42);
  backdrop-filter: blur(6px);
}

.pdp-review-modal__dialog {
  position: relative;
  z-index: 1;
  width: 600px;
  max-width: calc(100vw - 32px);
  min-height: 523px;
  padding: 24px;
  border: 1px solid #ebebeb;
  background: #fff;
  color: #0d0702;
  box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
  direction: rtl;
  text-align: right;
}

.pdp-review-modal.is-open .pdp-review-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.pdp-review-modal__header {
  width: 100%;
  height: 48px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pdp-review-modal__header h2 {
  margin: 0;
  color: #0d0702;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
}

.pdp-review-modal__close {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0d0702;
  cursor: pointer;
}

.pdp-review-modal__close svg,
.pdp-review-modal__dropzone svg,
.pdp-review-modal__stars svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.pdp-review-modal__close:hover,
.pdp-review-modal__close:focus-visible {
  color: var(--review-primary);
}

.pdp-review-modal__close:focus-visible {
  outline: 2px solid var(--review-primary);
  outline-offset: 2px;
}

.pdp-review-modal__body {
  display: grid;
  gap: 16px;
}

.pdp-review-modal__rating {
  width: 128px;
  min-height: 56px;
  margin-inline-end: auto;
  display: grid;
  gap: 4px;
  color: #0d0702;
}

.pdp-review-modal__rating > span {
  font-size: 18px;
  line-height: 28px;
  font-weight: 500;
}

.pdp-review-modal__stars {
  display: flex;
  gap: 2px;
  direction: rtl;   /* task-33: التقييم يتعبّى من اليمين (مكانش معكوس بـ ltr) */
}

.pdp-review-modal__stars button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d4d4d4;
  cursor: pointer;
  transition: color 160ms ease, transform 160ms ease;
}

.pdp-review-modal__stars button:hover,
.pdp-review-modal__stars button:focus-visible,
.pdp-review-modal__stars button.is-active {
  color: var(--review-primary);
}

.pdp-review-modal__stars button:focus-visible {
  outline: 2px solid var(--review-primary);
  outline-offset: 2px;
}

.pdp-review-modal__stars button:hover {
  transform: translateY(-1px);
}

.pdp-review-modal__textarea {
  display: block;
}

.pdp-review-modal__textarea textarea {
  width: 100%;
  height: 107px;
  padding: 8px 12px;
  border: 1px solid #d4d4d4;
  border-radius: 0;
  color: #0d0702;
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  resize: none;
  text-align: right;
  direction: rtl;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.pdp-review-modal__textarea textarea::placeholder {
  color: #737373;
}

.pdp-review-modal__textarea textarea:focus {
  border-color: var(--review-primary);
  box-shadow: 0 0 0 3px var(--review-focus);
  outline: 0;
}

.pdp-review-modal__dropzone {
  position: relative;
  height: 100px;
  border: 1px dashed #d4d4d4;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #737373;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.pdp-review-modal__dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pdp-review-modal__dropzone svg {
  width: 24px;
  height: 24px;
  color: var(--review-primary);
}

.pdp-review-modal__dropzone span {
  position: relative;
  max-width: 409px;
  font-size: 14px;
  line-height: 20px;
}

.pdp-review-modal__dropzone:focus-within,
.pdp-review-modal__dropzone:hover {
  border-color: var(--review-primary);
  color: #0d0702;
  box-shadow: 0 0 0 3px var(--review-focus);
}

.pdp-review-modal__anonymous {
  width: 165px;
  min-height: 16px;
  margin-inline-end: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: #0d0702;
  font-size: 12px;
  line-height: 16px;
  cursor: pointer;
}

.pdp-review-modal__anonymous input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--review-primary);
}

.pdp-review-modal__submit {
  width: 100%;
  height: 44px;
  margin-top: 32px;
  border: 0;
  border-radius: 4px;
  background: var(--review-primary);
  color: #fff;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.pdp-review-modal__submit:hover,
.pdp-review-modal__submit:focus-visible {
  background: var(--review-primary-dark);
}

.pdp-review-modal__submit:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--review-focus);
}

.pdp-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999;
  height: 82px;
  padding: 10px 80px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
}

/* Reserve space so the fixed bar never hides the footer / last content. */
body.pdp-sticky-on {
  padding-bottom: 90px;
}
@media (max-width: 767px) {
  body.pdp-sticky-on {
    padding-bottom: 84px;
  }
}

.pdp-bottom-bar__inner {
  width: var(--content-max);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  direction: ltr;
}

.pdp-bottom-actions {
  width: 463px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.pdp-bottom-actions .pdp-qty {
  width: 132px;
  height: 56px;
  margin: 0;
  grid-template-columns: 48px 20px 48px;
  border: 0;
  border-radius: 0;
}

.pdp-bottom-actions .pdp-qty button,
.pdp-bottom-actions .pdp-qty span {
  height: 56px;
}

.pdp-bottom-actions .pdp-qty span {
  background: #fff;
  font-size: 16px;
  line-height: 24px;
}

.pdp-bottom-actions .pdp-button {
  width: 323px;
  height: 56px;
  min-height: 56px;
  margin: 0;
}

.pdp-bottom-product {
  width: 441px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  direction: ltr;
}

.pdp-bottom-copy {
  width: 369px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  direction: rtl;
}

.pdp-bottom-title {
  direction: rtl;
  color: #18181b;
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdp-bottom-price {
  direction: rtl;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.pdp-bottom-price strong {
  color: #18181b;
  font-size: 24px;
  line-height: 32px;
  font-weight: 400;
}

.pdp-bottom-price del {
  color: #9f9fa9;
  font-size: 24px;
  line-height: 32px;
  font-weight: 400;
}

.pdp-bottom-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
}

@media (max-width: 767px) {
  .product-detail-page {
    padding-bottom: 82px;
  }

  .pdp-container {
    /* ≤767: 16px side gutter, matching Home/Landing mobile. */
    padding-inline: 16px;
  }

  .pdp-breadcrumb {
    display: none;
  }

  .pdp-hero {
    margin-top: 20px;
    height: auto;
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
  }

  .pdp-info,
  .pdp-gallery,
  .pdp-title-row,
  .pdp-rating,
  .pdp-price,
  .pdp-divider,
  .pdp-compare,
  .pdp-feature-list,
  .pdp-sale,
  .pdp-purchase,
  .pdp-payments,
  .pdp-service-list {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
  }

  .pdp-info {
    height: auto;
  }

  /* task-28: على الموبايل الصف full-width — flex-end فـ RTL بيرصّ المحتوى لليسار.
     نخليه flex-start (= يمين فـ RTL) عشان التقييم يبدأ من اليمين. */
  .pdp-rating {
    justify-content: flex-start;
  }

  .pdp-info::after {
    display: none;
  }

  .pdp-gallery-main {
    width: 100%;
    height: 358px;   /* Figma gallery 343x358 (9397:55438) */
  }

  .pdp-gallery {
    min-height: 0;
  }

  .pdp-thumbs {
    position: static;   /* reset desktop absolute + left:586px that overflowed mobile */
    left: auto;
    top: auto;
    height: auto;
    width: 100%;
    margin: 12px 0 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .pdp-ar,
  .pdp-buyer-card {
    display: none;
  }

  .pdp-title-row {
    display: block;
  }

  .pdp-actions {
    margin-bottom: 12px;
  }

  .pdp-title {
    width: 100%;
    font-size: 22px;
    line-height: 30px;
  }

  .pdp-feature-list {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .pdp-sale,
  .pdp-purchase {
    width: 100%;
  }

  .pdp-sale {
    padding-inline: 16px;
  }

  .pdp-sale__timer {
    max-width: 100%;
    gap: 4px;
  }

  .pdp-faq-review,
  .pdp-reviews-layout {
    display: block;
    width: 100%;        /* reset desktop fixed width:1280px that overflowed mobile */
    height: auto;
  }

  .pdp-video {
    height: auto;          /* Issue 23: keep the 16:9 ratio on mobile too */
    aspect-ratio: 16 / 9;
  }

  .pdp-figma-section--specs {
    height: auto;
  }

  .pdp-tech-specs {
    padding: 36px 0;
  }

  .pdp-tech-specs__inner {
    padding-inline: 16px;
  }

  .pdp-tech-specs__title {
    font-size: 22px;
    line-height: 30px;
    margin-bottom: 18px;
  }

  .pdp-tech-specs__row {
    grid-template-columns: 42% 58%;
  }

  .pdp-tech-specs__key,
  .pdp-tech-specs__val {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 22px;
  }

  .pdp-figma-section--specs img,
  .pdp-figma-section--why img {
    height: auto;
  }

  .pdp-figma-section--why {
    height: auto;
    max-height: 76vw;
  }
  .pdp-related-grid {
    grid-template-columns: repeat(2, 167px);
    justify-content: center;
    gap: 16px 9px;
  }

  .pdp-related-grid .fp-card:nth-child(n+6) {
    display: none;
  }

  .pdp-review-images {
    overflow-x: auto;
  }

  .pdp-review-side {
    margin-top: 28px;
  }

  .pdp-ugc {
    grid-template-columns: 1fr;
  }

  .pdp-ugc > button {
    display: none;
  }

  .pdp-ugc-list {
    grid-template-columns: repeat(5, 193px);
    justify-content: start;
    overflow-x: auto;
  }

  .pdp-bottom-bar__inner {
    width: 100%;
  }

  .pdp-bottom-bar {
    padding-inline: 16px;
  }

  .pdp-bottom-actions {
    width: 100%;
  }

  .pdp-bottom-actions .pdp-button {
    flex: 1;
    width: auto;
  }

  .pdp-bottom-product {
    display: none;
  }

  .pdp-review-modal {
    padding: 16px;
  }

  .pdp-review-modal__dialog {
    min-height: auto;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  .pdp-review-modal__submit {
    margin-top: 24px;
  }
}

/* === Dynamic single-product: replace Figma absolute coords with normal flow ===
 * The Figma export positioned every hero element with fixed top/left + a fixed
 * column height, which breaks with variable WooCommerce content (the payment
 * strip ended up off-position / hidden). Use flow layout so all hero elements —
 * including .pdp-payments — stack in DOM order and stay visible. */
.product-detail-page .pdp-hero {
  position: relative;
  height: auto;
  display: flex;
  flex-direction: row;   /* DOM: info then gallery → info LEFT, gallery RIGHT */
  direction: ltr;
  gap: 32px;
  align-items: flex-start;
}
.product-detail-page .pdp-info {
  position: relative;
  inset: auto;
  width: 598px;
  max-width: 100%;
  height: auto;
  flex: 0 0 598px;
  direction: rtl;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.product-detail-page .pdp-gallery {
  position: relative;
  inset: auto;
  width: 650px;
  max-width: 100%;
  height: auto;
  flex: 0 0 650px;
  direction: rtl;
}
.product-detail-page .pdp-info > * {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
}
.product-detail-page .pdp-info::after { display: none !important; }
.product-detail-page .pdp-payments { padding: 4px 0; justify-content: flex-start; }
@media (max-width: 1024px) {
  .product-detail-page .pdp-hero { flex-direction: column; }
  .product-detail-page .pdp-info,
  .product-detail-page .pdp-gallery { width: 100%; flex-basis: auto; }
}

/* === Related products "قد يعجبك أيضاً" — match Figma product-card (8933:31708) === */
.pdp-related-grid .fp-card {
  border-radius: 6px;            /* Figma: rounded-[6px] (was 16px) */
  border: 1px solid #f1f5f9;     /* Figma: color/slate/100 */
  box-shadow: none;              /* Figma: no shadow */
}
.pdp-related-grid .fp-badge {
  top: 8px;                      /* Figma: top-[8px] */
  left: auto;
  right: 8px;                    /* Figma: physical right-[8px] */
  padding: 2px 12px;             /* Figma: px-12 py-2 */
  background: #5574cc;           /* Figma: bg-[#5574cc] */
  color: #fff;
  border-radius: 0 6px 0 6px;    /* Figma: rounded-tr-6 + rounded-bl-6 */
  font-size: 14px;               /* Figma: font/size/sm */
  line-height: 20px;
  font-weight: 500;
}

/* Related cards: stars + price to match Figma product-card tokens */
.pdp-related-grid .fp-stars { color: #C04A65; }            /* Figma: Pink-2/20 */
.pdp-related-grid .fp-price { color: #1d3d7c; }            /* text/text blue */
.pdp-related-grid .fp-currency {
  font-size: 18px; line-height: 28px; font-weight: 400; color: #1d3d7c;
}
.pdp-related-grid .fp-amount {
  font-family: "Poppins", "GE SS Two", sans-serif;          /* Figma: Poppins SemiBold */
  font-size: 20px; line-height: 24px; font-weight: 600; color: #1d3d7c;
}
/* Sale price red + old price struck-gray, identical to the home cards
   (the blue .fp-amount/.fp-price rules above otherwise recolour both). */
.pdp-related-grid .fp-price--sale .fp-amount,
.pdp-related-grid .fp-price--sale .fp-currency { color: #ef4454; }
.pdp-related-grid .fp-price--old .fp-amount { color: #b5bfd0; text-decoration: line-through; }
.pdp-related-grid .fp-price--old .fp-currency { color: #9eabbe; }

/* === Variable products: variation dropdowns + gated add-to-cart (WooCommerce) === */
.pdp-variations-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  direction: rtl;
}
.pdp-variations {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pdp-variation-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pdp-variation-row label {
  color: #002563;
  font-size: 15px;
  font-weight: 600;
}
.pdp-variations select,
.pdp-variation-select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 15px;
  font-family: inherit;
  direction: rtl;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  /* chevron on the inline-start (left in RTL) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
}
.pdp-variations select:focus,
.pdp-variation-select:focus {
  outline: none;
  border-color: var(--blue-700);
}
.pdp-variation-reset {
  align-self: flex-start;
  color: var(--blue-700);
  font-size: 14px;
  font-weight: 500;
}
.single_variation_wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pdp-variation-price .price,
.pdp-variation-price {
  color: #a50036;
  font-size: 24px;
  font-weight: 700;
}
.pdp-variation-price .price del {
  color: #99a1af;
  font-size: 16px;
  font-weight: 700;
  margin-inline-start: 8px;
}
/* The purchase row sits inside the form (not a direct .pdp-info child), so the
   Figma absolute base rule still targets it — reset it back to normal flow. */
.pdp-variations-form .pdp-purchase {
  position: static;
  inset: auto;
  width: 100%;
  height: auto;
  margin: 0;
}
.single_add_to_cart_button[disabled],
.single_add_to_cart_button.disabled,
.woocommerce-variation-add-to-cart-disabled .single_add_to_cart_button {
  opacity: .45;
  cursor: not-allowed;
}
/* WooCommerce shows variation messages here; keep them readable + RTL. */
.pdp-variations-form .woocommerce-variation-availability,
.pdp-variations-form .stock {
  margin: 0;
  font-size: 14px;
  color: #15803d;
}

/* === Variation image swatches (replace dropdown UI on variable products) === */
.pdp-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pdp-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 76px;
  padding: 8px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pdp-swatch:hover {
  border-color: #cbd5e1;
}
.pdp-swatch:focus-visible {
  outline: none;
  border-color: var(--blue-700);
}
.pdp-swatch.is-selected {
  border-color: var(--blue-700);
  box-shadow: inset 0 0 0 1px var(--blue-700);
}
/* Out-of-stock option: dimmed, disabled, with a diagonal strike line. */
.pdp-swatch--oos {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  position: relative;
}
.pdp-swatch--oos::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(to top right,
    transparent calc(50% - 1px), #c0392b calc(50% - 1px),
    #c0392b calc(50% + 1px), transparent calc(50% + 1px));
}
.pdp-swatch--oos:hover { border-color: #e5e7eb; }
.pdp-swatch__media {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
}
.pdp-swatch__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pdp-swatch__label {
  color: #1f2937;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
}
.pdp-swatch--text {
  min-width: 64px;
  padding: 12px 18px;
  border-radius: 999px;
}
/* Once JS wires the swatches, hide the native select (kept for WC + no-JS). */
.pdp-has-swatches select.pdp-variation-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* === Reviews: simplified empty state (no reviews yet) === */
.pdp-reviews-empty {
  max-width: 520px;
  margin: 8px auto 0;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.pdp-reviews-empty .pdp-no-reviews {
  margin: 0;
  color: #45556c;
  font-size: 16px;
  line-height: 26px;
}
.pdp-reviews-empty__cta {
  margin: 0;
  color: #002563;
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
}
.pdp-reviews-empty .pdp-review-add {
  width: auto;
  min-width: 220px;
  margin: 0;
  padding: 12px 32px;
  text-align: center;
  color: var(--blue-700);
  background: #fff;
  border: 1px solid var(--blue-700);
  border-radius: 99px;
}

/* === Discount badge on the product image corner (on-sale only) === */
/* Discount badge over the gallery image. The starburst shape, color and font
   come from the shared .fp-discount class (style.css) so the PDP badge matches
   the product cards 1:1. Here we only set the PDP-specific placement + size. */
.pdp-image-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  inset-inline-start: 12px;
  inset-inline-end: auto;
  z-index: 3;
  width: 48px;
  height: 48px;
}

/* === Image zoom magnifier (lens + side window), desktop pointers only === */
@media (hover: hover) and (min-width: 1025px) {
  .pdp-gallery-main { cursor: crosshair; }
}
.pdp-zoom-lens {
  position: absolute;
  display: none;
  pointer-events: none;
  border: 1px solid rgba(0, 38, 99, .45);
  background: rgba(120, 160, 255, .18);
  z-index: 6;
}
.pdp-zoom-window {
  position: fixed;
  display: none;
  width: 400px;
  height: 400px;
  background-color: #fff;
  background-repeat: no-repeat;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  z-index: 1000;
  pointer-events: none;
}
@media (hover: none), (max-width: 1024px) {
  .pdp-zoom-lens,
  .pdp-zoom-window { display: none !important; }
}

/* === Review form: image upload + preview, and "already reviewed" note === */
.pdp-review-modal__upload {
  margin-top: 4px;
}
.pdp-review-modal__dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border: 1.5px dashed #c5d0e0;
  border-radius: 10px;
  color: var(--blue-700);
  background: #f7f9fc;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.pdp-review-modal__dropzone:hover {
  border-color: var(--blue-700);
  background: #eef3fb;
}
.pdp-review-modal__dropzone-text {
  font-size: 14px;
  font-weight: 500;
}
.pdp-review-modal__preview {
  position: relative;
  width: 96px;
  height: 96px;
  margin-top: 4px;
}
.pdp-review-modal__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.pdp-review-modal__preview-remove {
  position: absolute;
  top: -8px;
  inset-inline-end: -8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f0445b;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.pdp-review-done {
  margin: 0;
  padding: 12px 18px;
  border-radius: 10px;
  background: #eef6ee;
  color: #15803d;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

/* Price now lives in .pdp-price (updated by JS per variation); avoid duplicating
   it inside the WooCommerce single_variation block — keep only availability. */
.pdp-variation-price .woocommerce-variation-price { display: none; }

/* Sticky add-to-cart mirrors the main button's gated state */
.pdp-bottom-bar .pdp-button--cart.is-disabled { opacity: .5; cursor: not-allowed; }

/* موبايل — الصورة فوق الاسم */
@media (max-width: 768px) {
  .pdp-hero {
    display: flex !important;
    flex-direction: column !important;
  }
  .pdp-gallery {
    order: 0 !important;
  }
  .pdp-info {
    order: 1 !important;
  }

  /* زرار اشتري الآن تحت أضف للسلة */
  .pdp-purchase {
    display: flex !important;
    flex-direction: column !important;
  }
  .pdp-button--cart {
    order: 1 !important;
  }
  .pdp-button--buy {
    order: 2 !important;
  }
}

/* ===== Related products grid — 2 fluid cards (481–767px), 1 card (≤480px) ===== */
@media (max-width: 767px) {
  .pdp-related-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;                 /* unified 24px card gap */
    justify-content: stretch;
  }
  .pdp-related-grid .fp-card {
    width: 100%;
    min-width: 0;
  }
  .pdp-related-grid .fp-media-frame {
    height: auto;
    aspect-ratio: 167 / 180;
  }
}
@media (max-width: 480px) {
  .pdp-related-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   Issue 33 (Phase 1) — inline styles moved out of single-product.php.
   Only static (non-dynamic) declarations are moved here; JS-toggled and
   per-product-dynamic inline styles stay inline per the task rules.
   ===================================================================== */
.pdp-payments__img { max-width: 220px; height: auto; }
.pdp-ar-wrap { display: flex; justify-content: center; align-items: center; margin-top: 16px; width: 100%; }
.pdp-section--reviews { position: relative; z-index: 2; background: #fff; clear: both; }

/* AR (3D) modal — static presentation moved from single-product.php.
   The modal's show/hide toggles inline display via JS, so only the root
   `display` stays inline. */
.granzia-ar-modal__box { background: #fff; border-radius: 20px; padding: 24px; width: 90%; max-width: 700px; position: relative; }
.granzia-ar-modal__close { position: absolute; top: 12px; left: 12px; background: none; border: none; font-size: 28px; cursor: pointer; color: #333; }
.granzia-ar-modal__title { text-align: center; margin: 0 0 16px; font-family: inherit; color: #1d3d7c; }
.granzia-ar-modal__viewer { width: 100%; height: 450px; border-radius: 12px; background: #f0f0f0; }
.granzia-ar-modal__ar-btn { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); background: #1d3d7c; color: #fff; border: none; border-radius: 30px; padding: 12px 28px; font-size: 16px; cursor: pointer; font-family: inherit; }
.granzia-ar-modal__hint { text-align: center; color: #888; font-size: 13px; margin-top: 12px; }
.granzia-ar-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 99999; align-items: center; justify-content: center; }

/* =====================================================================
   Issue 14 — "أضف تقييمك" review modal brand polish (navy/gold Figma system).
   ===================================================================== */
.pdp-review-modal__header h2 { color: #1d3d7c; }
/* Rating stars are gold (product ratings), not navy. */
.pdp-review-modal__stars button:hover,
.pdp-review-modal__stars button:focus-visible,
.pdp-review-modal__stars button.is-active { color: #f5a623; }
/* Submit + textarea match the site's rounded system. */
.pdp-review-modal__submit { border-radius: 999px; }
.pdp-review-modal__textarea textarea { border-radius: 12px; }
.pdp-review-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  background: #1d3d7c;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.pdp-review-add:hover { background: #16305f; }

.pdp-container {
  /* Match Home/Landing container (see the base .pdp-container rule). Enforced
     with !important to win over the older width cap. Side gutter (padding-inline)
     is left to the base rule (24px) + the ≤767 media query (16px). */
  max-width: var(--page-max) !important;
  width: 100% !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

/* ============================================================
 * PDP reviews — redesigned "تقييمات ومراجعات المنتج".
 * Summary card + distribution bars + review cards (avatar/verified/stars/text/
 * photo thumbs + "+N" + lightbox). Scoped to .pdp-rv. Navy = --primary;
 * stars = the site's brand rose (#ff7e84, same as the home review stars).
 * ============================================================ */
.pdp-rv .pdp-rv-stars { color: #ff7e84; }
.pdp-rv .pdp-rv-stars svg { width: 18px; height: 18px; }

/* --- Summary card: score (right) · bars (middle) · CTA (left) --- */
.pdp-rv-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  background: #fff;
  border: 1px solid #eef1f6;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 6px 20px rgba(29, 61, 124, .06);
  margin-bottom: 24px;
  direction: rtl;
}
.pdp-rv-summary__score { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 120px; }
.pdp-rv-summary__avg { font-size: 46px; font-weight: 800; color: var(--primary, #1d3d7c); line-height: 1; }
.pdp-rv-summary__based { font-size: 13px; color: #64748b; }
.pdp-rv-summary__bars { display: flex; flex-direction: column; gap: 8px; }
.pdp-rv-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.pdp-rv-bar__label { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: #475569; min-width: 34px; }
.pdp-rv-bar__star svg { width: 13px; height: 13px; fill: #ff7e84; }
.pdp-rv-bar__track { height: 8px; border-radius: 99px; background: #f1f5f9; overflow: hidden; }
.pdp-rv-bar__fill { display: block; height: 100%; border-radius: 99px; background: #ff7e84; }
.pdp-rv-bar__count { font-size: 13px; color: #64748b; min-width: 20px; text-align: left; }
.pdp-rv-summary__cta { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 210px; padding-inline-start: 24px; border-inline-start: 1px solid #eef1f6; text-align: center; }
.pdp-rv-summary__cta-title { margin: 0; font-size: 16px; font-weight: 800; color: var(--primary, #1d3d7c); }
.pdp-rv-summary__cta-sub { margin: 0 0 8px; font-size: 13px; color: #64748b; }
.pdp-rv-summary__cta .pdp-review-add,
.pdp-rv-summary__cta .pdp-review-done { margin: 0; }
.pdp-rv-summary__cta .pdp-review-add {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary, #1d3d7c); color: #fff;
  border-radius: 999px; padding: 11px 24px; font-weight: 700; font-size: 15px; text-decoration: none;
  transition: background .15s ease;
}
.pdp-rv-summary__cta .pdp-review-add:hover { background: var(--primary-dark, #173061); }
.pdp-rv-summary__cta .pdp-review-add::before {
  content: ""; width: 18px; height: 18px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 7.2 5H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-3.2L15 3H9zm3 5a5 5 0 1 1 0 10 5 5 0 0 1 0-10zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 7.2 5H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-3.2L15 3H9zm3 5a5 5 0 1 1 0 10 5 5 0 0 1 0-10zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* --- Review cards grid --- */
.pdp-rv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; direction: rtl; }
.pdp-rv-card { background: #fff; border: 1px solid #eef1f6; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 4px 16px rgba(29, 61, 124, .05); }
.pdp-rv-card__head { display: flex; align-items: center; gap: 10px; }
.pdp-rv-card__avatar { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; background: var(--primary, #1d3d7c); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.pdp-rv-card__id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pdp-rv-card__name { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; color: var(--primary, #1d3d7c); font-size: 15px; }
.pdp-rv-card__verified { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: #16a34a; }
.pdp-rv-card__verified svg { width: 14px; height: 14px; fill: #16a34a; }
.pdp-rv-card__date { font-size: 12px; color: #94a3b8; }
.pdp-rv-card__stars { margin-inline-start: auto; align-self: flex-start; }
.pdp-rv-card__stars svg { width: 16px; height: 16px; }
.pdp-rv-card__text { margin: 0; font-size: 14px; line-height: 1.8; color: #475569; }
.pdp-rv-card__photos { display: flex; gap: 8px; flex-wrap: wrap; }
.pdp-rv-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 0; padding: 0; cursor: pointer; background: #f1f5f9; }
.pdp-rv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-rv-thumb__count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(29, 61, 124, .62); color: #fff; font-weight: 800; font-size: 16px; }

/* --- Lightbox --- */
.pdp-rv-lightbox { position: fixed; inset: 0; z-index: 100000; background: rgba(0, 0, 0, .82); display: flex; align-items: center; justify-content: center; }
.pdp-rv-lightbox[hidden] { display: none; }
.pdp-rv-lightbox__img { max-width: 88vw; max-height: 82vh; border-radius: 10px; object-fit: contain; }
.pdp-rv-lightbox__close { position: absolute; top: 18px; right: 22px; background: none; border: 0; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; }
.pdp-rv-lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .15); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1; cursor: pointer; }
.pdp-rv-lightbox__nav--prev { right: 20px; }   /* السابق on the right (RTL) */
.pdp-rv-lightbox__nav--next { left: 20px; }

@media (max-width: 767px) {
  .pdp-rv-summary { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .pdp-rv-summary__cta { border-inline-start: 0; border-top: 1px solid #eef1f6; padding-inline-start: 0; padding-top: 16px; }
  .pdp-rv-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
 * PDP "تفاصيل المنتج" — collapsible long description
 *   Collapsed to --pdp-collapse-h with a bottom fade + عرض المزيد/عرض أقل.
 *   No clamp/fade/button until JS confirms the text overflows (short
 *   descriptions stay fully visible with no toggle). JS reads
 *   --pdp-collapse-h so CSS is the single source of truth for the height.
 * ===================================================================== */
.pdp-collapse {
  --pdp-collapse-h: 120px;          /* collapsed height */
  --pdp-details-bg: #fff;           /* section background — used by the fade */
  position: relative;
}
.pdp-collapse__inner {
  position: relative;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

/* Fade + toggle stay hidden until JS adds .is-collapsible (long text only). */
.pdp-collapse__fade,
.pdp-collapse__toggle { display: none; }
.pdp-collapse.is-collapsible .pdp-collapse__fade { display: block; }
.pdp-collapse.is-collapsible .pdp-collapse__toggle { display: inline-flex; }

.pdp-collapse__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;                        /* sits on the clamped text's bottom edge */
  height: 70px;
  pointer-events: none;
  /* transparent end uses rgba(...,0) (not the `transparent` keyword) to avoid a
     grey tint; matches --pdp-details-bg (white). */
  background: linear-gradient(to top, var(--pdp-details-bg) 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 1;
  transition: opacity 0.35s ease;
}
/* Expanded (JS removed .is-collapsed) → fade out. */
.pdp-collapse.is-collapsible:not(.is-collapsed) .pdp-collapse__fade { opacity: 0; }

.pdp-collapse__toggle {
  margin-top: 14px;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  border: 1.5px solid var(--primary, #1d3d7c);
  border-radius: 999px;
  background: transparent;
  color: var(--primary, #1d3d7c);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.pdp-collapse__toggle:hover { background: var(--primary, #1d3d7c); color: #fff; }
.pdp-collapse__toggle:focus-visible { outline: 2px solid var(--primary, #1d3d7c); outline-offset: 2px; }
.pdp-collapse__chev { flex: none; transition: transform 0.3s ease; }
/* Expanded → chevron points up. */
.pdp-collapse.is-collapsible:not(.is-collapsed) .pdp-collapse__chev { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
  .pdp-collapse__inner,
  .pdp-collapse__fade,
  .pdp-collapse__chev { transition: none; }
}

/* =====================================================================
 * PDP top section (hero) — FILL the full content container.
 * Cause of the gap: .pdp-info (flex 0 0 598px) + .pdp-gallery (flex 0 0 650px)
 * = 1280px of fixed basis. After the container was widened to match Home/Landing
 * (~1552px content), the ltr flex row packed both columns left and left ~272-320px
 * empty on the right. Fix: let both columns GROW to fill (keeping the design's
 * ~52/48 gallery/summary ratio) and make the gallery internals fluid so the
 * gallery column truly fills instead of leaving space inside it.
 * Desktop only (min-width:1025) — tablet/mobile stacking is unchanged.
 * ===================================================================== */
@media (min-width: 1025px) {
  .product-detail-page .pdp-info {
    flex: 48 1 0;
    width: auto;
    max-width: none;
  }
  /* The gallery column GROWS to fill. It stays a positioned BLOCK (not flex) —
     it vertically stacks the main image, the AR button and the buyer card, with
     the thumb strip absolutely positioned beside the main image. */
  .product-detail-page .pdp-gallery {
    flex: 52 1 0;
    width: auto;
    max-width: none;
    position: relative;
  }
  /* Main image fills the column width MINUS the thumb strip (64px + 20px gap),
     pinned to the left (margin-right:auto); height follows the image's ratio. */
  .product-detail-page .pdp-gallery-main {
    width: calc(100% - 84px);
    max-width: none;
    height: auto;
    margin-right: auto;
    margin-left: 0;
    box-sizing: border-box;
  }
  .product-detail-page .pdp-gallery-main img {
    height: auto;   /* was height:100% → collapsed once the box height went auto */
  }
  /* Thumb strip: pin to the gallery's right edge (was left:586, which assumed the
     fixed 566px main image). */
  .product-detail-page .pdp-thumbs {
    left: auto;
    right: 0;
    top: 0;
  }
}
