/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}



/* Main Container */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

/* Mobile Filter Button */
.mobile-filter-button {
  display: none;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 71px;
  z-index: 100;
}

.mobile-filter-button button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #32b905;
  color: white;
  border: none;
  border-radius: 24px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* Horizontal Filter Bar (Desktop) */
.horizontal-filter-bar {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  overflow: hidden;
}

.filter-categories {
  display: flex;
  border-bottom: 1px solid #eee;
  background-color: #f9f9f9;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.filter-categories::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.category-button {
  padding: 15px 20px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.3s;
}

.category-button:hover {
  color: #1a3b5d;
}

.category-button.active {
  color: #1a3b5d;
  font-weight: 600;
}

.category-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #1a3b5d;
}

.filter-content {
  padding: 20px;
}

.category-content {
  display: none;
}

.category-content.active {
  display: block;
}

/* Checkbox Grid for Desktop */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.desktop-show-more {
  grid-column: 1 / -1;
  justify-self: start;
}

/* Desktop Actions */
.desktop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

/* Mobile Filter Container */
.filter-container {
  display: none;
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  margin-bottom: 15px;
}

.filter-header h1 {
  font-size: 20px;
  font-weight: 600;
}

.filter-header button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

/* Filter Sections (Mobile) */
.filter-section {
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

.filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 5px 0;
}

.section-header h2 {
  color: #1a3b5d;
  font-size: 18px;
  font-weight: 600;
}

.toggle-icon {
  transition: transform 0.3s ease;
}

.section-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

/* Checkbox Styles */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
}

input[type="checkbox"]:checked {
  background-color: #1a3b5d;
  border-color: #1a3b5d;
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.checkbox-label {
  font-size: 14px;
  color: #333;
}

/* Show More Button */
.show-more {
  background: none;
  border: none;
  color: #4a90e2;
  font-size: 14px;
  cursor: pointer;
  padding: 5px 0;
  margin-top: 10px;
  text-decoration: underline;
  text-align: left;
}

.show-more:hover {
  color: #2a6fc9;
}

.hidden-items {
  display: none;
  margin-top: 10px;
}

.hidden-items.active {
  display: block;
}

/* Filter Actions */
.filter-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.reset-button {
  padding: 10px 20px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

.apply-button {
  padding: 10px 20px;
  background-color: #32b905;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* Filter Overlay */
.filter-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

/* Content Area */
.content-area {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.content-area h1 {
  margin-bottom: 20px;
  font-size: 24px;
  color: #1a3b5d;
}

/* Active Filters */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-chip {
  display: flex;
  align-items: center;
  background-color: #f0f5ff;
  border: 1px solid #d0e0ff;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 14px;
  color: #1a3b5d;
}

.filter-chip button {
  background: none;
  border: none;
  color: #666;
  margin-left: 8px;
  cursor: pointer;
  font-size: 16px;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.result-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-image {
  height: 150px;
  background-color: #eee;
  background-image: linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5),
                    linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.result-info {
  padding: 15px;
}

.result-info h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.result-info p {
  color: #666;
  font-size: 14px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  body {
    padding-bottom: 80px; /* Space for the filter button */
  }

  .main-container {
    padding: 10px;
  }

  .mobile-filter-button {
    display: block;
  }

  .horizontal-filter-bar {
    display: none;
  }

  .filter-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    border-radius: 0;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding-bottom: 80px; /* Space for action buttons */
  }

  .filter-container.active {
    transform: translateX(0);
    display: block;
  }

  .mobile-only {
    display: flex;
  }

  .filter-header {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 2;
    padding: 15px 20px;
  }

  .filter-actions.mobile-only {
    display: flex;
    position: sticky;
    bottom: 0;
    background-color: white;
    padding: 15px 20px;
    z-index: 2;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }

  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* Desktop Layout */
@media (min-width: 769px) {
  .horizontal-filter-bar {
    display: block;
  }
}
