/* ============================================
   FREEZEAL — Products Page Styles
   ============================================ */

/* ── Products Layout ── */
.products-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

/* ── Sidebar Filters ── */
.filter-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-xl));
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.filter-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.filter-sidebar__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-heading);
}

.filter-sidebar__clear {
  font-size: var(--text-sm);
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  transition: color var(--transition-base);
}

.filter-sidebar__clear:hover {
  color: var(--primary-dark);
}

.filter-group {
  margin-bottom: var(--space-xl);
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group__title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-base);
}

.filter-option:hover {
  background: var(--bg-pink-subtle);
}

.filter-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
}

.filter-option__label {
  font-size: var(--text-sm);
  color: var(--text-body);
  flex: 1;
}

.filter-option__count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-grey-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Mobile Filter Toggle */
.filter-toggle {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 20px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-heading);
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: var(--space-lg);
}

.filter-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Products Grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* ── Products Header Bar ── */
.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.products-header__count {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.products-header__count strong {
  color: var(--text-heading);
  font-weight: 600;
}

.products-header__sort {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.products-header__sort label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.products-header__sort select {
  padding: 8px 36px 8px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-heading);
  background: var(--bg-white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A8A9A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color var(--transition-base);
}

.products-header__sort select:focus {
  border-color: var(--primary);
}

/* ── Active Filters Tags ── */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary-ultra-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.active-filter-tag:hover {
  background: var(--primary);
  color: white;
}

.active-filter-tag svg {
  width: 14px;
  height: 14px;
}

/* ── Compare Bar ── */
.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-dark);
  padding: var(--space-md) 0;
  z-index: var(--z-sticky);
  transform: translateY(100%);
  transition: transform var(--transition-base);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.compare-bar--visible {
  transform: translateY(0);
}

.compare-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.compare-bar__items {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  color: white;
}

.compare-bar__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: white;
}

.compare-bar__item-remove {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  transition: background var(--transition-base);
  flex-shrink: 0;
}

.compare-bar__item-remove:hover {
  background: rgba(255, 255, 255, 0.4);
}

.compare-bar__actions {
  display: flex;
  gap: var(--space-sm);
}

.compare-bar__count {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  margin-right: var(--space-md);
}

/* ── No Results ── */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
}

.no-results__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-lg);
  background: var(--bg-grey-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.no-results__title {
  font-size: var(--text-lg);
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
}

.no-results__text {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ── Comparison Modal ── */
.compare-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
}

.compare-modal--visible {
  display: flex;
}

.compare-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.compare-modal__content {
  position: relative;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 900px;
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.compare-modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-grey-light);
  color: var(--text-body);
  cursor: pointer;
  transition: all var(--transition-base);
}

.compare-modal__close:hover {
  background: var(--primary);
  color: white;
}

.compare-modal__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xl);
}

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

.compare-table th,
.compare-table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-sm);
}

.compare-table th {
  background: var(--bg-grey-light);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
}

.compare-table td {
  color: var(--text-body);
}

.compare-table tr:last-child td {
  border-bottom: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .products-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    z-index: var(--z-modal);
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    overflow-y: auto;
    transition: left var(--transition-slow);
    padding-top: var(--space-2xl);
  }

  .filter-sidebar--open {
    left: 0;
  }

  .filter-toggle {
    display: inline-flex;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .products-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }

  .compare-bar__inner {
    flex-direction: column;
    gap: var(--space-md);
  }

  .compare-bar__items {
    flex-wrap: wrap;
  }

  .compare-modal__content {
    padding: var(--space-lg);
  }

  .compare-table {
    font-size: var(--text-xs);
  }

  .compare-table th,
  .compare-table td {
    padding: var(--space-sm) var(--space-md);
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}