@import url('https://fonts.googleapis.com/css2?family=Sofia+Sans+Extra+Condensed:ital,wght@0,1..1000;1,1..1000&display=swap');

/* ======================================================
   DESIGN SYSTEM BASE
   ------------------------------------------------------
   Global CSS variables for colors, typography, spacing,
   radius, shadows and layout.
   Place this file in:

   public/assets/css/design-system-base.css

   Then import in your main layout:
   <link rel="stylesheet" href="/assets/css/design-system-base.css">
   ====================================================== */

:root {

  /* ================= COLORS ================= */

  /* Brand */
  --color-primary: #072B50;
  --color-secondary: #8198B8;
  --color-accent: #9A031F;

  /* Neutrals */
  --color-background: #FFFFFF;
  --color-surface: #F2F4F7;
  --color-border: #8198B8;

  --color-text-primary: #072B50;
  --color-text-secondary: #A01F34;
  --color-text-muted: #8198C8;


  /* ================= TYPOGRAPHY ================= */

  --font-sans: "Sofia Sans Extra Condensed", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Merriweather", Georgia, serif;
  --font-mono: "JetBrains Mono", monospace;

  --text-base: 14px;
  /* 16px */
  --text-lg: 17px;
  /* 18px */
  --text-xl: 24px;
  /* 20px */
  --text-2xl: 30px;
  /* 24px */
  --text-3xl: 50px;
  /* 30px */
  --text-4xl: 80px;
  /* 36px */

  --font-weight-regular: 300;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;


  /* ================= SPACING ================= */

  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */


  /* ================= RADIUS ================= */

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;


  /* ================= SHADOWS ================= */

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.2);


  /* ================= LAYOUT ================= */

  --container-width: 1200px;
  --container-padding: var(--space-4);
}


/* ======================================================
   BASE RESET
   ====================================================== */

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background: var(--color-background);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}


/* ======================================================
   UTILITY CLASSES (minimal base)
   ====================================================== */

.container {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.p-4 {
  padding: var(--space-4);
}


/* ======================================================
   BASIC COMPONENT EXAMPLES
   ====================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);

  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;

  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);

  transition: 0.2s ease;
}

.btn-primary {
  background: var(--color-primary-500);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-600);
}

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

label {
  display: block;
  font-weight: 500;
  color: var(--color-text-primary);
}

.card label {
  color: var(--color-text-primary);
  font-size: var(--text-xl);
}

/* ================= DROPDOWN ================= */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-lg);
  background: white;
  text-align: left;
  cursor: pointer;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;

  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);

  display: none;
  z-index: 50;
  padding: 10px;
}

.dropdown.open .dropdown-panel {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--color-text-primary);
}

/* ================= PROPERTY CARD ================= */

.property-card {
  padding: 0;
  overflow: hidden;
  border: 1px dotted var(--color-secondary);
  transition: transform .15s ease, box-shadow .15s ease;
}

.property-description {
  padding: var(--space-4);
  font-size: var(--text-xl);
  color: var(--color-text-primary);
}


.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}


/* Imagen */
.property-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.property-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.property-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

/* Precio overlay */
.property-price {
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  color: white;
  line-height: 1;
}


/* Body */
.property-body {
  padding: var(--space-4);
}

.property-type {
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-lg);
}


.property-meta {
  margin-top: var(--space-2);
  font-size: var(--text-lg);
  color: var(--color-text-primary);
  letter-spacing: 1px;
  font-weight: var(--font-weight-medium);
}

/* ================= FEATURED PROPERTY CARD ================= */

.property-card--featured {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--color-surface);
}

/* BADGES */
.property-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
}

.badge {
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
}

/* FAVORITO */
.property-fav {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: var(--shadow-md);
  font-size: 18px;
}

/* BODY */
.property-location {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.property-status {
  color: var(--color-accent);
  margin-left: 6px;
}

/* FOOTER */
.property-footer {
  margin-top: var(--space-4);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.property-price-big {
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.property-ref {
  font-size: var(--text-2xl);
  color: var(--color-text-muted);
}

/* PRECIO SOBRE IMAGEN */
.property-price-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;

  background: rgba(0, 0, 0, 0.82);
  color: #fff;

  padding: 8px 12px;
  border-radius: var(--radius-md);

  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.5px;

  backdrop-filter: blur(2px);
}

/* ================= HERO SEARCH ================= */

.search-hero {
  background: var(--color-primary);
  padding: var(--space-12) var(--space-4);
  color: white;
}

.search-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}


/* TABS */

.search-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.tab {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: white;
  padding: 10px 28px;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
}

.tab.active {
  background: rgba(255, 255, 255, 0.08);
}


/* BARRA FILTROS */

.search-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr) auto;
  background: #e9edf2;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.search-bar select,
.search-bar input {
  border: none;
  padding: 16px;
  font-size: 14px;
  background: transparent;
  border-right: 1px solid #cfd6df;
}

.search-bar input {
  border-right: none;
}


/* ACCIONES DERECHA */

.search-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: 8px;
}

.btn-map {
  background: #8fa3bd;
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-weight: 600;
}

.btn-search {
  background: var(--color-accent);
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-size: var(--text-xl);
  color: white;
  font-weight: 600;
}


/* LINKS INFERIORES */

.search-links {
  display: flex;
  justify-content: end;
  gap: var(--space-4);
  margin-top: var(--space-4);
  font-size: 14px;
  align-items: center;
}

.search-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: var(--text-xl);
}

/* ================= PROPERTY PAGE ================= */

.property-page {
  background: var(--color-surface);
  padding-block: var(--space-12);
}


/* HERO */

.property-hero {
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
}

.property-title {
  font-size: var(--text-3xl);
}

.property-price {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
}


/* GALLERY */

.property-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.gallery-main img,
.gallery-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.gallery-side {
  display: grid;
  gap: var(--space-4);
}

.gallery-more {
  position: absolute;
}


/* TABS */

.property-tabs {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.property-tabs button {
  background: transparent;
  border: none;
  padding: var(--space-3) var(--space-6);
}

.property-tabs .active {
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
}


/* SECTIONS */

.property-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
}

.section-title {
  text-align: center;
  font-size: var(--text-3xl);
  margin-bottom: var(--space-6);
}


/* OVERVIEW GRID */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  text-align: center;
}

/* ================= LIGHTBOX ================= */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--radius-lg);
}

.lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

#lightbox-close {
  top: 20px;
  right: 20px;
}

#lightbox-prev {
  left: 20px;
}

#lightbox-next {
  right: 20px;
}

/* ================= OVERVIEW (PROPERTY SHOW) ================= */

.property-overview {
  background: white;
}

/* GRID PRINCIPAL */
.overview-icons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-6);
  text-align: center;
}

/* ITEM */
.overview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
}

/* ICONO */
.overview-icon {
  font-size: 42px;
}

/* LABEL */
.overview-label {
  font-size: var(--text-lg);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

/* VALOR */
.overview-value {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

/* ===== BADGES ===== */
.overview-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.overview-badge {
  background: #8fa3bd;
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
}

/* ===== ICON ROW ===== */
.overview-icons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.overview-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: center;
}

.overview-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}


.overview-value {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
}

/* ===== DETAILS GRID ===== */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  font-size: var(--text-xl);
}

.overview-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* ======================================================
   TABLET
   ====================================================== */
@media (max-width: 1024px) {

  .search-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }

  .property-gallery {
    grid-template-columns: 1fr;
  }

  .overview-icons {
    grid-template-columns: repeat(3, 1fr);
  }

  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* grid home properties */
  .container>div>div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


/* ======================================================
   MOBILE
   ====================================================== */
@media (max-width: 768px) {

  /* HERO PROPERTY */
  .property-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .property-hero-right {
    align-items: flex-start;
  }

  .property-title {
    font-size: var(--text-2xl);
  }

  .property-price {
    font-size: var(--text-2xl);
  }

  /* SEARCH */
  .search-bar {
    grid-template-columns: 1fr;
  }

  .search-links {
    justify-content: center;
  }

  /* HOME GRID */
  .container>div>div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    margin: 0 var(--space-4) !important;
  }

  /* OVERVIEW */
  .overview-icons {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .overview-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .overview-item {
    flex-direction: row;
    justify-content: flex-start;
  }

  /* GALLERY */
  .gallery-side {
    grid-template-columns: repeat(2, 1fr);
  }

  /* LIGHTBOX */
  .lightbox img {
    max-width: 95%;
    max-height: 80%;
  }
}


/* ======================================================
   SMALL MOBILE
   ====================================================== */
@media (max-width: 480px) {

  body {
    font-size: 15px;
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  .property-title {
    font-size: var(--text-xl);
  }

  .property-price {
    font-size: var(--text-xl);
  }

  .overview-icons {
    grid-template-columns: 1fr;
  }

  .gallery-side {
    grid-template-columns: 1fr;
  }

  .btn-search {
    width: 100%;
  }
}