/**
 * @file
 * Product filter page styles.
 */

.product-filter-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.page-header {
  text-align: center;
  margin: 30px 0 40px;
  color: #2c3e50;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.page-header p {
  font-size: 1.1rem;
  color: #7f8c8d;
}

.product-filter-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}

/* Filters Sidebar */
.filters-sidebar {
  position: sticky;
  top: 20px;
}

.filters-wrapper {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  /* box-shadow: 0 5px 20px rgba(0,0,0,0.08); */
  /* border: 1px solid #e9ecef; */
}

.filters-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 25px;
  color: #2c3e50;
  padding-bottom: 15px;
  border-bottom: 2px solid #ff6600;
}

.filter-group {
  margin-bottom: 30px;
}

.filter-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #2c3e50;
}

.filter-option {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
  padding: 8px 12px;
  border-radius: 6px;
}

.filter-option:hover {
  background: #f8f9fa;
  transform: translateX(5px);
}

.filter-option input[type="radio"] {
  margin-right: 12px;
  accent-color: #ff6600;
  transform: scale(1.2);
}

.option-label {
  cursor: pointer;
  font-size: 1rem;
  color: #34495e;
  flex: 1;
}

/* Products Main */
.products-main {
  min-height: 600px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px 0;
  border-bottom: 1px solid #e9ecef;
}

.results-count {
  color: #7f8c8d;
  font-size: 1.1rem;
  font-weight: 500;
}

.sort-options {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-options label {
  color: #7f8c8d;
  font-weight: 500;
}

.form-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #34495e;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
  align-items: stretch;       /* ensure grid items stretch to equal height */
}

.product-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  /* box-shadow: 0 5px 20px rgba(0,0,0,0.08); */
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid #e9ecef;
  height: 100%;              /* fill the grid track */
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.image-container {
  position: relative;
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: #f8f9fa;
}

.overlay-image {
  position: absolute;
  bottom: -35%;
  left: 15px;
  width: 7em;
  height: -webkit-fill-available;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 8px;
  /* box-shadow: 0 3px 10px rgba(0,0,0,0.2); */
  background-color: rgba(255,255,255 / 0%);
  padding: 5px;
}

.product-content {
  padding: 25px;
  flex: 1 1 auto;            /* take up all available vertical space */
}

.product-footer {
  padding: 0 25px 25px;      /* same side/bottom padding as content */
  margin-top: auto;          /* push footer to bottom of card */
}

.product-title {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #2c3e50;
  line-height: 1.3;
}

.product-title a {
  color: inherit;
  text-decoration: none;
}

.product-title a:hover {
  color: #ff6600;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  background: #e9ecef;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #495057;
  font-weight: 500;
}

.tag--feature {
  /* background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7; */

      background: #e9ecef;
    color: #495057;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.button--primary {
  background: #f7881f !important;
  color: #000 !important;
  clip-path: polygon(0 0, 80% 0, 100% 100%, 20% 100%) !important;
  border: none !important;

}

.button--primary:hover {
  background: #f7881f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(229, 92, 0, 0.3);
  border: none;
}

.button--secondary {
  background: #6c757d;
  color: #fff;
}

.button--secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.view-more-btn {
  width: 100%;
  text-align: center;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.clear-filters {
  width: 100%;
  margin-top: 20px;
}

/* hide filters */
.filter-option--hidden {
  display: none;
}

.filter-options.is-expanded .filter-option--hidden {
  display: flex;
}

.filter-toggle {
  margin-top: 8px;
  background: none;
  border: none;
  padding: 0;
  color: #ff6600;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.filter-toggle:hover {
  text-decoration: underline;
}


/* No Products State */
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 40px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px dashed #dee2e6;
}

.no-products-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.no-products h3 {
  color: #6c757d;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.no-products p {
  color: #7f8c8d;
  margin-bottom: 25px;
  font-size: 1.1rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .product-filter-layout {
    grid-template-columns: 280px 1fr;
    gap: 30px;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .product-filter-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .filters-sidebar {
    position: static;
  }
  
  .filters-wrapper {
    padding: 25px;
  }
  
  .results-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }
  
  .page-header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .product-filter-page {
    padding: 0 15px 30px;
  }
  
  .filters-wrapper {
    padding: 20px;
  }
  
  .product-content {
    padding: 20px;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .no-products {
    padding: 40px 20px;
  }
  
  .no-products-icon {
    font-size: 3rem;
  }
}

/* AJAX Loading States */
.products-grid.loading {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-state {
  text-align: center;
  padding: 40px;
  color: #7f8c8d;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ff6600;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Filter transition effects */
.filter-option input[type="radio"] {
  transition: all 0.3s ease;
}

.products-grid {
  transition: opacity 0.3s ease;
}

.products-grid.loading {
  opacity: 0.7;
}

/* Active filter state */
.filter-option input[type="radio"]:checked + .option-label {
  color: #ff6600;
  font-weight: 600;
}

.filter-option input[type="radio"]:checked + .option-label::before {
  /* content: "✓ "; */
  font-weight: bold;
}
input[type="radio"]:checked {
  background: orange !important;
}

/* filter button */
.filters-toggle-btn {
  display: none;
}

/* Mobile / Tablet */
@media (max-width: 1024px) {
  .filters-toggle-btn {
    display: inline-block;
    background: #f6881f;
    color: #000;
    border: none;
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    /* margin-bottom: 1rem; */
    clip-path: polygon(0 0, 80% 0, 100% 100%, 20% 100%);
  }

  .filters-sidebar {
    display: none;
  }

  .filters-sidebar.is-open {
    display: block;
  }
}