@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

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

:root {
  --primary: #45939a;
  --primary-dark: #356f74;
  --primary-light: #eef9fa;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  font-family: var(--font);
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   HEADER
   ============================================ */
header.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 80px;
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dashboard-header .header-logo img {
  max-width: 44px;
  transition: transform 0.2s var(--ease);
}

.dashboard-header .header-logo img:hover {
  transform: scale(1.05);
}

.header-filters {
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 8px 20px;
  transition: box-shadow 0.25s var(--ease);
}

.header-filters:hover {
  box-shadow: var(--shadow-md);
}

.header-filters input {
  padding: 8px 12px;
  border: none;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font);
  background: transparent;
  outline: none;
}

.search-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}

.search-btn:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

.header-links a {
  margin-left: 20px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s;
}

.header-links a:hover {
  color: var(--primary-dark);
}

/* Selector de filtros */
.header-filters select {
  background-color: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.header-filters select:hover,
.header-filters select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(69, 147, 154, 0.15);
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  justify-content: center;
}

.filter-button {
  background-color: var(--card);
  color: var(--text);
  border: 1.5px solid var(--primary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.filter-button:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.filter-button.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(69, 147, 154, 0.3);
}

/* ============================================
   FILTERS MODAL
   ============================================ */
.filters-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.filters-modal.show {
  display: block;
}

.filters-modal h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.close-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.price-slider-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  position: relative;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  outline: none;
  border-radius: 4px;
  cursor: pointer;
  position: absolute;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: white;
  border: 2.5px solid var(--primary);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  z-index: 5;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: white;
  border: 2.5px solid var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.price-values {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

.price-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  gap: 4px;
}

.price-box p {
  font-size: 17px;
  font-weight: 700;
  background: var(--bg);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--text);
}

.apply-btn {
  display: block;
  width: 100%;
  background: var(--primary);
  color: white;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  margin-top: 24px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.apply-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(69, 147, 154, 0.3);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.dashboard-main {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 24px;
  gap: 24px;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
}

.listing-section {
  flex: 1.5;
}

.listing-section h2 {
  font-size: 17px;
  margin-bottom: 12px;
  font-weight: 500;
  color: var(--text);
}

.listing-info {
  font-size: 12px;
  margin-bottom: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.listing-info a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
}

.listing-container {
  max-height: 540px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.listing-container::-webkit-scrollbar {
  width: 6px;
}

.listing-container::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: var(--radius-full);
}

.listing-container::-webkit-scrollbar-track {
  background: var(--bg);
}

.listing-container a {
  text-decoration: none;
  color: var(--text);
}

.listing-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.listing-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(69, 147, 154, 0.3);
}

.listing-item img {
  width: 240px;
  height: auto;
  border-radius: var(--radius-sm);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.listing-details h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.listing-details p {
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

.listing-warning {
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

/* ============================================
   MAP SECTION
   ============================================ */
.map-section {
  flex: 1;
  height: 540px;
  background-color: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

#map {
  width: 100%;
  height: 100%;
}

/* ============================================
   CITY SELECTOR
   ============================================ */
.city-selector {
  background-color: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.city-selector:hover {
  border-color: var(--primary);
}

.city-selector::after {
  content: "\25BC";
  position: absolute;
  right: 15px;
  color: var(--text-muted);
}

.city-selector::-ms-expand {
  display: none;
}

/* ============================================
   COOKIES
   ============================================ */
.cookie-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary);
  color: white;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 999;
  transition: all 0.25s var(--ease);
}

.cookie-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 560px;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}

.cookie-modal.show {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-content h2 {
  font-size: 17px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 10px;
}

.cookie-modal-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.7;
}

.cookie-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.cookie-options label {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  font-weight: 500;
}

.cookie-options input[type="checkbox"] {
  margin-right: 10px;
  accent-color: var(--primary);
}

.cookie-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cookie-actions .button {
  background-color: var(--primary);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.cookie-actions .button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

.cookie-actions .button.secondary {
  background-color: var(--card);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.cookie-actions .button.secondary:hover {
  background-color: var(--primary);
  color: white;
}

.blur-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s var(--ease);
}

.blur-background.show {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   PRIVACY & TERMS
   ============================================ */
.privacy-policy-container,
.terms-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem;
  color: var(--text);
  line-height: 1.7;
}

.privacy-policy-container h1,
.terms-container h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 800;
  color: var(--primary);
}

.privacy-policy-container h2,
.terms-container h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--text);
}

.privacy-policy-container p,
.privacy-policy-container ul,
.terms-container p,
.terms-container ul {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.privacy-policy-container ul,
.terms-container ul {
  list-style-type: disc;
  margin-left: 1.5rem;
}

.privacy-policy-container a,
.terms-container a {
  color: var(--primary);
  text-decoration: underline;
  transition: color 0.2s;
}

.privacy-policy-container a:hover,
.terms-container a:hover {
  color: var(--primary-dark);
}

/* ============================================
   FAQ
   ============================================ */
.faq-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.faq-container h2 {
  text-align: left;
  margin-bottom: 2rem;
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--text);
}

.faq-item {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
  position: relative;
}

.faq-item input[type="checkbox"] {
  display: none;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 1.1rem 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  transition: color 0.2s;
  padding-right: 1em;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-icon {
  font-weight: 700;
  font-size: 1.3rem;
  transition: transform 0.3s var(--ease);
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.faq-item input[type="checkbox"]:checked ~ .faq-answer {
  max-height: 900px;
  padding-bottom: 1rem;
}

.faq-item input[type="checkbox"]:checked ~ .faq-question .faq-icon {
  transform: rotate(135deg);
}

.hidden {
  display: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background-color: var(--primary);
  color: white;
  padding: 36px 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: auto;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1100px;
}

.footer-logo {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.footer-logo img {
  width: 110px;
  max-width: 100%;
  filter: brightness(1.05);
}

.footer-content {
  flex: 3;
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  text-align: right;
}

.footer-links h4,
.footer-social h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 6px;
}

.footer-links li a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links li a:hover {
  color: white;
}

.footer-social .social-icons a {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.85);
  margin-right: 12px;
  transition: all 0.2s var(--ease);
}

.footer-social .social-icons a:hover {
  color: white;
  transform: translateY(-2px);
}

.footer-legal {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal a:hover {
  color: white;
}

/* ============================================
   MOBILE MAP MODAL
   ============================================ */
@media (max-width: 1024px) {
  #map-modal-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    font-size: 22px;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s var(--ease);
  }

  #map-modal-button:hover {
    transform: scale(1.1);
  }

  #map-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
  }
  #map-modal .map-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
  }
  #map-modal .map-modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1002;
  }
  #modal-map {
    width: 100%;
    height: 100%;
  }
}

@media (min-width: 769px) {
  .map-modal-close {
    display: none;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .dashboard-main {
    flex-direction: column;
  }
  .map-section {
    height: 300px;
  }
}

@media (max-width: 768px) {
  header.dashboard-header {
    padding: 10px 16px;
    gap: 12px;
    justify-content: center;
  }
  .header-logo img {
    display: none;
  }
  .header-links {
    display: none;
  }
  .header-filters {
    flex-direction: row;
  }

  .filter-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .filter-button:hover {
    background-color: var(--card);
    color: var(--text);
  }
  .filter-button.active {
    background-color: var(--primary);
    color: white;
  }

  .dashboard-main {
    padding: 12px;
  }

  .listing-container {
    max-height: none;
  }

  .listing-item {
    flex-direction: column;
    align-items: center;
  }

  .listing-item img {
    width: 100%;
    height: auto;
  }

  .map-section {
    display: none;
  }

  .price-values {
    margin-top: 40px;
  }

  .filters-modal {
    width: 90%;
    padding: 20px;
  }

  .faq-container {
    padding: 2rem 1rem;
  }

  .cookie-modal {
    width: 95%;
    padding: 20px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .footer-content {
    justify-content: center;
    text-align: center;
  }

  .footer-logo {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .header-filters input,
  .search-btn {
    width: 100%;
  }
}
