/* ==========================================================
   MoreTech BMP360 — Products Module CSS Patch (v2.0)
   Layer: 4 Extension (Products-Specific Additions)
   ──────────────────────────────────────────────────────────
   Purpose: Adds styles for new components introduced in
   the Products Module v2.0 upgrade:
   - Category filter bar
   - Pagination
   - Product card enhancements (brand, footer, price)
   - Product detail gallery
   - Product detail info panel
   - Product detail meta & prose
   - Breadcrumbs (product-scoped)
   - Empty state
   - Results meta
   ──────────────────────────────────────────────────────────
   Depends on: 00-tokens.css, 04-pages.css
   Does NOT override existing 04-pages.css classes
========================================================== */


/* ----------------------------------------------------------
   BREADCRUMB (Page-Level)
---------------------------------------------------------- */
.page-breadcrumb {
  padding: var(--mt-space-4) 0;
  background: var(--mt-surface-sunken);
  border-bottom: 1px solid var(--mt-border-default);
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--mt-space-2);
  margin: 0;
  padding: 0;
  font-size: var(--mt-text-sm);
  color: var(--mt-text-muted);
  flex-wrap: wrap;
}

.breadcrumb-list li:not(:last-child)::after {
  content: "›";
  margin-left: var(--mt-space-2);
  color: var(--mt-text-subtle);
}

.breadcrumb-list a {
  color: var(--mt-text-muted);
  text-decoration: none;
  transition: color var(--mt-duration-fast) var(--mt-ease-default);
}

.breadcrumb-list a:hover {
  color: var(--mt-brand-primary);
}

.breadcrumb-list .active {
  color: var(--mt-text-heading);
  font-weight: var(--mt-weight-semibold);
}

/* Product detail breadcrumb (inside intro) */
.prd-breadcrumb {
  margin-bottom: var(--mt-space-6);
}

.prd-breadcrumb .breadcrumb-list {
  justify-content: center;
}


/* ----------------------------------------------------------
   CATEGORY FILTER BAR
---------------------------------------------------------- */
.products-filter-bar {
  padding: var(--mt-space-6) 0;
  background: var(--mt-surface-page);
  border-bottom: 1px solid var(--mt-border-default);
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: var(--mt-space-3);
  flex-wrap: wrap;
  justify-content: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--mt-space-2) var(--mt-space-5);
  font-size: var(--mt-text-sm);
  font-weight: var(--mt-weight-medium);
  color: var(--mt-text-muted);
  background: var(--mt-surface-raised);
  border: 1px solid var(--mt-border-default);
  border-radius: var(--mt-radius-full);
  text-decoration: none;
  transition:
    background var(--mt-duration-fast) var(--mt-ease-default),
    color var(--mt-duration-fast) var(--mt-ease-default),
    border-color var(--mt-duration-fast) var(--mt-ease-default),
    box-shadow var(--mt-duration-fast) var(--mt-ease-default);
}

.filter-chip:hover {
  color: var(--mt-brand-primary);
  border-color: var(--mt-brand-primary);
  background: var(--mt-brand-primary-soft);
}

.filter-chip.active {
  color: var(--mt-text-inverse);
  background: var(--mt-brand-primary);
  border-color: var(--mt-brand-primary);
  box-shadow: 0 2px 8px rgba(var(--mt-brand-primary-rgb), 0.25);
}


/* ----------------------------------------------------------
   PRODUCTS RESULTS META
---------------------------------------------------------- */
.products-results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--mt-space-6);
  font-size: var(--mt-text-sm);
  color: var(--mt-text-subtle);
}


/* ----------------------------------------------------------
   PRODUCT CARD ENHANCEMENTS
---------------------------------------------------------- */

/* Brand label */
.product-card-brand {
  display: inline-block;
  font-size: var(--mt-text-xs);
  font-weight: var(--mt-weight-semibold);
  letter-spacing: var(--mt-tracking-wide);
  text-transform: uppercase;
  color: var(--mt-brand-primary);
  opacity: 0.85;
}

/* Title link */
.product-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--mt-duration-fast) var(--mt-ease-default);
}

.product-card-title a:hover {
  color: var(--mt-brand-primary);
}

/* Card footer */
.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--mt-space-4);
  border-top: 1px solid var(--mt-border-light);
}

/* Price */
.product-card-price {
  font-size: var(--mt-text-md);
  font-weight: var(--mt-weight-bold);
  color: var(--mt-brand-primary);
}

.product-card-price--contact {
  font-size: var(--mt-text-xs);
  font-weight: var(--mt-weight-medium);
  color: var(--mt-text-muted);
}

/* Detail link */
.product-card-link {
  font-size: var(--mt-text-sm);
  font-weight: var(--mt-weight-semibold);
  color: var(--mt-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--mt-space-2);
  transition: color var(--mt-duration-fast) var(--mt-ease-default);
}

.product-card-link:hover {
  color: var(--mt-brand-primary);
}

.product-card-link i {
  font-size: 0.7em;
  transition: transform var(--mt-duration-fast) var(--mt-ease-default);
}

.product-card:hover .product-card-link i {
  transform: translateX(3px);
}


/* ----------------------------------------------------------
   PRODUCTS EMPTY STATE
---------------------------------------------------------- */
.products-empty {
  text-align: center;
  padding: var(--mt-space-20) var(--mt-space-8);
  color: var(--mt-text-muted);
}

.products-empty i {
  font-size: 3rem;
  margin-bottom: var(--mt-space-5);
  opacity: 0.4;
}

.products-empty h4 {
  font-size: var(--mt-text-lg);
  font-weight: var(--mt-weight-bold);
  color: var(--mt-text-heading);
  margin-bottom: var(--mt-space-3);
}

.products-empty p {
  max-width: 480px;
  margin: 0 auto;
}

.products-empty a {
  color: var(--mt-brand-primary);
  font-weight: var(--mt-weight-semibold);
}


/* ----------------------------------------------------------
   PAGINATION
---------------------------------------------------------- */
.products-pagination {
  display: flex;
  justify-content: center;
  padding: var(--mt-space-12) 0 var(--mt-space-4);
}

.pagination-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--mt-space-2);
  margin: 0;
  padding: 0;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--mt-space-3);
  font-size: var(--mt-text-sm);
  font-weight: var(--mt-weight-medium);
  color: var(--mt-text-body);
  background: var(--mt-surface-raised);
  border: 1px solid var(--mt-border-default);
  border-radius: var(--mt-radius-md);
  text-decoration: none;
  transition:
    background var(--mt-duration-fast) var(--mt-ease-default),
    color var(--mt-duration-fast) var(--mt-ease-default),
    border-color var(--mt-duration-fast) var(--mt-ease-default);
}

.pagination-link:hover {
  color: var(--mt-brand-primary);
  border-color: var(--mt-brand-primary);
  background: var(--mt-brand-primary-soft);
}

.pagination-link.active {
  color: var(--mt-text-inverse);
  background: var(--mt-brand-primary);
  border-color: var(--mt-brand-primary);
  pointer-events: none;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  color: var(--mt-text-subtle);
  font-size: var(--mt-text-sm);
}


/* ----------------------------------------------------------
   PRODUCT DETAIL — GALLERY
---------------------------------------------------------- */
.prd-gallery {
  flex: 0 0 50%;
  max-width: 50%;
}

.prd-gallery-main {
  position: relative;
  border-radius: var(--mt-radius-xl);
  overflow: hidden;
  background: var(--mt-surface-sunken);
  border: 1px solid var(--mt-border-default);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prd-gallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--mt-space-4);
}

.prd-gallery-thumbs {
  display: flex;
  gap: var(--mt-space-3);
  margin-top: var(--mt-space-4);
  flex-wrap: wrap;
}

.prd-gallery-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--mt-radius-md);
  overflow: hidden;
  border: 2px solid var(--mt-border-default);
  cursor: pointer;
  background: var(--mt-surface-sunken);
  padding: 0;
  transition:
    border-color var(--mt-duration-fast) var(--mt-ease-default),
    box-shadow var(--mt-duration-fast) var(--mt-ease-default);
}

.prd-gallery-thumb:hover {
  border-color: var(--mt-brand-primary);
}

.prd-gallery-thumb.active {
  border-color: var(--mt-brand-primary);
  box-shadow: 0 0 0 2px rgba(var(--mt-brand-primary-rgb), 0.2);
}

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


/* ----------------------------------------------------------
   PRODUCT DETAIL — INFO PANEL
---------------------------------------------------------- */
.prd-info {
  flex: 1;
}

.prd-info-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--mt-weight-black);
  letter-spacing: var(--mt-tracking-tight);
  color: var(--mt-text-heading);
  margin-bottom: var(--mt-space-3);
}

.prd-info-lead {
  font-size: var(--mt-text-md);
  line-height: var(--mt-leading-relaxed);
  color: var(--mt-text-muted);
  margin-bottom: var(--mt-space-6);
}

.prd-info-price {
  font-size: var(--mt-text-2xl);
  font-weight: var(--mt-weight-black);
  color: var(--mt-brand-primary);
  margin-bottom: var(--mt-space-6);
}

.prd-info-price--contact {
  font-size: var(--mt-text-md);
  font-weight: var(--mt-weight-semibold);
  color: var(--mt-text-muted);
}

/* Meta table */
.prd-info-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--mt-space-3);
  margin-bottom: var(--mt-space-8);
  padding: var(--mt-space-5);
  background: var(--mt-surface-sunken);
  border-radius: var(--mt-radius-lg);
  border: 1px solid var(--mt-border-light);
}

.prd-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prd-meta-label {
  font-size: var(--mt-text-xs);
  font-weight: var(--mt-weight-semibold);
  letter-spacing: var(--mt-tracking-wide);
  text-transform: uppercase;
  color: var(--mt-text-subtle);
}

.prd-meta-value {
  font-size: var(--mt-text-sm);
  font-weight: var(--mt-weight-medium);
  color: var(--mt-text-heading);
}

/* Actions */
.prd-info-actions {
  display: flex;
  gap: var(--mt-space-4);
  flex-wrap: wrap;
}

/* WhatsApp button variant */
.mt-btn-whatsapp {
  background: #25D366;
  color: #ffffff;
  border: none;
  padding: var(--mt-space-3) var(--mt-space-6);
  font-weight: var(--mt-weight-semibold);
  border-radius: var(--mt-radius-md);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition:
    background var(--mt-duration-fast) var(--mt-ease-default),
    transform var(--mt-duration-fast) var(--mt-ease-default);
}

.mt-btn-whatsapp:hover {
  background: #1DA851;
  color: #ffffff;
  transform: translateY(-1px);
}


/* ----------------------------------------------------------
   PRODUCT DETAIL — CONTENT PROSE
---------------------------------------------------------- */
.prd-content-prose {
  max-width: 860px;
  font-size: var(--mt-text-base);
  line-height: var(--mt-leading-relaxed);
  color: var(--mt-text-body);
}

.prd-content-prose p {
  margin-bottom: var(--mt-space-5);
}

.prd-content-prose ul,
.prd-content-prose ol {
  margin-bottom: var(--mt-space-5);
  padding-left: var(--mt-space-6);
}

.prd-content-prose li {
  margin-bottom: var(--mt-space-2);
}

.prd-content-prose h3,
.prd-content-prose h4 {
  margin-top: var(--mt-space-8);
  margin-bottom: var(--mt-space-4);
  font-weight: var(--mt-weight-bold);
  color: var(--mt-text-heading);
}

.prd-content-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--mt-space-6);
}

.prd-content-prose th,
.prd-content-prose td {
  padding: var(--mt-space-3) var(--mt-space-4);
  border: 1px solid var(--mt-border-default);
  font-size: var(--mt-text-sm);
}

.prd-content-prose th {
  background: var(--mt-surface-sunken);
  font-weight: var(--mt-weight-semibold);
  text-align: left;
}


/* ----------------------------------------------------------
   RELATED PRODUCTS (compact grid override)
---------------------------------------------------------- */
.products-grid--compact {
  grid-template-columns: repeat(3, 1fr);
}


/* ----------------------------------------------------------
   RESPONSIVE: PRODUCT DETAIL
---------------------------------------------------------- */
@media (max-width: 991px) {
  .prd-gallery {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .prd-info-meta {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 575px) {
  .prd-gallery-thumb {
    width: 64px;
    height: 64px;
  }

  .prd-info-actions {
    flex-direction: column;
  }

  .prd-info-actions .mt-btn,
  .prd-info-actions .mt-btn-whatsapp {
    width: 100%;
    justify-content: center;
  }

  .products-grid--compact {
    grid-template-columns: 1fr;
  }

  .filter-chips {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: var(--mt-space-2);
    padding-bottom: var(--mt-space-2);
    -webkit-overflow-scrolling: touch;
  }

  .filter-chip {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .pagination-link {
    min-width: 36px;
    height: 36px;
    font-size: var(--mt-text-xs);
  }
}
