.main-header.products-header-variant .search-container-wrapper {
  max-width: 300px; 
  width: 100%; 
  flex-shrink: 1; 
  flex-grow: 0; 
}

.main-header.products-header-variant .search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%; 
}

.main-header.products-header-variant #searchInput {
  padding: 8px 12px; 
  padding-right: 35px; 
  border-radius: 20px;
  border: 1px solid #ccc;
  font-size: 14px; 
  width: 100%; 
  height: 36px; 
  min-width: 150px; 
}

.main-header.products-header-variant .search-icon-header { 
  position: absolute;
  right: 12px; 
  top: 50%;
  transform: translateY(-50%);
  color: #777;
  pointer-events: none; 
}


/* Main Content Layout */
.main-content {
  display: flex;
  padding: 20px; 
  gap: 20px; 
  background-color: #f8f9fa;
  max-width: 100%; 
  margin: 0 auto; 
}

/* Filters Sidebar */
.filters-sidebar {
  width: 260px; 
  background-color: white;
  padding: 20px; 
  border-radius: 8px; 
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); 
  align-self: flex-start; 
  height: fit-content; 
}

.filters-title {
  font-size: 18px; 
  margin-bottom: 20px; 
  font-weight: 600;
  color: #333;
}

/* Filter Categories (Collapsible) */
.filter-category {
  margin-bottom: 8px; 
  border-bottom: 1px solid #f0f0f0; 
}

.filter-category:last-child {
  border-bottom: none;
}

.filter-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 0; 
  cursor: pointer;
  text-align: left;
}

.filter-category-header h3 {
  font-size: 15px; 
  font-weight: 500;
  margin: 0;
  color: #444;
}

.filter-category-header .toggle-icon {
  font-size: 16px; 
  font-weight: bold;
  color: #555;
}

.filter-category-content {
  padding-top: 8px;
  padding-bottom: 8px;
}

.filter-section {
  margin-bottom: 10px; 
}

.price-slider {
  width: 100%;
  cursor: pointer;
  accent-color: #007bff; 
}

.price-range-values {
  display: flex;
  justify-content: space-between;
  margin-top: 6px; 
  font-size: 13px; 
  color: #555;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px; 
}

.filter-checkbox-label {
  display: flex; 
  align-items: center;
  margin-bottom: 6px; 
  cursor: pointer;
  font-size: 14px; 
  color: #444;
}

.filter-checkbox {
  margin-right: 8px;
  vertical-align: middle; 
  width: 15px; 
  height: 15px; 
}
  
/* Products Grid */
.products-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
  gap: 20px; 
  justify-content: center; 
  align-items: start; 
  align-content: start; 
}
  
/* Product Card */
.product-card {
  background-color: white;
  border-radius: 12px; 
  overflow: hidden; /* Important: Keep this to contain the zoomed image */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07); 
  transition: box-shadow 0.3s ease, transform 0.3s ease; /* Added transform to card transition */
  cursor: pointer;
  display: flex;
  flex-direction: column;
  width: 100%; 
  margin: 0 auto; 
  height: auto; 
}
  
.product-card:hover {
  transform: translateY(-6px); 
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); 
}

/* Product Image Container - Ensure it clips the overflowing image */
.product-image-container {
  position: relative;
  padding-top: 100%; 
  width: 100%;
  background-color: white; 
  overflow: hidden; /* Crucial for zoom effect to not break layout */
  border-bottom: 1px solid #f0f0f0; 
}
  
.product-image {
  object-fit: contain; 
  object-position: center;
  width: 100%; /* Base width */
  position: absolute;
  top: 50%; 
  left: 50%; 
  height: 90%; 
  width: 90%;  
  transform: translate(-50%, -50%) scale(1); /* <<< MODIFIED: Added initial scale */
  overflow: hidden; /* Should be on container, but doesn't hurt here */
  transition: transform 0.3s ease-in-out; /* <<< ADDED: Smooth transition for zoom */
}

.product-card:hover .product-image {
  transform: translate(-50%, -50%) scale(1.07); /* <<< ADDED: Subtle zoom on hover, combined with centering translate */
}
  
.product-details {
  padding: 16px; 
  display: flex;
  flex-direction: column;
  gap: 6px; 
  flex-grow: 1;
  overflow-y: auto; 
}
  
.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
  
.product-info {
  flex-grow: 1;
}
  
.product-name {
  font-size: 16px; 
  font-weight: 600;
  color: #222; 
  margin-bottom: 3px; 
  line-height: 1.3; 
}
  
.product-brand {
  font-size: 13px; 
  color: #666; 
}
  
.product-price {
  font-size: 20px; 
  font-weight: 700;
  color: #007bff; 
  white-space: nowrap; 
}

.no-results {
  grid-column: 1 / -1; 
  text-align: center;
  padding: 40px 20px;
  font-size: 17px; 
  color: #555;
}
  
/* Responsive Styles */
@media (max-width: 1199px) { /* Larger tablets / smaller desktops */
    .main-header.products-header-variant .search-container {
        max-width: 300px;
    }
    .main-header.products-header-variant #searchInput {
        font-size: 14px;
        height: 36px;
    }
}


@media (max-width: 991px) { /* Tablets */
    .main-header.products-header-variant {
        /* Header structure changes in styles.css for responsiveness */
    }
    .main-header.products-header-variant .search-container-wrapper {
        max-width: 250px; 
    }
     .main-header.products-header-variant .search-container {
        max-width: 280px;
    }

    .main-content {
      padding: 15px;
      gap: 15px;
    }

    .products-grid {
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      gap: 15px;
    }
}

@media (max-width: 767px) { /* Mobile */
    .main-content {
      flex-direction: column;
      padding: 10px;
    }

    .filters-sidebar {
      width: 100%;
      margin-bottom: 20px;
    }

    .main-header.products-header-variant .search-container-wrapper {
        max-width: 100%; 
    }
    .main-header.products-header-variant #searchInput {
        /* font-size: 14px; */ 
        /* height: 34px; */ 
        /* padding-right: 30px; */ 
    }


    .products-grid {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
      gap: 10px;
    }
    .product-card {
        border-radius: 8px;
    }
    .product-details {
        padding: 10px;
        gap: 4px;
    }
    .product-name {
        font-size: 12px;
    }
    .product-brand {
        font-size: 12px;
    }
    .product-price {
        font-size: 16px;
    }

}

/* Accessibility Enhancements */
:focus-visible {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* === NEW STYLES for Sort Select and Dual-Handle Slider === */

/* Sort Select Box */
.sort-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

/* Dual-Handle Price Slider Container */
.price-slider-container {
    position: relative;
    height: 20px;
    margin-bottom: 10px;
}

.price-slider-track {
    position: absolute;
    height: 4px;
    background-color: #ddd;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 2px;
}

/* Shared styles for both range inputs */
.price-slider {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    pointer-events: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}

.price-slider::-moz-range-thumb {
    -moz-appearance: none;
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
}

/* Remove default focus outline for sliders since we are styling it */
.price-slider:focus {
    outline: none;
}

/* --- EXISTING STYLES (Unchanged) --- */

/* Styling for search integrated into main header on products page */
.main-header.products-header-variant .search-container-wrapper {
  max-width: 300px; 
  width: 100%; 
  flex-shrink: 1; 
  flex-grow: 0; 
}

.main-header.products-header-variant .search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%; 
}

.main-header.products-header-variant #searchInput {
  padding: 8px 12px; 
  padding-right: 35px; 
  border-radius: 20px;
  border: 1px solid #ccc;
  font-size: 14px; 
  width: 100%; 
  height: 36px; 
  min-width: 150px; 
}

.main-header.products-header-variant .search-icon-header { 
  position: absolute;
  right: 12px; 
  top: 50%;
  transform: translateY(-50%);
  color: #777;
  pointer-events: none; 
}

/* Main Content Layout */
.main-content {
  display: flex;
  padding: 20px; 
  gap: 20px; 
  background-color: #f8f9fa;
  max-width: 100%; 
  margin: 0 auto; 
}

/* Filters Sidebar */
.filters-sidebar {
  width: 260px; 
  background-color: white;
  padding: 20px; 
  border-radius: 8px; 
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); 
  align-self: flex-start; 
  height: fit-content; 
}

.filters-title {
  font-size: 18px; 
  margin-bottom: 20px; 
  font-weight: 600;
  color: #333;
}

/* Filter Categories (Collapsible) */
.filter-category {
  margin-bottom: 8px; 
  border-bottom: 1px solid #f0f0f0; 
}

.filter-category:last-child {
  border-bottom: none;
}

.filter-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 0; 
  cursor: pointer;
  text-align: left;
}

.filter-category-header h3 {
  font-size: 15px; 
  font-weight: 500;
  margin: 0;
  color: #444;
}

.filter-category-header .toggle-icon {
  font-size: 16px; 
  font-weight: bold;
  color: #555;
}

.filter-category-content {
  padding-top: 8px;
  padding-bottom: 8px;
}

.filter-section {
  margin-bottom: 10px; 
}

.price-range-values {
  display: flex;
  justify-content: space-between;
  margin-top: 6px; 
  font-size: 13px; 
  color: #555;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px; 
}

.filter-checkbox-label {
  display: flex; 
  align-items: center;
  margin-bottom: 6px; 
  cursor: pointer;
  font-size: 14px; 
  color: #444;
}

.filter-checkbox {
  margin-right: 8px;
  vertical-align: middle; 
  width: 15px; 
  height: 15px; 
}
  
/* Products Grid */
.products-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
  gap: 20px; 
  justify-content: center; 
  align-items: start; 
  align-content: start; 
}
  
/* Product Card */
.product-card {
  background-color: white;
  border-radius: 12px; 
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07); 
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  width: 100%; 
  margin: 0 auto; 
  height: auto; 
}
  
.product-card:hover {
  transform: translateY(-6px); 
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); 
}

.product-image-container {
  position: relative;
  padding-top: 100%; 
  width: 100%;
  background-color: white; 
  overflow: hidden;
  border-bottom: 1px solid #f0f0f0; 
}
  
.product-image {
  object-fit: contain; 
  object-position: center;
  width: 100%;
  position: absolute;
  top: 50%; 
  left: 50%; 
  height: 90%; 
  width: 90%;  
  transform: translate(-50%, -50%) scale(1);
  overflow: hidden;
  transition: transform 0.3s ease-in-out;
}

.product-card:hover .product-image {
  transform: translate(-50%, -50%) scale(1.07);
}
  
.product-details {
  padding: 16px; 
  display: flex;
  flex-direction: column;
  gap: 6px; 
  flex-grow: 1;
  overflow-y: auto; 
}
  
.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
  
.product-info {
  flex-grow: 1;
}
  
.product-name {
  font-size: 16px; 
  font-weight: 600;
  color: #222; 
  margin-bottom: 3px; 
  line-height: 1.3; 
}
  
.product-brand {
  font-size: 13px; 
  color: #666; 
}
  
.product-price {
  font-size: 20px; 
  font-weight: 700;
  color: #007bff; 
  white-space: nowrap; 
}

.no-results {
  grid-column: 1 / -1; 
  text-align: center;
  padding: 40px 20px;
  font-size: 17px; 
  color: #555;
}
  
/* Responsive Styles */
@media (max-width: 1199px) {
    .main-header.products-header-variant .search-container { max-width: 300px; }
    .main-header.products-header-variant #searchInput { font-size: 14px; height: 36px; }
}

@media (max-width: 991px) {
    .main-header.products-header-variant .search-container-wrapper { max-width: 250px; }
    .main-header.products-header-variant .search-container { max-width: 280px; }
    .main-content { padding: 15px; gap: 15px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 15px; }
}

@media (max-width: 767px) {
    .main-content { flex-direction: column; padding: 10px; }
    .filters-sidebar { width: 100%; margin-bottom: 20px; }
    .main-header.products-header-variant .search-container-wrapper { max-width: 100%; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .product-card { border-radius: 8px; }
    .product-details { padding: 10px; gap: 4px; }
    .product-name { font-size: 12px; }
    .product-brand { font-size: 12px; }
    .product-price { font-size: 16px; }
}

/* Accessibility Enhancements */
:focus-visible {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* New: Styling for the "Dodaj u Korpu" button on products.html */
.add-to-cart-btn {
    background-color: #007bff; /* Light blue */
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%; /* Make button full width */
    margin-top: 10px; /* Space from price */
}

.add-to-cart-btn:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

.original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.8em;
    margin-right: 10px;
}

@media (min-width: 768px) {
  .product-price:has(.original-price) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .original-price {
    margin-bottom: 2px;
    margin-right: 0;
    display: block;
  }
  .discounted-price {
    display: block;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 2px;
    font-size: 1.2em;
    color: #dc3545;
    background: #fff0f3;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 6px;
  }
}

@media (max-width: 767px) {
  /* Only stack if both original and discounted price exist */
  .product-price:has(.original-price) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .original-price {
    margin-bottom: 2px;
    margin-right: 0;
    display: block;
  }
  .discounted-price {
    display: block;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 2px;
    font-size: 1.2em;
    color: #dc3545;
    background: #fff0f3;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 6px;
  }
}