:root{
  --primary:#2a60c9;
  --primary-dark:#1f4ea3;
  --blue:#007bff;
  --blue-dark:#0056b3;
  --whatsapp:#25D366;
  --whatsapp-dark:#1ebe5b;
  --text:#333;
  --bg:#f8f8f8;
  --border:#ddd;
}

/* === ESTILOS GENERALES === */
body {
  font-family: Arial, sans-serif;
  background-color: var(--bg);
  margin: 0;
  padding: 0;
  color: var(--text);
}

/* === NAVBAR === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: white;
  flex-wrap: wrap;
  border-bottom: 1px solid #ddd;
  gap: 1rem;
}

.navbar-logo-img {
  height: 50px;
  max-width: 100%;
}

.navbar-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  gap: 0.6rem;
  margin-left: auto;
}

.input-with-icon {
  position: relative;
  display: flex;
  width: 100%;
}

.input-with-icon input {
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 0.8rem;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  font-size: 1rem;
  background: white;
  transition: border 0.2s, box-shadow 0.2s;
}

.input-with-icon input:focus {
  border: 1.5px solid var(--primary);
  box-shadow: 0 2px 8px rgba(44,79,141,0.15);
  outline: none;
}

.input-with-icon button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--primary);
  border: none;
  border-radius: 50%;
  height: 32px;
  width: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-with-icon button:hover {
  background: rgba(42,96,201,0.1);
}

/* === FILTROS === */
.filters-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  flex-wrap: wrap;
}

.filters-row select,
.filters-row button {
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  border: none;
  font-size: 1rem;
  min-width: 120px;
  cursor: pointer;
  background: var(--primary);
  color: white;
}

.filters-row button:hover {
  background-color: var(--primary-dark);
}

/* === GRID DE CARDS === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.card {
  background-color: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-4px);
}

.card h3 {
  margin-top: 0;
  text-align: center;
  font-size: 1.2rem;
}

/* Contenedor de los botones para que queden alineados */
.card-buttons {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.whatsapp-button,
.details-button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  font-size: 1rem;
}

.whatsapp-button {
  background-color: var(--whatsapp);
  color: white;
}
.whatsapp-button:hover {
  background-color: var(--whatsapp-dark);
}

.details-button {
  background-color: var(--blue);
  color: white;
}
.details-button:hover {
  background-color: var(--blue-dark);
}

/* === PAGINACIÓN === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  text-align: center;
}

.pagination button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: none;
  background-color: var(--whatsapp);
  color: white;
  border-radius: 5px;
  cursor: pointer;
}
.pagination button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}
#pageInfo {
  font-weight: bold;
  margin: 0;
  display: inline-block;
}

/* === MEDIA QUERIES === */
@media (max-width: 600px) {
  .navbar { flex-direction: column; align-items: center; }
  .navbar-controls { width: 100%; margin-left: 0; }
  .input-with-icon { width: 90%; }
  .filters-row { flex-direction: row; justify-content: center; width: 100%; }
  .filters-row select, .filters-row button { width: auto; max-width: 150px; }
  .cards-grid { grid-template-columns: 1fr; padding: 1rem; }
  .pagination { flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
  .pagination button { width: 90%; max-width: 200px; }
}

@media (min-width: 601px) {
  .navbar-controls { flex-direction: row; justify-content: flex-end; align-items: center; }
  .input-with-icon { width: 520px; max-width: 520px; min-width: 420px; }
  .filters-row { flex-wrap: nowrap; width: auto; gap: 0.5rem; }
  .filters-row select, .filters-row button { width: auto; }
}

/* Chips (si se usan más adelante) */
.details-button.active { outline: 2px solid #1e90ff; }
#provinceChips { max-width: 1100px; margin: 16px auto 0; padding: 0 12px; }
.chips-panel { background: #ffffff; border: 1px solid rgba(0,0,0,0.06); border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,0.06); padding: 14px; }
.chips-header { display: flex; align-items: center; gap: 10px; padding: 6px 6px 10px 6px; border-bottom: 1px dashed rgba(0,0,0,0.08); margin-bottom: 10px; }
.chips-title { font-size: 14px; font-weight: 600; color: #334155; }
.chips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 6px; }
#toggleProvincesBtn { border-radius: 10px; padding: 8px 12px; background: #f1f5f9; color: #0f172a; border: 1px solid #e2e8f0; box-shadow: none; }
#toggleProvincesBtn:hover { background: #e9eef5; }
.cards-grid .card { border-radius: 18px; box-shadow: 0 10px 28px rgba(2, 6, 23, 0.06); }

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-top: 2rem;
  padding: 1rem;
  font-size: 0.9rem;
  color: #666;
}

footer p {
  margin: 0;  
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }

