:where(.product-detail) {
  --shop-pd-gap: 24px;
  --shop-pd-thumb-gap: 6px;
}

/* Layout: split on desktop, stack on small screens */
:where(.product-detail .pd-wrap--with-gallery) {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--shop-pd-gap);
}

@media (min-width: 900px) {
  :where(.product-detail .pd-wrap--with-gallery) {
    align-items: start;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  /* allow columns to shrink instead of overflowing the grid */
  :where(.product-detail .pd-wrap--with-gallery .pd-gallery),
  :where(.product-detail .pd-wrap--with-gallery .product-meta) {
    min-width: 0;
  }
}

/* ---- GALLERY ---- */
:where(.product-detail .pd-gallery) {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

:where(.product-detail .pd-mainblock) {
  display: flex;
  flex-direction: column;
}

/* Main stage */
:where(.product-detail .pd-stage),
:where(.product-detail .pd-single-stage) {
  position: relative;
  overflow: hidden;
  display: grid;
  aspect-ratio: 4 / 3;
}

:where(.product-detail .pd-stage figure) {
  margin: 0;
  padding: 0;
  display: none;
  width: 100%;
  height: 100%;
}

:where(.product-detail .pd-stage figure.active) {
  display: block;
  border: 1px solid;
}

:where(.product-detail .pd-stage img),
:where(.product-detail .pd-single-stage img) {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  object-fit: cover;
  object-position: center;
}

/* Caption: present + visually connected directly under image */
:where(.product-detail .pd-caption) {
  margin: 0;
  border-width: 0 1px 1px;
  border-style: solid;
  border-color: currentColor;
  padding: 4px 8px;
  font-size: 0.9rem;
  font-style: italic;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thumbs row: [ prev ] [thumb grid fills 1fr] [ next ] */
:where(.product-detail .pd-thumbsrow) {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: var(--shop-pd-thumb-gap);
}

/* Thumbnails grid: 4 per row */
:where(.product-detail .pd-thumbs) {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--shop-pd-thumb-gap);
}

/* Thumb buttons: square */
.product-detail .pd-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  display: block;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.product-detail .pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.9;
}

.product-detail .pd-thumb[aria-current="true"] {
  box-shadow: 0 0 0 1px currentColor;
}

.product-detail .pd-thumb[aria-current="true"] img {
  opacity: 1;
}

/* Arrow buttons: compact, grid-centered glyphs */
.product-detail .pd-nav {
  appearance: none;
  background: none;
  color: inherit;
  display: grid;
  place-items: center;
  margin: 0;
  width: 40px;
  height: 100%;
  padding: 0;
  line-height: 1;
  border: 1px solid;
  touch-action: manipulation;
}

.product-detail .pd-nav-icon {
  display: block;
  width: 24px;
  height: 24px;
  opacity: 0.8;
  pointer-events: none; /* keep click on button */
}

/* ---- RIGHT ---- */
:where(.product-detail .content) {
  margin-top: 16px;
}

:where(.product-detail .product-review-summary) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

:where(.product-detail .product-review-count) {
  font-size: 1em;
}
/* ---- TABS ---- */
:where(.product-tabs){
  width: 100%;
  display: inline-block;
  text-align: center;
  border-bottom: 1px solid;
  margin-block: 1.2rem;
  padding: 0.5rem;
}
:where(.product-tabs span){
  font-size: 1.3rem;
  font-weight: 500;
  padding: 0 1rem; 
}
:where(.product-tabs span a) {
  text-decoration: none;
}
/* ---- ATTRIBUTES TABLE ---- */
:where(.product-attr-wrap) {
  overflow-x: auto;
}
:where(table.attributes) {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  margin: 0;
}
:where(table.attributes tr:nth-child(even)) {
  background-color: rgba(0, 0, 0, 0.025);
}
:where(table.attributes th),
:where(table.attributes td) {
  padding: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: top;
}
:where(table.attributes tr:last-child th),
:where*table.attributes tr:last-child td) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

