/* ========================================
   SINGLE PRODUCT PAGE STYLES
   Modular, reusable, GEO-safe
   ======================================== */

/* ========================================
   MAIN WRAPPER
   ======================================== */

.sx-product-page {
  --brand: var(--color-brand-blue);
  --brand-gray: var(--color-brand-gray);
  --border: rgba(45, 132, 205, .07);
  --bg-soft: var(--color-bg-blue-tint);
  --bg-hover: var(--color-bg-light-gray);
  --text: var(--color-text);
  --text-muted: var(--color-brand-gray);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: var(--shadow-sm);
  
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ========================================
   1. HERO SECTION (Minimalist)
   ======================================== */

.sx-product-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 60px;
  align-items: start;
}

@media (min-width: 992px) {
  .sx-product-hero {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
  }
}

/* Image Swap (main + hover image) */
.sx-image-swap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.sx-image-swap .sx-main-image,
.sx-image-swap .sx-hover-image {
  display: block;
  width: 100%;
  transition: opacity 0.35s ease;
}

.sx-image-swap .sx-hover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.sx-image-swap:hover .sx-main-image {
  opacity: 0.15;
}

.sx-image-swap:hover .sx-hover-image {
  opacity: 1;
}

/* Hero Image */
.sx-product-hero-image .sx-image-swap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sx-product-hero-image .sx-main-image,
.sx-product-hero-image .sx-hover-image {
  border-radius: var(--radius);
}

/* Hero Content */
.sx-product-hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Category Title */
.sx-product-category {
  font-size: 1.3rem;
  color: var(--color-brand-blue);
  font-weight: 500;
  margin: 0;
  text-decoration: none;
  display: inline-block;
  transition: font-weight 0.2s ease;
}

.sx-product-category:hover {
  font-weight: 700;
}

/* Product Name (H1) */
.sx-product-name {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brand-gray);
  margin: 0;
}

@media (max-width: 768px) {
  .sx-product-name {
    font-size: 2rem;
  }
}

/* Product Tagline */
.sx-product-tagline {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

/* Price / Quote Indicator */
.sx-product-price {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0;
}

/* CTA Row in Hero */
.sx-product-hero .sx-btn-row {
  margin-top: 10px;
}

/* ========================================
   2. TAB SECTION (Description + Specs)
   Progressive Enhancement with <details>
   ======================================== */

.sx-product-tabs {
  margin: 60px 0;
}

/* Tab Wrapper (looks like tabs on desktop) */
.sx-product-tab-list {
  display: grid;
  grid-template-columns: max-content max-content 1fr;
  align-items: end;
  column-gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

/* Hidden radio controls */
.sx-product-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Visible tab labels */
.sx-product-tab-label {
  grid-row: 1;
  display: block;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: #f4f4f4;
  padding: 14px 24px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.sx-product-tab-input:checked + .sx-product-tab-label {
  color: var(--brand);
  background: var(--bg-soft);
  border-color: var(--brand);
  border-left: 4px solid var(--brand);
  padding-left: 20px;
}

.sx-product-tab-label:hover {
  background: var(--bg-hover);
}

/* Tab Content */
.sx-product-tab-content {
  grid-column: 1 / -1;
  grid-row: 2;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-top: none;
  padding: 30px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  display: none;
}

#sx-product-tab-overview:checked ~ #sx-product-panel-overview,
#sx-product-tab-specs:checked ~ #sx-product-panel-specs {
  display: block;
}

/* Tab Content Typography */
.sx-product-tab-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.sx-product-tab-content ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.sx-product-tab-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Specs Table */
.sx-product-specs-table {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-white);
}

.sx-product-specs-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sx-product-specs-row:last-child {
  border-bottom: none;
}

.sx-product-specs-label {
  padding: 12px 16px;
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--brand);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.sx-product-specs-value {
  padding: 12px 16px;
  color: var(--text);
}

@media (max-width: 768px) {
  .sx-product-specs-row {
    grid-template-columns: 1fr;
  }
  
  .sx-product-specs-label {
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
}

/* CTA at bottom of specs tab */
.sx-product-tab-content .sx-btn-row {
  margin-top: 30px;
}

/* ========================================
   3. RELATED PRODUCTS (4-Tab Grid)
   Modules | Accessories | Cells | Electrodes
   ======================================== */

.sx-product-related {
  margin: 40px 0;
  /*background: var(--bg-soft);*/
  padding: 40px 30px;
  /*border-radius: var(--radius);*/
}

.sx-product-related-header {
  text-align: center;
  margin-bottom: 40px;
}

.sx-product-related-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-gray);
  margin: 0 0 10px 0;
}

.sx-product-related-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0;
}

/* Tab Navigation */
.sx-product-related-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
  justify-content: center;
}

.sx-product-related-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.sx-product-related-tab:hover {
  color: var(--brand);
  background: var(--bg-hover);
}

.sx-product-related-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: var(--bg-soft);
}

/* Tab Content Panels */
.sx-product-related-panel {
  display: none;
}

.sx-product-related-panel.active {
  display: block;
}

/* Product Grid inside tabs (reuses existing grid structure) */
.sx-product-related-panel .sx-product-related-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 20px;
}

@media (min-width: 768px) {
  .sx-product-related-panel .sx-product-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .sx-product-related-panel .sx-product-related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Product Cards */
.sx-product-related-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--color-white);
  padding: 16px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sx-product-related-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.sx-product-related-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.sx-product-related-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--brand);
  margin: 0 0 8px 0;
}

.sx-product-related-card p {
  font-size: 0.9375rem;
  color: var(--text);
  margin: 0 0 12px 0;
  flex: 1;
  line-height: 1.5;
}

.sx-product-related-card a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}

.sx-product-related-card a:hover {
  text-decoration: underline;
}

/* ========================================
  4. FAQ SECTION
  ======================================== */

.sx-product-faq {
  margin: 60px 0;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.sx-product-faq::before {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: rgba(45, 132, 205, 0.12);
  margin-bottom: 50px;
}

.sx-product-faq-header {
  text-align: center;
  margin-bottom: 40px;
}

.sx-product-faq-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-gray);
  margin: 0 0 10px 0;
}

.sx-faq-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.sx-faq-item {
  margin-bottom: 10px;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  background: var(--color-white);
  transition: all 0.3s ease;
}

.sx-faq-item:hover {
  border-color: rgba(45, 132, 205, 0.3);
  box-shadow: var(--shadow-sm);
}

.sx-faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-headings);
  font-size: var(--font-size-h5);
  font-weight: 500;
  color: var(--color-brand-gray);
  transition: all 0.3s ease;
}

.sx-faq-question:hover {
  color: var(--color-brand-blue);
}

.sx-faq-question-text {
  flex-grow: 1;
  padding-right: 14px;
}

.sx-faq-icon {
  font-size: 1.5rem;
  color: var(--color-brand-blue);
  font-weight: 300;
  line-height: 1;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.sx-faq-item.active .sx-faq-icon {
  transform: rotate(45deg);
}

.sx-faq-item.active .sx-faq-question {
  color: var(--color-brand-blue);
}

.sx-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.sx-faq-item.active .sx-faq-answer {
  max-height: 3000px;
}

.sx-faq-answer-content {
  padding: 0 20px 16px 20px;
}

.sx-faq-answer-content p {
  font-size: var(--font-size-body);
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 12px;
}

.sx-faq-answer-content p:last-child {
  margin-bottom: 0;
}

.sx-faq-answer-content strong {
  color: var(--color-brand-blue);
  font-weight: 600;
}

.sx-faq-answer-content em {
  font-style: italic;
  color: var(--color-brand-gray);
}

.sx-faq-answer-content h5 {
  font-family: var(--font-headings);
  font-size: var(--font-size-h5);
  color: var(--color-brand-gray);
  margin: 20px 0 10px 0;
  font-weight: 600;
}

.sx-faq-answer-content ul {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.sx-faq-answer-content ul li {
  font-size: var(--font-size-body);
  line-height: 1.6;
  color: var(--color-text);
  padding-left: 20px;
  margin-bottom: 8px;
  position: relative;
}

.sx-faq-answer-content ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--color-brand-blue);
  font-weight: bold;
  font-size: 1.1rem;
}

/* ========================================
   6. MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
  .sx-product-page {
    padding: 30px 15px;
  }
  
  .sx-product-hero {
    gap: 30px;
    margin-bottom: 40px;
  }
  
  .sx-product-tabs,
  .sx-product-related,
  .sx-product-faq {
    margin: 40px 0;
  }
  
  .sx-product-tab-list {
    grid-template-columns: 1fr 1fr;
  }

  .sx-product-tab-label {
    padding: 12px 16px;
    text-align: center;
  }
  
  .sx-product-tab-content {
    padding: 20px;
  }

  .sx-faq-question {
    padding: 12px 16px;
    font-size: var(--font-size-body);
  }

  .sx-faq-icon {
    font-size: 1.3rem;
  }

  .sx-faq-answer-content {
    padding: 0 16px 14px 16px;
  }

  .sx-faq-answer-content p,
  .sx-faq-answer-content ul li {
    font-size: var(--font-size-body);
  }
  
  .sx-product-related-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .sx-product-related-tab {
    padding: 10px 16px;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .sx-faq-question {
    padding: 10px 12px;
    font-size: var(--font-size-body);
  }

  .sx-faq-answer-content {
    padding: 0 12px 12px 12px;
  }

  .sx-faq-icon {
    font-size: 1.2rem;
  }
}

/* ========================================
   7. PRINT STYLES (Bonus)
   ======================================== */

@media print {
  .sx-product-hero {
    page-break-after: avoid;
  }
  
  .sx-product-tab[open] {
    page-break-inside: avoid;
  }
  
  .sx-btn-row {
    display: none;
  }
}