/* Import a modern font for the whole page */

:root {
  font-family: 'Inter', sans-serif;
}

/* Override container to be full-width on products page */
.container {
  max-width: 100% !important;
  width: 100%;
  margin: 0;
  padding: 0 var(--spacing-lg, 20px);
  box-sizing: border-box;
}

/* Breadcrumb styling (simple inline) */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: #374151;
}

.breadcrumb a {
  color: var(--primary-color, #0b74de);
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:focus {
  text-decoration: underline;
}

.breadcrumb [aria-hidden="true"] {
  color: #9ca3af;
}

/* Make breadcrumb links visually prominent while keeping current page normal weight */


.breadcrumb span:not([aria-hidden]) {
  font-weight: 400;
  color: #374151;
}

@media (max-width: 560px) {
  .breadcrumb {
    font-size: 0.92rem;
    gap: 4px;
  }
}

/* ...existing code... */

/* Unified sidebar block: remove individual borders and visually group sections */
.filters-inner {
  background: #ffffff;
  border-radius: 5px;
  /* slightly reduced padding for a tighter modern look */
  padding: 10px;
  box-sizing: border-box;
  /* simpler visual: single grey border, no shadow */
  border: 1px solid #e6e9ef;
}

/* Ensure filters area does not create its own scroll; rely on page scroll instead */
.filters-inner,
.filters-sidebar {
  max-height: none !important;
  overflow: visible !important;
}

.filter-section {
  margin: 0;
  padding: 10px 0;
  border-bottom: none;
}

.filter-section:last-child {
  border-bottom: none;
}

/* make section headings look like labeled bars with subtle bg + border */
.filter-section h4 {
  margin: 0 0 12px 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #111827;
  display: block;
  /* use full width and respect padding via box-sizing to avoid overflow */
  width: 100%;
  box-sizing: border-box;
  background: #f8fafc;
  /* subtle light bg */
  padding: 8px 10px;
  border: 1px solid #e6e9ef;
  /* reasonable thickness */
  border-radius: 5px;
}

/* Ensure content inside sections is not bold so headings stand out */
.filter-section *:not(h4) {
  font-weight: 400;
}

/* Sidebar layout tweaks */
.filters-sidebar {
  width: 280px;
  padding: 8px 0 0 0;
}

.filters-inner {
  padding: 8px;
}

/* Filters header with close button (hidden on desktop) */
.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.filters-header h3 {
  margin: 0;
}

.mobile-filter-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #374151;
  font-size: 20px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.mobile-filter-close:hover {
  background: #f3f4f6;
  color: #0b74de;
}

/* Mobile Filter Toggle Button - Hidden on desktop */
.mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--primary-color, #0b74de);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 116, 222, 0.2);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.mobile-filter-toggle:hover {
  background: #0a5fc2;
  box-shadow: 0 4px 12px rgba(11, 116, 222, 0.3);
  transform: translateY(-1px);
}

.mobile-filter-toggle i {
  font-size: 16px;
}

/* Mobile Filter Overlay */
.mobile-filter-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-filter-overlay.active {
  display: block;
  opacity: 1;
}

/* Two-column layout: sidebar + main content */
.products-main {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 26px;
}
.products-grid {
  max-width: none;
}
.products-column,
.products-grid {
  overflow: visible !important;
}

.products-column {
  min-width: 0;
}

@media (max-width:920px) {
  .products-main {
    grid-template-columns: 1fr;
  }

  .filters-sidebar {
    width: 100%;
  }
}

/* Category toggle buttons (replaces checkboxes) */
/* Vertical checkbox list styling */
.filter-categories-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-category-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  color: #374151;
}

.filter-category-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0b74de;
}

/* Make checkboxes and radios in the filters consistent in size */
.filters-inner input[type="checkbox"],
.filters-inner input[type="radio"] {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  accent-color: #0b74de;
}

/* Rating options should be vertical in the sidebar */
.rating-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rating-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  color: #374151;
}

/* accessible only text */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* star group in rating labels: make stars consistently filled and a bit larger to match chips */
.rating-options .stars i,
.rating-options .stars i.fas {
  color: #f6b21a !important;
  /* ensure filled appearance */
  margin-right: 4px;
  font-size: 1rem;
  line-height: 1;
}

/* tighten price-box max width and allow more room for the slider
   convert to flex so gap can be controlled from CSS (remove inline style)
   increase gap for better separation between From/To inputs */
.price-box {
  display: flex;
  gap: 16px;
  /* increased gap between From/To boxes */
  align-items: center;
  max-width: 340px;
}

/* sort container / toolbar less rounded */
.products-toolbar .sort-container,
.sort-container {
  border-radius: 5px;
}

/* Toolbar: keep count and sort on the same row */
.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.products-toolbar .toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.products-toolbar .toolbar-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Sort select styling to match site look */
.sort-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-container label {
  font-size: .95rem;
  color: #374151;
}

.sort-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e6e9ef;
  background: #fff;
  font-size: .95rem;
  color: #111827;
}

.sort-select:focus {
  outline: 2px solid rgba(11, 116, 222, 0.12);
}

/* Price numeric inputs in the sidebar: smaller fixed width to save space */
.price-box input[type="number"],
.price-inputs input[type="number"] {
  width: 80px;
  /* reduced size */
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e6e9ef;
  font-size: .95rem;
}

/* Price inputs and slider tweaks */
.price-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.price-inputs label {
  font-size: .9rem;
  color: var(--muted);
}

.price-inputs input[type="number"] {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e6e9ef;
  font-size: .95rem;
}

.price-slider-values {
  color: #6b7280;
}

/* (Slider styles are defined later in file; keep single consistent dual-thumb block) */

/* Buttons */
.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.filter-actions .btn {
  background: var(--primary-color, #0b74de);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.filter-actions .secondary-btn {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

/* Applied filters chips */
.applied-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 8px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.applied-filters-label {
  display: none;
}

.applied-filters-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.applied-filter-chip,
.filter-chip {
  background: #f1f5f9;
  color: #0f172a;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: .9rem;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.applied-filter-chip button,
.filter-chip button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
}

/* stars inside filter chips (rating chips) */
.filter-chip i.fas.fa-star {
  color: #f6b21a;
  margin-right: 2px;
  font-size: 0.9rem;
}

/* Responsive: collapse sidebar under content on small screens */
@media (max-width:920px) {
  .filters-sidebar {
    width: 100%;
  }
}

/* ...existing code... */

/* Single dual-thumb price slider styling */
.price-sliders {
  position: relative;
  width: 100%;
  /* increased slider width for better UX while keeping responsive behavior */
  max-width: 220px;
  height: 6px;
  background: linear-gradient(90deg, #e6eefc, #f3f7ff);
  border-radius: 6px;
  margin: 12px 0;
}

.price-sliders input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: transparent;
  position: absolute;
  top: 0;
  left: 0;
  outline: none;
  pointer-events: none;
}

.price-sliders input[type="range"]:nth-child(1) {
  pointer-events: auto;
  z-index: 2;
}

.price-sliders input[type="range"]:nth-child(2) {
  pointer-events: auto;
  z-index: 3;
}

.price-sliders input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color, #0b74de);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(11, 116, 222, 0.24);
  cursor: pointer;
  pointer-events: auto;
}

.price-sliders input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary-color, #0b74de);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(11, 116, 222, 0.24);
  cursor: pointer;
  border: none;
}

.price-box {
  display: flex;
  gap: 56px;
  align-items: center;
  max-width: 340px;
}

/* Pagination styles */
.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pagination-controls .page-btn {
  background: #fff;
  border: 1px solid #e6e9ef;
  color: #374151;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
  min-width: 40px;
  box-sizing: border-box;
  transition: box-shadow .12s ease, transform .06s ease, background-color .12s ease;
}

.pagination-controls .page-btn.active {
  background: var(--primary-color, #0b74de);
  color: #fff;
  border-color: var(--primary-color, #0b74de);
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(11, 116, 222, 0.12);
}

.pagination-controls .page-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.pagination-controls .page-btn:hover:not(:disabled) {
  font-weight: 600;
}

.pagination-controls .ellipsis {
  color: #6b7280;
  padding: 0 6px;
  user-select: none;
}

@media (max-width: 480px) {
  .pagination-controls .page-btn {
    padding: 6px 8px;
    min-width: 34px;
  }

  .pagination-controls {
    gap: 6px;
    margin-top: 12px;
  }
}

/* Style the Clear filters button inside the empty state for prominence */
#empty-state .secondary-btn {
  border-color: rgba(11, 116, 222, 0.12);
  background: transparent;
  color: #374151;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  transition: background-color .14s ease, color .14s ease, box-shadow .14s ease;
  cursor: pointer;
}

#empty-state .secondary-btn:hover {
  background: var(--primary-color, #0b74de);
  color: #fff;
  border-color: var(--primary-color, #0b74de);
}

/* Subtle pulse animation when filters are cleared to draw attention */
.cleared-anim {
  animation: pulseHighlight 0.7s ease forwards;
}

@keyframes pulseHighlight {
  0% {
    box-shadow: 0 0 0 rgba(11, 116, 222, 0);
    transform: translateY(0);
  }

  40% {
    box-shadow: 0 18px 40px rgba(11, 116, 222, 0.10);
    transform: translateY(-2px);
  }

  100% {
    box-shadow: 0 0 0 rgba(11, 116, 222, 0);
    transform: translateY(0);
  }
}

/* Back to top button */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-color, #0b74de);
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(11, 116, 222, 0.12);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:focus {
  outline: 3px solid rgba(11, 116, 222, 0.12);
}

/* ===== RESPONSIVE FIXES - NO SIDE WHITESPACE ===== */

/* Tablet and below: reduce container padding */
@media (max-width: 920px) {
  .container {
    padding: 0 var(--spacing-md, 16px);
  }
  
  .products-main {
    gap: 16px;
    grid-template-columns: 1fr;
  }
  
  /* Show mobile filter toggle button */
  .mobile-filter-toggle {
    display: flex;
  }
  
  /* Hide filters sidebar by default on mobile */
  .filters-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile browsers */
    background: white;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow: hidden; /* Prevent scroll on the sidebar itself */
    padding: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
  
  /* Show filters when active */
  .filters-sidebar.active {
    transform: translateX(0);
  }
  
  /* Show close button on mobile */
  .mobile-filter-close {
    display: block;
  }
  
  .filters-inner {
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent scroll on this container */
  }
  
  .filters-header {
    position: relative; /* Changed from sticky */
    flex-shrink: 0;
    background: white;
    z-index: 10;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6e9ef;
    margin-bottom: 16px;
  }
  
  /* Scrollable content wrapper for filter sections */
  .filters-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: 4px; /* Space for scrollbar */
  }
  
  /* Ensure filter sections don't create extra space */
  .filters-content .filter-section {
    flex-shrink: 0;
  }
  
  /* Remove the old rule that targeted all children */
  
  /* Adjust toolbar layout on tablets */
  .products-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .products-toolbar .toolbar-left {
    flex: 1 1 auto;
    min-width: fit-content;
  }
  
  .products-toolbar .toolbar-right {
    flex: 1 1 auto;
  }
  
  .sort-container {
    width: 100%;
  }
  
  .sort-select {
    flex: 1;
    max-width: 200px;
  }
}

/* Mobile: minimal side padding */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-sm, 12px);
  }
  
  .products-main {
    gap: 12px;
  }
  
  /* Ensure promo banner doesn't overflow */
  .promo-banner {
    margin-bottom: 12px !important;
  }
  
  .promo-banner img {
    max-width: 100%;
    height: auto;
  }
  
  /* Toolbar mobile adjustments - stack vertically */
  .products-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  
  .mobile-filter-toggle {
    order: -1;
    flex: 0 0 auto;
  }
  
  .products-toolbar .toolbar-left {
    flex: 1 1 auto;
    order: 0;
  }
  
  .products-toolbar .toolbar-right {
    flex: 1 1 100%;
    order: 1;
  }
  
  .sort-container {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  
  .sort-container label {
    font-size: 0.9rem;
    white-space: nowrap;
  }
  
  .sort-select {
    flex: 1;
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .back-to-top {
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
  }
}