.pdp {
  padding-block: 24px 48px;
}

.pdp__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.pdp__category {
  color: var(--color-fg-subtle);
}
.pdp__category:hover {
  color: var(--color-fg-base);
}

.pdp__title {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  margin: 0;
  color: var(--color-fg-base);
}

@media (min-width: 1024px) {
  .pdp__title {
    font-size: 28px;
    line-height: 36px;
  }
}

.pdp__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pdp__stars {
  display: inline-flex;
  gap: 2px;
}

.pdp__star {
  width: 16px;
  height: 16px;
  color: var(--color-border-base);
}
.pdp__star--filled {
  color: #f59e0b;
}

.pdp__rating-count {
  color: var(--color-fg-subtle);
}

.eco-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: var(--radius-full);
  background-color: #dcfce7;
  color: #15803d;
  padding: 4px 12px;
  font-size: var(--text-small-semi-size);
  font-weight: 600;
}
html.dark .eco-badge {
  background-color: rgba(21, 128, 61, 0.2);
  color: #4ade80;
}

.pdp__body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 1024px) {
  .pdp__body {
    flex-direction: row;
    align-items: flex-start;
  }
}

.pdp__gallery {
  display: flex;
  gap: 12px;
  width: 100%;
}

@media (min-width: 1024px) {
  .pdp__gallery {
    flex: 1;
    min-width: 0;
  }
}

.pdp__main-image {
  order: 1;
  flex: 1;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--color-bg-subtle);
}

.pdp__main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp__thumbs {
  order: 2;
  flex-shrink: 0;
  width: 64px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.pdp__thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  background-color: var(--color-bg-subtle);
}
.pdp__thumb.is-active {
  border-color: var(--color-interactive);
}
.pdp__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp__buybox {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--color-border-base);
  border-radius: 8px;
}

@media (min-width: 1024px) {
  .pdp__buybox {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--nav-height) + 16px);
  }
}

.product-actions__options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.option-select {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-select__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-select__button {
  flex: 1;
  min-width: 88px;
  min-height: 40px;
  padding-block: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 8px;
  border: 1px solid var(--color-border-base);
  background-color: var(--color-bg-subtle);
  font-size: var(--text-small-regular-size);
}
.option-select__button.is-selected {
  border-color: var(--color-interactive);
  background-color: color-mix(in srgb, var(--color-interactive) 10%, transparent);
  color: var(--color-interactive);
}

.option-select__button-price {
  font-size: var(--text-xsmall-regular-size);
  font-weight: 600;
  color: #c2410c;
}
.option-select__button.is-selected .option-select__button-price {
  color: var(--color-interactive);
}

.option-select__button.is-unavailable {
  opacity: 0.45;
  cursor: not-allowed;
}
.option-select__button.is-unavailable .option-select__button-label {
  text-decoration: line-through;
}

.product-price__amount {
  font-size: var(--text-xl-semi-size);
  line-height: var(--text-xl-semi-line);
  font-weight: 600;
  color: var(--color-fg-base);
}

.product-price__per-unit {
  margin-left: 8px;
  font-size: var(--text-small-regular-size);
  color: var(--color-fg-subtle);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.specs-table tr {
  border-top: 1px solid var(--color-border-base);
}
.specs-table th,
.specs-table td {
  text-align: left;
  padding: 10px 12px;
  vertical-align: top;
}
.specs-table th {
  width: 40%;
  font-weight: 600;
  color: var(--color-fg-base);
}
.specs-table td {
  color: var(--color-fg-subtle);
}
.specs-table tr:nth-child(odd) {
  background-color: var(--color-bg-subtle);
}

.product-price__from {
  margin-left: 6px;
  font-size: var(--text-small-regular-size);
  color: var(--color-fg-subtle);
}

.pdp__cart {
  max-width: 420px;
}

.mobile-actions__cart {
  flex: 0 0 auto;
  width: 190px;
}

.product-tabs {
  display: flex;
  flex-direction: column;
  margin-top: 48px;
}

.product-tabs__item {
  border-top: 1px solid var(--color-border-base);
  padding-block: 8px;
}

.product-tabs__item summary {
  cursor: pointer;
  padding-block: 8px;
  font-weight: 500;
}

.product-info__description {
  color: var(--color-fg-subtle);
  white-space: pre-line;
  margin-bottom: 16px;
}

.product-tabs__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-block: 16px;
  color: var(--color-fg-subtle);
}

.product-tabs__grid > div {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-tabs__label {
  font-weight: 600;
  color: var(--color-fg-base);
}

.product-tabs__shipping {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-block: 16px;
  color: var(--color-fg-subtle);
}

.mobile-actions {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--color-bg-base);
  border-top: 1px solid var(--color-border-base);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.mobile-actions.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .mobile-actions {
    display: none;
  }
}

.mobile-actions__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mobile-actions__info span:first-child {
  font-size: var(--text-small-regular-size);
  color: var(--color-fg-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-actions__price {
  font-weight: 600;
  color: var(--color-fg-base);
}

.pdp-related {
  margin-block: 48px;
}

.pdp-related__heading {
  margin: 0 0 24px;
}

/* ---------- Touch / small-screen sizing ---------- */

@media (max-width: 1023px) {
  .pdp {
    padding-block: 16px 32px;
  }

  .pdp__header {
    margin-bottom: 16px;
  }

  .pdp__category {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 32px;
  }

  /* Thumbnails as a swipeable strip under the main image -- a 64px side
     column ate a fifth of the image width on phones. */
  .pdp__gallery {
    flex-direction: column;
    gap: 10px;
  }

  .pdp__thumbs {
    width: 100%;
    max-height: none;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .pdp__thumbs::-webkit-scrollbar {
    display: none;
  }

  .pdp__thumb {
    width: 60px;
    height: 60px;
  }

  .pdp__body {
    gap: 20px;
  }

  .pdp__buybox {
    gap: 16px;
    padding: 16px;
  }

  .option-select__button {
    min-height: 48px;
  }

  .option-select__button-price {
    font-size: var(--text-small-regular-size);
  }

  .pdp__cart {
    max-width: none;
    height: 48px;
  }

  .product-tabs {
    margin-top: 32px;
  }

  .product-tabs__item summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-block: 4px;
  }

  .product-tabs__grid {
    gap: 16px;
  }

  .specs-table {
    font-size: var(--text-small-regular-size);
    line-height: 18px;
  }

  .specs-table th,
  .specs-table td {
    padding: 10px 8px;
  }

  .pdp-related {
    margin-block: 32px;
  }

  /* The fixed add-to-cart bar would otherwise sit on top of the footer's
     last lines at the bottom of the page. */
  body:has(.mobile-actions) .site-footer {
    padding-bottom: 72px;
  }
}

@media (max-width: 399px) {
  .product-tabs__grid {
    grid-template-columns: 1fr;
  }

  .option-select__button {
    min-width: 72px;
  }
}
