/* Single product page — sticky media grid + scrolling content */

.product-page {
  background: var(--gray-bg);
  padding-top: calc(var(--header-h) + 48px);
}

.product-page__split {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-bottom: clamp(48px, 6vw, 72px);
}

.product-page__media {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  z-index: 2;
}

.product-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-media-grid__cell {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 4px 20px rgba(11, 31, 58, 0.06);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-media-grid__cell:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(11, 31, 58, 0.12);
}

.product-media-grid__cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Crop baked-in white frames on Adaptors product shots */
.product-media-grid__cell img[src*="adaptor_03_dome"],
.product-media-grid__cell img[src*="adaptor_05_pip"] {
  transform: scale(1.1);
  transform-origin: center center;
}

.product-gallery__slide:has(img[src*="adaptor_03_dome"]),
.product-gallery__slide:has(img[src*="adaptor_05_pip"]) {
  overflow: hidden;
  border-radius: var(--radius);
}

.product-gallery__slide img[src*="adaptor_03_dome"],
.product-gallery__slide img[src*="adaptor_05_pip"] {
  transform: scale(1.1);
  transform-origin: center center;
}

.product-gallery__slide:has(img[src*="adaptor_03_dome"]):hover img,
.product-gallery__slide:has(img[src*="adaptor_05_pip"]):hover img {
  transform: scale(1.13);
}

.product-page__content {
  min-width: 0;
  padding-top: 8px;
}

.product-header {
  margin-bottom: 0;
  padding-bottom: clamp(20px, 2.2vw, 28px);
  border-bottom: 1px solid var(--divider);
}

.product-header__title {
  margin: 0 0 20px;
  font-size: clamp(32px, 3.5vw, 48px);
  font-weight: 700;
  line-height: 1.12;
  color: var(--text);
}

.product-header__status {
  display: block;
  margin: 8px 0 0;
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--text-muted);
}

.product-header__desc {
  margin: 0 0 28px;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
}

.product-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn--purple,
.btn--purple-outline {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  white-space: nowrap;
}

.btn--purple {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--purple);
  color: var(--white);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.btn--purple:hover {
  filter: brightness(1.05);
}

.btn--purple-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  border: 1px solid var(--purple);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--purple);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.btn--purple-outline:hover {
  background: rgba(137, 65, 129, 0.06);
}

.product-block {
  padding: clamp(28px, 3vw, 40px) 0;
  border-bottom: 1px solid var(--divider);
}

.product-header + .product-block {
  padding-top: clamp(18px, 2vw, 24px);
}

.product-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.product-block__title {
  margin: 0 0 20px;
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.product-block__text {
  margin: 0;
  max-width: 100%;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
}

.product-sizes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-sizes-list__item {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid rgba(0, 168, 168, 0.35);
  border-radius: 999px;
  background: rgba(0, 168, 168, 0.08);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: normal;
}

/* Gallery */
.product-block--gallery .product-gallery {
  position: relative;
  max-width: 100%;
}

.product-gallery__viewport {
  overflow: hidden;
  border-radius: var(--radius);
}

.product-gallery__track {
  display: flex;
  gap: 12px;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-gallery__slide {
  flex: 0 0 calc((100% - 24px) / 3);
  min-width: 0;
  cursor: pointer;
}

.product-gallery__slide img {
  width: 100%;
  aspect-ratio: 278 / 209;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  transition: transform 0.3s ease;
}

.product-gallery__slide:hover img {
  transform: scale(1.03);
}

.product-gallery__arrow {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  background: none;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.12));
}

.product-gallery__arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.product-gallery__arrow--prev {
  left: 8px;
}

.product-gallery__arrow--next {
  right: 8px;
}

.product-gallery__arrow img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Certifications (inline in content column) */
.product-block--certs .product-certs__grid {
  display: block;
}

.product-certs__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 16px 20px;
}

.product-certs__badge {
  width: clamp(64px, 9vw, 88px);
  height: clamp(64px, 9vw, 88px);
  flex: 0 0 auto;
  object-fit: contain;
}

.product-certs__badge--usdmf {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid #000;
  background: #fff;
  box-sizing: border-box;
}

.product-certs__badge--usdmf img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}

/* Available sizes — full-width teal band */
.product-sizes-band {
  background: var(--teal);
  padding: clamp(48px, 5vw, 64px) 0 clamp(56px, 6vw, 72px);
}

.product-sizes-band__title {
  margin: 0 0 clamp(28px, 3vw, 40px);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--white);
  text-align: center;
}

.product-sizes-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 28px), transparent 100%);
}

.product-sizes-table-wrap:focus-within,
.product-sizes-table-wrap:hover {
  mask-image: none;
}

.product-sizes-table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

.product-sizes-table--wide {
  min-width: 980px;
}

.product-sizes-table thead th {
  padding: 16px 20px;
  background: var(--white);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
  border: none;
}

.product-sizes-table thead th:first-child {
  border-radius: 999px 0 0 999px;
  padding-left: 28px;
}

.product-sizes-table thead th:last-child {
  border-radius: 0 999px 999px 0;
  padding-right: 28px;
}

.product-sizes-table tbody td {
  padding: 18px 20px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--white);
  font-size: 15px;
  line-height: 1.45;
  vertical-align: middle;
  background: transparent;
  text-align: left;
}

.product-sizes-table tbody tr:last-child td {
  border-bottom: none;
}

.product-sizes-table__no {
  width: 72px;
  padding-left: 28px;
  font-weight: 700;
  white-space: nowrap;
}

.product-sizes-table__spec {
  max-width: 420px;
}

.product-sizes-table__dmf,
.product-sizes-table__iso {
  white-space: nowrap;
}

.product-sizes-table tbody td:last-child,
.product-sizes-table thead th:last-child {
  padding-right: 28px;
}

/* Centered S.No / Spec Name tables (Ophthalmics, Thermoforming, etc.) */
.product-sizes-table.product-sizes-table--centered thead th,
.product-sizes-table.product-sizes-table--centered tbody td,
.product-sizes-table.product-sizes-table--centered .product-sizes-table__no,
.product-sizes-table.product-sizes-table--centered .product-sizes-table__spec {
  text-align: center !important;
}

.product-sizes-table.product-sizes-table--centered thead th,
.product-sizes-table.product-sizes-table--centered tbody td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.product-sizes-table.product-sizes-table--centered thead th {
  padding-top: 12px;
  padding-bottom: 12px;
}

.product-sizes-table.product-sizes-table--centered thead th:first-child,
.product-sizes-table.product-sizes-table--centered .product-sizes-table__no {
  padding-left: 20px;
  padding-right: 20px;
  width: auto;
}

.product-sizes-table.product-sizes-table--centered thead th:last-child,
.product-sizes-table.product-sizes-table--centered tbody td:last-child,
.product-sizes-table.product-sizes-table--centered .product-sizes-table__spec {
  padding-left: 20px;
  padding-right: 20px;
  max-width: none;
}

/* Mobile size cards — desktop keeps the table */
.product-sizes-cards {
  display: none;
}

.product-sizes-card {
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.product-sizes-card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.product-sizes-card__no {
  flex: 0 0 auto;
  min-width: 28px;
  height: 26px;
  padding: 0 7px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
}

.product-sizes-card__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 3px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--white);
  text-transform: none;
}

.product-sizes-card__body {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.product-sizes-card__meta {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.product-sizes-card__meta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  padding-top: 1px;
}

.product-sizes-card__meta-value {
  font-size: 13px;
  line-height: 1.4;
  color: var(--white);
  word-break: break-word;
}

/* Related products */
.product-related {
  background: var(--gray-bg);
  padding: clamp(48px, 5vw, 70px) 0 clamp(64px, 7vw, 88px);
}

.product-related__title {
  margin: 0 0 clamp(36px, 4vw, 48px);
  text-align: center;
  line-height: 1.15;
}

.product-related__carousel {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  column-gap: 16px;
}

.product-related__viewport {
  min-width: 0;
  overflow: hidden;
}

.product-related__track {
  display: flex;
  gap: 24px;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.product-related__track .products-card {
  flex: 0 0 calc((100% - 120px) / 6);
  min-width: 0;
  width: calc((100% - 120px) / 6);
}

.product-related__arrow {
  width: 72px;
  height: 72px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  justify-self: center;
}

.product-related__arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.product-related__arrow img {
  width: 100%;
  height: 100%;
  display: block;
}

.product-related__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.product-related__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #d9dbde;
  cursor: pointer;
}

.product-related__dot.is-active {
  background: var(--teal);
}

/* Contact form modal */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

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

.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 31, 58, 0.55);
}

.contact-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 36px 32px 32px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 28px 72px rgba(11, 31, 58, 0.28);
  border-top: 6px solid var(--teal);
}

.contact-modal[data-intent='samples'] .contact-modal__dialog {
  border-top-color: var(--purple);
}

.contact-modal__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

.contact-modal[data-intent='samples'] .contact-modal__eyebrow {
  color: var(--purple);
}

.contact-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.contact-modal__close:hover {
  background: var(--gray-bg);
}

.contact-modal__title {
  margin: 0 40px 8px 0;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.contact-modal__subtitle {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 26px;
  color: var(--text-muted);
}

.contact-form-card--modal {
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

body.is-contact-modal-open {
  overflow: hidden;
}

@media (max-width: 1440px) {
  .product-page__split {
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    gap: 36px;
  }

  .btn--purple,
  .btn--purple-outline {
    height: 48px;
    font-size: 15px;
    padding: 0 18px;
  }
}

@media (max-width: 1280px) {
  .product-page__split {
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 28px;
  }

  .product-header__actions {
    gap: 10px;
  }
}

@media (min-width: 901px) and (max-height: 900px) {
  .product-page__media {
    top: calc(var(--header-h) + 12px);
  }

  .product-media-grid {
    gap: 10px;
  }

  .product-media-grid__cell {
    max-height: calc((100svh - var(--header-h) - 34px) / 2);
  }
}

@media (max-width: 1100px) {
  .product-page__split {
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    gap: 32px;
  }

  .product-gallery__slide {
    flex-basis: calc((100% - 12px) / 2);
  }
}

@media (max-width: 900px) {
  .product-page {
    padding-top: calc(var(--header-h) + 24px);
  }

  .product-page__split {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .product-page__media {
    position: static;
  }

  .product-media-grid {
    max-width: 520px;
    margin: 0 auto;
  }

  .product-header__desc {
    max-width: none;
  }

  .product-gallery__slide {
    flex-basis: calc((100% - 12px) / 2);
  }

  .product-related__carousel {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    column-gap: 8px;
  }

  .product-related__arrow {
    width: 44px;
    height: 44px;
  }

  .product-certs__badge {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 640px) {
  .product-page {
    padding-top: calc(var(--header-h) + 16px);
  }

  .product-page__split {
    gap: 22px;
    padding-bottom: 40px;
  }

  .product-header {
    margin-bottom: 0;
    padding-bottom: 20px;
  }

  .product-header + .product-block {
    padding-top: 18px;
  }

  .product-header__title {
    margin-bottom: 12px;
    font-size: clamp(28px, 8vw, 34px);
  }

  .product-header__desc {
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.6;
  }

  .product-header__actions {
    flex-direction: column;
    gap: 12px;
  }

  .btn--purple,
  .btn--purple-outline {
    width: 100%;
    min-width: 0;
    height: 48px;
    font-size: 16px;
  }

  .product-block {
    padding: 22px 0;
  }

  .product-block__title {
    margin-bottom: 14px;
    font-size: 24px;
  }

  .product-block__text {
    font-size: 15px;
    line-height: 1.65;
  }

  .product-gallery__slide {
    flex-basis: 100%;
  }

  .product-gallery__arrow {
    width: 40px;
    height: 40px;
  }

  .product-gallery__arrow--prev {
    left: 4px;
  }

  .product-gallery__arrow--next {
    right: 4px;
  }

  .product-media-grid {
    gap: 10px;
    max-width: none;
  }

  .product-certs__row {
    gap: 12px 14px;
  }

  .product-certs__badge {
    width: 60px;
    height: 60px;
  }

  .product-sizes-band {
    padding: 36px 0 44px;
  }

  .product-sizes-band__title {
    margin-bottom: 22px;
    font-size: clamp(24px, 7vw, 30px);
  }

  .product-sizes-table-wrap {
    display: none;
  }

  .product-sizes-cards {
    display: grid;
    gap: 12px;
  }

  .product-related {
    padding: 40px 0 56px;
  }

  .product-related__title {
    margin-bottom: 28px;
  }

  .product-related__carousel {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    column-gap: 6px;
  }

  .product-related__arrow {
    width: 36px;
    height: 36px;
  }

  .product-related__track .products-card .products-card__label {
    min-height: 36px;
    font-size: 14px;
    line-height: 18px;
  }

  .product-related__dots {
    margin-top: 20px;
  }

  .product-contact-modal,
  .contact-modal {
    padding: 16px;
  }
}
