.product-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.product-detail__media {
  position: sticky;
  top: 110px;
}

.product-detail__content {
  min-width: 0;
}

.product-detail__image {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* Transparent tile: no fill and no drop shadow, since there is no longer a
     solid card for a shadow to be cast by — the gradient stroke below is what
     defines the edge. */
  background: transparent;
}

.product-detail__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Gradient stroke — same masked-ring technique as the product cards. */
.product-detail__image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: var(--gradient-brand);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.product-detail__image-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--gradient-brand);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(11, 16, 48, 0.22);
}

.product-detail__missing {
  border-radius: 0;
}

.product-detail__variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: var(--color-mist);
  border-radius: 999px;
  margin-bottom: 28px;
  width: fit-content;
}

.product-detail__variant-tab {
  border: none;
  background: transparent;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-ink-soft);
  cursor: pointer;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.product-detail__variant-tab.is-active {
  background: var(--gradient-brand);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(11, 16, 48, 0.22);
}

.product-detail__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -14px 0 28px;
}

.product-detail__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid rgba(23, 47, 86, 0.2);
  background: var(--color-white);
  color: var(--color-ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.25s var(--ease-out), color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}

.product-detail__option:hover {
  border-color: var(--color-blue);
  color: var(--color-navy);
}

.product-detail__option.is-active {
  border-color: var(--color-blue-text);
  background: var(--color-blue-text);
  color: #ffffff;
}

.product-detail__option-code {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(23, 47, 86, 0.1);
  color: var(--color-navy);
}

.product-detail__option.is-active .product-detail__option-code {
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-navy);
}

.product-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}

.product-detail__badges li {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(23, 47, 86, 0.08);
  color: var(--color-navy);
  font-size: 0.8rem;
  font-weight: 600;
}

.spec-block {
  margin-bottom: 40px;
}

.spec-block h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(23, 47, 86, 0.12);
}

.spec-list {
  display: flex;
  flex-direction: column;
}

.spec-list__row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(11, 16, 48, 0.08);
}

.spec-list__row dt {
  font-size: 0.9rem;
  color: var(--color-ink-soft);
  flex-shrink: 0;
}

.spec-list__row dd {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-ink);
  text-align: right;
}

.sku-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(11, 16, 48, 0.1);
}

.sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  white-space: nowrap;
}

.sku-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--color-mist);
  color: var(--color-navy);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sku-table td {
  padding: 12px 16px;
  border-top: 1px solid rgba(11, 16, 48, 0.08);
  color: var(--color-ink);
}

.sku-table__actions {
  text-align: right;
}

.sku-table__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(23, 47, 86, 0.2);
  background: var(--color-white);
  color: var(--color-blue);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sku-table__download:hover:not(:disabled) {
  background: var(--gradient-brand);
  border-color: transparent;
  color: #ffffff;
}

.sku-table__download:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.order-code__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.order-code__result {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  box-shadow: 0 16px 34px rgba(23, 47, 86, 0.22);
}

.order-code__result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.order-code__result-text {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.order-code__result-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.order-code__result-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.03em;
  word-break: break-all;
}

.order-code__download {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 0.9rem;
}

.order-code__copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.15s var(--ease-out);
}

.order-code__copy:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--color-navy);
}

.order-code__copy:active {
  transform: scale(0.96);
}

.order-code__copy.is-copied {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--color-navy);
}

.order-code__copy svg {
  flex: none;
}

.order-code__copy .icon-check {
  display: none;
}

.order-code__copy.is-copied .icon-copy {
  display: none;
}

.order-code__copy.is-copied .icon-check {
  display: block;
}

.order-code__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-code__field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-blue-text);
}

.order-code__field select {
  appearance: none;
  width: 100%;
  padding: 11px 36px 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(11, 16, 48, 0.14);
  background: var(--color-white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23172f56' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  background-size: 16px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-ink);
  cursor: pointer;
  transition: border-color 0.25s ease;
}

.order-code__field select:hover,
.order-code__field select:focus {
  border-color: var(--color-blue);
  outline: none;
}

.product-detail__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(11, 16, 48, 0.1);
}

@media (max-width: 960px) {
  .product-detail__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-detail__media {
    position: static;
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .spec-list__row {
    flex-direction: column;
    gap: 4px;
  }

  .spec-list__row dd {
    text-align: left;
  }

  .sku-table-wrap {
    overflow-x: visible;
    border: none;
  }

  .sku-table,
  .sku-table tbody,
  .sku-table tr,
  .sku-table td {
    display: block;
    width: 100%;
    white-space: normal;
  }

  .sku-table thead {
    display: none;
  }

  .sku-table tr {
    margin-bottom: 14px;
    border: 1px solid rgba(11, 16, 48, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }

  .sku-table tr:last-child {
    margin-bottom: 0;
  }

  .sku-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid rgba(11, 16, 48, 0.08);
    font-size: 0.86rem;
  }

  .sku-table td:first-child {
    border-top: none;
    background: var(--color-mist);
    font-weight: 700;
  }

  .sku-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-blue-text);
  }
}

/* Two fixed half-width columns so tiles stay a consistent size regardless of
   count: a lone image occupies one column (same size as one of a pair) rather
   than stretching to full width. */
.product-detail__diagrams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* When a product has a single Dimensions image and a single Light Distribution
   image, show the two sections side by side instead of stacked full-width. */
.product-detail__diagrams-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 40px);
}

.product-detail__diagrams-pair .spec-block {
  margin-bottom: 40px;
}

/* Inside the side-by-side pair each section already sits in a half-width
   column, so its single image should fill that column. */
.product-detail__diagrams-pair .product-detail__diagrams {
  grid-template-columns: 1fr;
}

@media (max-width: 560px) {
  .product-detail__diagrams,
  .product-detail__diagrams-pair {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.product-detail__diagram {
  margin: 0;
  border: 1px solid rgba(11, 16, 48, 0.1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-white);
}

.product-detail__diagram img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--color-white);
}

.product-detail__diagram figcaption {
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-navy);
  text-align: center;
  border-top: 1px solid rgba(11, 16, 48, 0.08);
  background: var(--color-mist);
}

/* Diagram files that are PDFs (not rasterized) render as a link card
   instead of an <img>, in the same tile footprint as an image diagram. */
.product-detail__diagram--pdf a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 16px;
  color: var(--color-navy);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  background: var(--color-mist);
  transition: background 0.25s ease, color 0.25s ease;
}

.product-detail__diagram--pdf a:hover {
  background: var(--gradient-brand);
  color: #ffffff;
}

.product-detail__diagram--pdf svg {
  width: 34px;
  height: 34px;
  color: var(--color-blue);
  flex-shrink: 0;
  transition: color 0.25s ease;
}

.product-detail__diagram--pdf a:hover svg {
  color: #ffffff;
}

