/* ==========================================================================
   pages/product.css — Shared styles for product pages
   (towers, boilers, tanks, grates)
   ========================================================================== */

/* --- Product Page Hero (shorter) --- */

.product-hero {
  position: relative;
  height: 40vh;
  min-height: 280px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.product-hero__bg picture {
  width: 100%;
  height: 100%;
}

.product-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.product-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(26, 37, 48, 0.5) 0%,
    rgba(26, 37, 48, 0.8) 100%
  );
}

.product-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-inline: var(--container-pad);
}

.product-hero__title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--white);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.product-hero__subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

/* --- Product Info Layout --- */

.product-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

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

.product-info__image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: var(--light-bg);
}

.product-info__content h3 {
  margin-bottom: 16px;
}

.product-info__content p {
  color: var(--steel);
  line-height: 1.7;
}

.product-info__features {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-info__feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
}

.product-info__feature-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--brand-blue);
  margin-top: 2px;
}

/* --- Specs Table Section --- */

.specs-section {
  max-width: 100%;
  margin-inline: auto;
}

.specs-section .table-wrap {
  box-shadow:
    0 20px 50px rgba(43, 58, 78, 0.18),
    0 0 0 1px rgba(91, 181, 232, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.specs-section .product-table {
  table-layout: fixed;
  width: 100%;
}

.specs-section .product-table th,
.specs-section .product-table td {
  padding: 11px 8px;
  white-space: normal;
  text-align: center;
  word-break: break-word;
}

.specs-section .product-table th {
  font-size: 11px;
  line-height: 1.4;
}

.specs-section .product-table th:first-child,
.specs-section .product-table td:first-child {
  text-align: left;
  padding-left: 16px;
  border-radius: var(--radius-lg) 0 0 0;
}

.specs-section .product-table th:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}

.specs-section .product-table td:first-child {
  border-radius: 0;
}

/* --- Services Grid on Product Page --- */

.product-services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-service-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .product-service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
  }
}

.product-service-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--brand-blue);
}

.product-service-card__title {
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 8px;
}

.product-service-card__text {
  font-size: 14px;
  color: var(--steel);
  line-height: 1.6;
}

/* --- FAQ Section on Product Page --- */

.product-faq {
  max-width: 800px;
  margin-inline: auto;
}

/* --- Product CTA Banner --- */

.product-cta {
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--dark-bg) 100%);
  border-radius: var(--radius-lg);
}

.product-cta__title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--white);
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 12px;
}

.product-cta__text {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
  max-width: 480px;
  margin-inline: auto;
}

/* --- Product gallery (full-width secondary photos) --- */

.product-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.product-gallery__item {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--light-bg);
  height: 280px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.product-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  display: block;
}

@media (hover: hover) {
  .product-gallery__item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
  }
}

@media (max-width: 768px) {
  .product-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 24px;
  }

  .product-gallery__item {
    height: 220px;
  }
}

@media (max-width: 480px) {
  .product-gallery {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-gallery__item {
    height: 240px;
  }
}

/* --- Product page variants --- */

.product-page--towers .product-hero__overlay {
  background: linear-gradient(
    180deg,
    rgba(26, 37, 48, 0.4) 0%,
    rgba(26, 37, 48, 0.85) 100%
  );
}

/* --- Responsive: Product Pages --- */

@media (max-width: 768px) {
  .product-hero {
    height: 30vh;
    min-height: 220px;
  }

  .product-info {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-services {
    grid-template-columns: 1fr;
  }

  .product-cta {
    padding: 32px 20px;
  }
}

@media (max-width: 480px) {
  .product-hero {
    min-height: 180px;
  }

  .product-service-card {
    padding: 20px 16px;
  }
}

.product-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.product-tabs__btn {
  padding: 10px 24px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  border: 2px solid var(--brand-blue);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--brand-dark);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.product-tabs__btn.is-active,
.product-tabs__btn:active {
  background: var(--brand-blue);
  color: var(--white);
}
@media (hover: hover) {
  .product-tabs__btn:hover {
    background: var(--brand-blue);
    color: var(--white);
  }
}

@media (max-width: 768px) {
  .product-tabs {
    gap: 6px;
    margin-bottom: 24px;
  }

  .product-tabs__btn {
    min-height: 44px;
    flex: 1 1 auto;
    padding-inline: 16px;
    font-size: 13px;
  }
}

/* ==========================================================================
   Product Gallery Slider (.pg-slider)
   ========================================================================== */

.pg-slider {
  max-width: 860px;
  margin-inline: auto;
  margin-top: 40px;
}

.pg-slider__desc {
  text-align: center;
  margin-bottom: 32px;
}

.pg-slider__desc h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--brand-dark);
  margin-bottom: 16px;
}

.pg-slider__desc p {
  color: var(--steel);
  line-height: 1.7;
  max-width: 640px;
  margin-inline: auto;
}

/* Центрована колонка на сторінці, текст по лівому краю (Баки, Колосники) */
.pg-slider__desc--left-column {
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 32px;
  text-align: left;
}

.pg-slider__desc--left-column p,
.pg-slider__desc--left-column div {
  margin-inline: 0;
  max-width: none;
}

.pg-slider__stage-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--light-bg);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-md);
}

.pg-slider__stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.pg-slider__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.pg-slider__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.pg-slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  display: block;
}

.pg-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(26, 37, 48, 0.55);
  border: none;
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.pg-slider__arrow--prev { left: 12px; }
.pg-slider__arrow--next { right: 12px; }

@media (hover: hover) {
  .pg-slider__arrow:hover {
    background: rgba(26, 37, 48, 0.85);
  }
}

.pg-slider__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
  justify-content: center;
}

.pg-slider__thumb {
  flex: 0 0 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--light-bg);
  padding: 0;
  transition: border-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.pg-slider__thumb.is-active {
  border-color: var(--brand-blue);
}

@media (hover: hover) {
  .pg-slider__thumb:hover {
    border-color: var(--brand-blue);
  }
}

.pg-slider__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--light-bg);
}

/* Tablet */
@media (max-width: 768px) {
  .pg-slider {
    margin-top: 24px;
  }

  .pg-slider__desc {
    margin-bottom: 24px;
  }

  .pg-slider__stage-wrap {
    aspect-ratio: 16 / 11;
    border-radius: var(--radius-sm);
  }

  .pg-slider__arrow {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .pg-slider__arrow--prev { left: 8px; }
  .pg-slider__arrow--next { right: 8px; }

  .pg-slider__thumb {
    flex: 0 0 64px;
    height: 48px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .pg-slider__stage-wrap {
    aspect-ratio: 4 / 3;
  }

  .pg-slider__thumbs {
    justify-content: flex-start;
  }

  .pg-slider__thumb {
    flex: 0 0 56px;
    height: 42px;
  }

  .pg-slider__arrow {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .pg-slider__arrow--prev { left: 4px; }
  .pg-slider__arrow--next { right: 4px; }
}

/* iOS Safari safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pg-slider__thumbs {
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }
}
