/* ============================================================
   products.css — Product listing & detail styles
   ============================================================ */

/* === Category Card === */
.category-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
}

.category-card:hover {
  border-color: var(--color-gold-400);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.category-card--large {
  grid-column: 1 / -1;
  flex-direction: row;
}

.category-card__image {
  width: 100%;
  flex-shrink: 0;
  background-color: var(--color-bg-tertiary);
}

.category-card--large .category-card__image {
  width: 50%;
}

.category-card__body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.category-card__body h3 {
  margin-bottom: var(--space-xs);
}

.category-card__body p {
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  margin-bottom: var(--space-md);
  flex: 1;
}

.category-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

/* === Product Cards Grid === */
.product-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/* === Product Detail Layout === */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  padding-top: var(--space-xl);
}

/* === Product Gallery === */
.product-gallery {
  position: relative;
}

.gallery-main {
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-bg-tertiary);
  cursor: zoom-in;
}

.gallery-main img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.gallery-thumb {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition-fast);
  flex-shrink: 0;
}

.gallery-thumb.active,
.gallery-thumb:hover {
  border-color: var(--color-gold-400);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  cursor: zoom-out;
}

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

.gallery-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* === Product Info === */
.product-info h1 {
  margin-bottom: var(--space-xs);
}

.product-info__subtitle {
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  margin-bottom: var(--space-md);
}

.product-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.product-highlights .badge {
  font-size: var(--text-small);
  padding: 0.5rem 1rem;
}

.product-description {
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.product-actions {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

/* === Spec Table === */
.spec-section {
  margin-top: var(--space-xl);
}

.spec-section h3 {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px solid var(--color-border);
}

.spec-table td {
  padding: 0.85rem var(--space-sm);
  font-size: var(--text-small);
}

.spec-table td:first-child {
  font-weight: 500;
  color: var(--color-text-primary);
  width: 35%;
}

.spec-table td:last-child {
  color: var(--color-text-secondary);
}

/* === Application Tabs === */
.app-tabs {
  margin-top: var(--space-xl);
}

.app-tabs__nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.app-tabs__btn {
  padding: 0.75rem 1.25rem;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
}

.app-tabs__btn.active,
.app-tabs__btn:hover {
  color: var(--color-gold-400);
  border-bottom-color: var(--color-gold-400);
}

.app-tabs__panel {
  display: none;
  padding: var(--space-md) 0;
}

.app-tabs__panel.active {
  display: block;
}

.app-tabs__panel .img-placeholder {
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

/* === Installation Steps === */
.install-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.install-step {
  text-align: center;
}

.install-step__num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-gold-400);
  color: var(--color-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-small);
  margin: 0 auto var(--space-sm);
}

.install-step h4 {
  font-size: var(--text-small);
  margin-bottom: 0.25rem;
}

.install-step p {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}

/* === Packaging Table === */
.packaging-table {
  width: 100%;
  border-collapse: collapse;
}

.packaging-table th {
  text-align: left;
  padding: 0.75rem var(--space-sm);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
}

.packaging-table td {
  padding: 0.75rem var(--space-sm);
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

/* === Floating Quote Button === */
.floating-quote {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-dropdown);
  display: none;
}

.floating-quote.visible {
  display: block;
}

/* === Form Success === */
.form-success {
  text-align: center;
  padding: var(--space-xl);
}

.form-success__icon {
  margin-bottom: var(--space-md);
}

.form-success h3 {
  color: var(--color-gold-400);
  margin-bottom: var(--space-sm);
}

.form-success p {
  color: var(--color-text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
  .product-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .category-card--large {
    flex-direction: column;
  }

  .category-card--large .category-card__image {
    width: 100%;
  }

  .install-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .product-cards-grid {
    grid-template-columns: 1fr;
  }

  .gallery-thumbs {
    justify-content: center;
  }

  .product-actions {
    flex-direction: column;
  }

  .product-actions .btn {
    width: 100%;
  }
}
