/* ==========================================================================
   OASIS POOL SERVICES -- Pool Styles Product Page
   Filter bar, model sections, specs table, accessories grid,
   color finishes, technology section, and responsive overrides
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. PAGE HERO WITH VIDEO
   -------------------------------------------------------------------------- */
.page-hero--video {
  position: relative;
  overflow: hidden;
  background: var(--color-dark-bg);
}

.page-hero--video::before {
  display: none;
}

.page-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 27, 46, 0.45);
  z-index: 1;
}

.page-hero--video .page-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .page-hero__video {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   1. FILTER BAR
   Horizontal scrollable on mobile, centered wrap on desktop.
   Mirrors .filter-btn pattern from the gallery page.
   -------------------------------------------------------------------------- */
.pool-filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.pool-filter-btn {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 100px;
  border: 1.5px solid rgba(12, 35, 64, 0.15);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-height: 44px;
}

.pool-filter-btn:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.pool-filter-btn:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.pool-filter-btn.active {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
}

/* --------------------------------------------------------------------------
   2. POOL MODEL SECTIONS
   Alternating image + content grid with RTL flip on even children.
   Follows the service-detail alternating pattern from services-page.css.
   -------------------------------------------------------------------------- */
.pool-model {
  padding: 3rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.pool-model:last-child {
  border-bottom: none;
}

.pool-model:nth-child(even) {
  background: var(--color-surface);
}

.pool-model__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Reverse layout for even models */
.pool-model:nth-child(even) .pool-model__inner {
  direction: rtl;
}

.pool-model:nth-child(even) .pool-model__inner > * {
  direction: ltr;
}

@media (min-width: 1024px) {
  .pool-model__inner {
    grid-template-columns: 1.3fr 1fr;
    gap: 3rem;
  }
}

/* --- Gallery image --- */
.pool-model__gallery {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(0, 180, 216, 0.08),
    rgba(12, 35, 64, 0.06)
  );
}

.pool-model__gallery img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  transition: transform 0.6s var(--ease);
}

.pool-model__gallery:hover img {
  transform: scale(1.04);
}

/* --- Content block --- */
.pool-model__content {
  max-width: 560px;
}

.pool-model__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--color-primary);
  margin-bottom: 0.25rem;
  line-height: 1.1;
}

.pool-model__tagline {
  font-size: 1.1rem;
  color: var(--color-secondary);
  font-weight: 500;
  margin-bottom: 1rem;
}

.pool-model__desc {
  font-size: 1rem;
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* --- Feature checklist --- */
.pool-model__features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pool-model__feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-primary);
}

.pool-model__feature svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-secondary);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   3. SPECS TABLE
   Compact, branded table with hover rows and rounded header corners.
   -------------------------------------------------------------------------- */
.pool-model__specs {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.pool-model__specs thead {
  background: var(--color-primary);
  color: var(--color-white);
}

.pool-model__specs th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pool-model__specs th:first-child {
  border-radius: 8px 0 0 0;
}

.pool-model__specs th:last-child {
  border-radius: 0 8px 0 0;
}

.pool-model__specs td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--color-text);
}

.pool-model__specs tbody tr:hover {
  background: rgba(0, 180, 216, 0.05);
}

/* --------------------------------------------------------------------------
   4. SPAS & TANNING LEDGES -- ACCESSORIES GRID
   Three-column card layout with lift-on-hover.
   -------------------------------------------------------------------------- */
.accessories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .accessories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.accessory-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.accessory-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.accessory-card__image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.accessory-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.accessory-card:hover .accessory-card__image img {
  transform: scale(1.05);
}

.accessory-card__content {
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.accessory-card__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.accessory-card__type {
  font-size: 0.82rem;
  color: var(--color-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.accessory-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.7;
  text-align: center;
  padding: 0 0.5rem;
}

/* --------------------------------------------------------------------------
   5. COLOR FINISHES -- CLEAN VIDEO SHOWCASE
   -------------------------------------------------------------------------- */
.color-finishes {
  padding: 3rem 0 4rem;
  background: var(--color-bg);
}

.color-finishes__video-container {
  max-width: 1000px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(12, 35, 64, 0.15);
}

.color-finishes__showcase-video {
  width: 100%;
  height: auto;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .color-finishes__showcase-video {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   6. TECHNOLOGY SECTION
   Two-column card grid + centered warranty badges.
   -------------------------------------------------------------------------- */
.tech-section {
  padding: 3.5rem 0;
  background: var(--color-surface);
}

.tech-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.12), rgba(12, 35, 64, 0.06));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.tech-card__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-secondary);
}

.tech-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tech-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s ease;
}

.tech-card:hover {
  box-shadow: var(--shadow-hover);
}

.tech-card__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-secondary);
  margin-bottom: 0.4rem;
}

.tech-card__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.tech-card__desc {
  font-size: 0.92rem;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* --- Warranty badges --- */
.warranty-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.warranty-badge__icon {
  margin-bottom: 0.5rem;
}

.warranty-badge__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-secondary);
}

.warranty-badge {
  background: var(--color-white);
  border: 1px solid rgba(0, 180, 216, 0.2);
  color: var(--color-primary);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 180px;
  transition: transform 0.3s ease;
}

.warranty-badge:hover {
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   7. POOL MODEL FILTER STATE
   Hide models that do not match the active filter.
   -------------------------------------------------------------------------- */
.pool-model[data-visible="false"] {
  display: none;
}

/* --------------------------------------------------------------------------
   8. MOBILE RESPONSIVE OVERRIDES
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .pool-model__features {
    grid-template-columns: 1fr;
  }

  .pool-filter-bar {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 1rem;
  }

  .pool-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .pool-model__specs {
    font-size: 0.82rem;
  }

  .pool-model__specs th,
  .pool-model__specs td {
    padding: 8px 12px;
  }

  .warranty-badges {
    flex-direction: column;
    align-items: center;
  }

  .warranty-badge {
    width: 100%;
    max-width: 320px;
  }

  .pool-model:nth-child(even) .pool-model__inner {
    direction: ltr;
  }
}

@media (max-width: 480px) {
  .pool-model {
    padding: 2rem 0;
  }

  .pool-model__name {
    font-size: clamp(1.5rem, 5vw, 3rem);
  }

  .pool-model__specs th,
  .pool-model__specs td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .color-swatch__circle {
    width: 56px;
    height: 56px;
  }

  .color-swatch__name {
    font-size: 0.85rem;
  }

  .warranty-badge {
    min-width: 140px;
    font-size: 0.82rem;
    padding: 0.75rem 1rem;
  }
}

/* --------------------------------------------------------------------------
   9. REDUCED MOTION
   Respect user preference for reduced motion.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .pool-model__gallery img,
  .accessory-card__image img,
  .accessory-card,
  .color-swatch,
  .tech-card,
  .warranty-badge,
  .pool-filter-btn {
    transition: none;
  }

  .pool-model__gallery:hover img,
  .accessory-card:hover .accessory-card__image img {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   IMAGE LIGHTBOX
   -------------------------------------------------------------------------- */
.pool-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 2rem;
}

.pool-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.pool-lightbox__img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pool-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 2.5rem;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.pool-lightbox__close:hover {
  opacity: 0.7;
}

.pool-model__gallery img {
  cursor: pointer;
}

/* ---- Lazy section reveal ---- */
/* content-visibility skips paint/layout for off-screen sections entirely */
.pool-model {
  content-visibility: auto;
  contain-intrinsic-size: 0 600px; /* estimated height, prevents scroll jump */
}

/* Sections start invisible; JS IntersectionObserver adds .is-visible */
.pool-model.lazy-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.pool-model.lazy-section.is-visible {
  opacity: 1;
  transform: none;
}
