/* Product Hero */
.product-hero {
  padding: var(--section-padding) 0;
}

.product-hero__inner {
  display: flex;
  gap: var(--spacing-xl);
  align-items: center;
  height: 450px;
}

.product-hero__gallery {
  flex: 0 0 50%;
  display: flex;
  gap: var(--spacing-sm);
  height: 450px;
}

/* Thumbnails — vertical strip */
.product-gallery__thumbs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
  height: 450px;
  overflow-y: auto;
  scrollbar-width: none;
}

.product-gallery__thumbs::-webkit-scrollbar {
  display: none;
}

/* Custom scrollbar indicator */
.product-gallery__scrollbar {
  width: 4px;
  height: 450px;
  background: var(--color-medium-gray);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
}

.product-gallery__scrollbar-thumb {
  width: 100%;
  background: var(--color-error-orange);
  border-radius: 4px;
  position: absolute;
  top: 0;
  transition: top var(--transition-fast);
}

.product-gallery__thumb {
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.product-gallery__thumb.is-active {
  opacity: 1;
}

.product-gallery__thumb:not(.is-active) {
  opacity: 0.5;
}

.product-gallery__thumb img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
}

/* Main image */
.product-gallery__main {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-gallery__slides {
  width: 100%;
  position: relative;
}

.product-gallery__slide {
  opacity: 0;
  position: absolute;
  inset: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.product-gallery__slide.is-active {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}

.product-gallery__slide img {
  width: 450px;
  height: 450px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Arrows */
.product-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: opacity var(--transition-fast);
}

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

.product-gallery__arrow:hover {
  opacity: 0.85;
}

.product-gallery__arrow--prev {
  left: 0;
}

.product-gallery__arrow--prev img {
  transform: rotate(180deg);
}

.product-gallery__arrow--next {
  right: 0;
}

.product-hero__info {
  flex: 1;
}

.product-hero__type {
  display: block;
  font-size: var(--details-size);
  line-height: var(--details-lh);
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
}

.product-hero__title {
  font-size: var(--h2-size);
  line-height: var(--h2-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-blue);
  margin: 0 0 34px;
}

.product-hero__description {
  font-size: var(--p-size);
  line-height: var(--p-lh);
  color: var(--color-dark-blue);
  margin-bottom: 34px;
}

.product-hero__resources {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--spacing-xl);
}

.product-hero__resources a {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--color-dark-blue);
  font-size: var(--p-size);
  line-height: var(--p-lh);
  font-weight: var(--font-weight-regular);
  text-decoration: none;
}

.product-hero__resources a::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 22px;
  background: url('../../images/res.svg') no-repeat center / contain;
  flex-shrink: 0;
}

.product-hero__cta {
  margin-top: var(--spacing-lg);
}

/* Spec Table */
.product-specs {
  padding: var(--spacing-lg) 0;
}

.product-specs .spec-table {
  margin-bottom: 32px;
}

.product-specs .spec-table:last-child {
  margin-bottom: 0;
}

.product-specs .spec-table__additional {
  margin-top: 32px;
  margin-bottom: 32px;
}

.spec-table {
  background: var(--color-background-alt);
  border-radius: var(--radius-card-lg);
  padding: var(--spacing-lg);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

.spec-table__title {
  font-size: var(--h2-size);
  line-height: var(--h2-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-blue);
  margin: 0 0 var(--spacing-md);
}

.spec-table__description {
  font-size: var(--p-size);
  line-height: var(--p-lh);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
}

/* Spec Rows */
.spec-table__rows > div {
  display: flex;
  flex-direction: column;
}

.spec-row {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) 0;
}

.spec-table__rows > div > div {
  border-bottom: 1px solid color-mix(in srgb, var(--color-text-primary) 50%, transparent);
}

.spec-table__rows > div > div:last-child {
  border-bottom: none;
}

.spec-row__label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
  font-size: var(--h4-size);
  line-height: var(--h4-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-blue);
}

.spec-row__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-error-orange);
  flex-shrink: 0;
}

.spec-row__value {
  flex: 0 0 50%;
  font-size: var(--p-size);
  line-height: var(--p-lh);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-regular);
}

.spec-row__tooltip {
  position: relative;
  cursor: help;
  margin-left: -4px;
}

.spec-row__tooltip-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
}

.spec-row__tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  background: var(--color-white);
  color: var(--color-dark-blue);
  padding: var(--spacing-sm);
  border-radius: var(--radius-card);
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-dark-blue) 20%, transparent);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 250px;
  z-index: 10;
  margin-bottom: 6px;
}

/* Additional specs accordion (rows 7+) */
.spec-table__rows > div > div:nth-child(n+7) {
  display: none;
}

.spec-table__rows.is-expanded > div > div:nth-child(n+7) {
  display: flex;
}

.spec-table__additional {
  background: var(--color-background-alt);
  border-radius: var(--radius-card-lg);
  margin-top: var(--spacing-30);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
  overflow: visible;
  overflow: hidden;
}

.spec-table__toggle {
  display: none;
  width: 100%;
  padding: var(--spacing-lg);
  background: var(--color-background-alt);
  border: none;
  cursor: pointer;
  font-size: var(--h4-size);
  line-height: var(--h4-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-blue);
  text-align: left;
  justify-content: space-between;
  align-items: center;
}

.spec-table__toggle .toggle-icon {
  width: 16px;
  height: 16px;
  background: url('../../images/plus.svg') no-repeat center / contain;
  transition: transform var(--transition-slow);
}

.spec-table__additional-rows {
  max-height: 0;
  overflow: hidden;
  padding: 0 var(--spacing-lg);
  transition: max-height var(--transition-slow), padding var(--transition-slow);
}

.spec-table__additional.is-expanded .spec-table__additional-rows {
  max-height: 1000px;
  padding: 0 var(--spacing-lg) var(--spacing-lg);
  overflow: visible;
}

.spec-table__additional-rows > div {
  border-bottom: 1px solid color-mix(in srgb, var(--color-text-primary) 50%, transparent);
}

.spec-table__additional-rows > div:last-child {
  border-bottom: none;
}

.spec-table__additional.is-expanded .toggle-icon {
  transform: rotate(135deg);
}

.spec-table__toggle .toggle-icon {
  display: inline-block;
}

/* Stacked style — label above value */
.spec-table--stacked .spec-table__title {
  font-size: 24px;
  line-height: 26px;
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0;
  text-transform: none;
}

.spec-table--stacked .spec-table__description {
  margin-bottom: 0;
}

.spec-table--stacked .spec-table__rows > div > div {
  border-bottom: none;
}

.spec-table--stacked .spec-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: var(--spacing-sm) 0 0 22px;
  position: relative;
}

.spec-table--stacked .spec-row__dot {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: block !important;
}

.spec-table--stacked .spec-row__label {
  flex: none;
  width: 100%;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text-primary) 50%, transparent);
  padding-bottom: var(--spacing-xs);
  gap: 0;
  font-size: 16px;
  line-height: 18px;
  font-weight: var(--font-weight-regular);
}

.spec-table--stacked .spec-row__label > span:first-child {
  display: none;
}

.spec-table--stacked .spec-row__value {
  flex: none;
  width: 100%;
  padding-top: var(--spacing-xs);
  padding-bottom: 0;
  font-size: 16px;
  line-height: 18px;
  font-weight: var(--font-weight-regular);
  color: var(--color-text-primary);
}

.spec-table.spec-table--stacked .spec-table__rows > div > div:last-child .spec-row .spec-row__value,
.spec-table--stacked .spec-table__additional-rows > div:last-child .spec-row .spec-row__value {
  border-bottom: none !important;
}

/* Mobile */
@media (max-width: 767px) {
  .product-hero {
    padding: var(--spacing-xl) 0;
  }

  .product-hero__inner {
    flex-direction: column;
    height: auto;
    gap: var(--spacing-lg);
  }

  /* Gallery — full width, thumbs below */
  .product-hero__gallery {
    flex: none;
    width: 100%;
    height: auto;
    flex-direction: column-reverse;
    gap: 0;
  }

  .product-gallery__main {
    position: relative;
  }

  .product-gallery__slides {
    width: 100%;
  }

  .product-gallery__slide img {
    width: 100%;
    height: auto;
    max-height: 300px;
  }

  /* Arrows */
  .product-gallery__arrow {
    width: 30px;
    height: 30px;
  }

  .product-gallery__arrow--prev {
    left: 0;
  }

  .product-gallery__arrow--next {
    right: 0;
  }

  /* Thumbs — horizontal row, 4 visible at a time */
  .product-gallery__thumbs {
    flex-direction: row;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }

  .product-gallery__thumbs::-webkit-scrollbar {
    display: none;
  }

  .product-gallery__thumb {
    flex: 0 0 25%;
    display: flex;
    justify-content: center;
    scroll-snap-align: start;
  }

  .product-gallery__thumb img {
    width: 80px;
    height: 80px;
  }

  /* Hide scrollbar on mobile */
  .product-gallery__scrollbar {
    display: none;
  }

  /* Info */
  .product-hero__info {
    flex: none;
    width: 100%;
  }

  .product-hero__title {
    font-size: var(--h2-size);
    line-height: var(--h2-lh);
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
  }

  .product-hero__description {
    margin-bottom: var(--spacing-sm);
  }

  .product-hero__resources {
    margin-bottom: var(--spacing-lg);
  }

  /* Specs */
  .product-specs {
    padding: var(--spacing-xl) 0;
  }

  .spec-table,
  .spec-table__additional {
    padding: var(--container-padding);
    box-shadow: none;
  }

  .spec-table__title {
    font-size: var(--h2-size);
    line-height: var(--h2-lh);
    text-transform: uppercase;
  }

  .spec-row {
    flex-direction: row;
    align-items: center;
    padding: var(--spacing-sm) 0 var(--spacing-xs);
  }

  .spec-row__label {
    font-size: 14px;
    line-height: 18px;
    flex: 0.7;
    gap: var(--spacing-xs);
  }

  .spec-row__value {
    flex: 1.3;
    font-size: 14px;
    line-height: 18px;
    text-align: left;
  }

  .spec-row__dot {
    width: 6px;
    height: 6px;
  }

  .spec-row__tooltip {
    display: none;
  }

  .spec-table__additional {
    padding: 0;
  }

  .spec-table__toggle {
    padding: var(--container-padding);
    font-size: 24px;
    line-height: 26px;
  }

  .spec-table__additional-rows {
    padding: 0 var(--container-padding);
  }

  .spec-table__additional.is-expanded .spec-table__additional-rows {
    padding: 0 var(--container-padding) var(--container-padding);
  }

  .spec-table__toggle .toggle-icon {
    width: 10px;
    height: 10px;
    margin-top: 0;
  }

  .spec-table:not(.spec-table--stacked) .spec-table__additional-rows > div:last-child {
    border-bottom: 1px solid color-mix(in srgb, var(--color-text-primary) 50%, transparent);
  }

  .spec-table:not(.spec-table--stacked) .spec-table__rows > div > div:last-child {
    border-bottom: 1px solid color-mix(in srgb, var(--color-text-primary) 50%, transparent);
  }
}
