/* =============================
   GRID + FILTERS + RESPONSIVE
============================= */

/* 3-column grid matching main page layout */
.cafe-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 0 1.5rem;
}

/* Consistent spacing for all cafes sections */
#all-cafes {
  margin-bottom: 1rem;
}

#all-cafes-container {
  margin-bottom: 1rem;
}

.filter-toolbar {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 1.5rem 2rem !important;
  background-color: transparent !important;
  width: 100% !important;
  text-align: center !important;
  min-height: 80px !important;
}

.sort-btn {
  font-weight: bold !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  background: #fff !important;
  color: #3e2c1c !important;
  border: 2px solid #3e2c1c !important;
  padding: 0.8rem 1.5rem !important;
  border-radius: 0.7rem !important;
  cursor: pointer !important;
  font-size: 1rem !important;
  transition: all 0.2s ease !important;
  margin: 0 auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10 !important;
}

.sort-btn:hover {
  background: transparent !important;
}

.filter-icon {
  font-size: 1.1rem;
  font-weight: bold;
}

.filter-modal {
  position: fixed;
  top: 90px;
  right: 20px;
  width: 320px;
  background: #fdf7f1;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  border-radius: 12px;
  display: none;
}

.filter-modal:not(.hidden) {
  display: block;
}

.filter-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-group {
  background-color: #fff;
  border: 1px solid #e0d8cf;
  border-radius: 12px;
  padding: 1rem;
}

.filter-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.filter-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-checkboxes label {
  background-color: #fff8f2;
  border: 1px solid #e2d8ce;
  border-radius: 0.5rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-checkboxes input {
  margin-right: 0.3rem;
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

/* Mobile responsive for filter toolbar */
@media (max-width: 768px) {
  .filter-toolbar {
    padding: 0.8rem 1rem !important;
    min-height: 50px !important;
    margin: 0 !important;
  }

  .sort-btn {
    padding: 0.8rem 1.2rem !important;
    font-size: 0.95rem !important;
    width: auto !important;
    min-width: 120px !important;
  }

  /* Mobile responsive for filter modal */
  .filter-modal {
    position: fixed;
    top: 5px;
    right: 5px;
    left: 5px;
    width: auto;
    max-width: calc(100vw - 10px);
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2000;
  }

  .filter-content {
    gap: 0.8rem;
  }

  .filter-group {
    padding: 0.8rem;
  }

  .filter-group label {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
  }

  .filter-checkboxes {
    gap: 0.3rem;
  }

  .filter-checkboxes label {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .filter-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .filter-actions button {
    width: 100%;
  }

  /* Mobile responsive for form elements in filter */
  .form-section select {
    padding: 0.7rem;
    font-size: 0.9rem;
  }
}

/* Tablet responsive styles */
@media (max-width: 1024px) and (min-width: 769px) {
  .filter-modal {
    width: 350px;
    right: 15px;
    top: 95px;
  }

  .sort-btn {
    padding: 0.8rem 1.3rem !important;
  }
}