:root {
  --ct-gold-1: #f6e2a3;
  --ct-gold-2: #e1af3f;
  --ct-gold-3: #dca630;
  --ct-gold-4: #b97f1c;
  --ct-gold-5: #7b5616;
  --ct-gold-dark: #1b1610;
  --ct-dark-1: #101010;
  --ct-dark-2: #171411;
  --ct-dark-3: #0f0e0d;
  --ct-text-soft: #d9d9d9;
  --ct-text-muted: #cfcfcf;
}

/* =========================
   PIN DEL MAPA
   (SIN MODIFICAR)
========================= */

.ct-map-pin {
  width: 85px;
  height: 75px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform: translateY(-1px);
}

.ct-map-pin img {
  width: auto;
  height: 75px;
  display: block;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.18));
}

/* =========================
   CONTENEDOR GENERAL
========================= */

.ct-map-section {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 30px 20px;
}

.ct-map-header {
  margin-bottom: 18px;
  text-align: center;
}

.ct-map-title {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(180deg, var(--ct-gold-1) 0%, var(--ct-gold-3) 42%, var(--ct-gold-4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ct-map-subtitle {
  margin: 0;
  font-size: 1rem;
  color: var(--ct-text-soft);
}

/* =========================
   TOOLBAR
========================= */

.ct-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.ct-map-btn {
  border: 1px solid rgba(173, 126, 30, 0.42);
  background: linear-gradient(
    180deg,
    #3f3117 0%,
    #241b11 46%,
    #16110c 100%
  );
  color: #f4e7c8;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 190, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 10px 18px rgba(0, 0, 0, 0.20);
  transition: all 0.25s ease;
}

.ct-map-btn:hover {
  background: linear-gradient(
    180deg,
    #faecc6 0%,
    #efd37d 18%,
    #d8b043 52%,
    #b98520 100%
  );
  color: #5a4510;
  border-color: rgba(193, 148, 49, 0.56);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 225, 0.42),
    inset 0 -1px 0 rgba(140, 98, 18, 0.20),
    0 12px 24px rgba(0, 0, 0, 0.22);
}

.ct-map-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================
   LAYOUT PRINCIPAL
========================= */

.ct-map-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

/* =========================
   SIDEBAR
========================= */

.ct-map-sidebar {
  background: linear-gradient(180deg, rgba(22, 18, 13, 0.98) 0%, rgba(13, 11, 10, 0.98) 100%);
  border: 1px solid rgba(214, 166, 71, 0.18);
  border-radius: 22px;
  padding: 18px;
  min-height: 560px;
  max-height: 560px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 224, 155, 0.04),
    0 18px 40px rgba(0, 0, 0, 0.22);
}

.ct-map-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ct-map-sidebar-head h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
}

.ct-map-sidebar-head span {
  font-size: 0.9rem;
  color: #c9c9c9;
}

.ct-map-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(560px - 56px);
  overflow-y: auto;
  padding-right: 4px;
}

.ct-map-list::-webkit-scrollbar {
  width: 8px;
}

.ct-map-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(239, 202, 113, 0.75) 0%, rgba(184, 137, 37, 0.85) 100%);
  border-radius: 999px;
}

/* =========================
   TARJETAS
========================= */

.ct-map-card {
  background: linear-gradient(180deg, rgba(28, 24, 19, 0.98) 0%, rgba(17, 15, 13, 0.98) 100%);
  border: 1px solid rgba(255, 245, 220, 0.05);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    filter 0.25s ease,
    background 0.25s ease;
}

.ct-map-card:hover {
  transform: translateY(-2px);
  border-color: rgba(220, 166, 48, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 179, 0.05),
    0 14px 28px rgba(0, 0, 0, 0.24);
}

.ct-map-card.is-active {
  border-color: rgba(225, 181, 84, 0.78);
  background: linear-gradient(180deg, rgba(58, 44, 20, 0.98) 0%, rgba(22, 18, 13, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 179, 0.12),
    0 0 0 1px rgba(220, 166, 48, 0.24),
    0 16px 30px rgba(0, 0, 0, 0.24);
  opacity: 1;
  transform: scale(1);
  filter: none;
}

.ct-map-card.is-dimmed {
  opacity: 0.45;
  transform: scale(0.985);
  filter: saturate(0.85);
}

.ct-map-card-top {
  margin-bottom: 8px;
}

.ct-map-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(242, 211, 129, 0.16) 0%, rgba(171, 121, 28, 0.14) 100%);
  border: 1px solid rgba(224, 177, 75, 0.28);
  color: #f0d287;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 235, 186, 0.08);
}

.ct-map-card-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1rem;
  line-height: 1.35;
}

.ct-map-card-address {
  margin: 0 0 8px;
  color: var(--ct-text-muted);
  font-size: 0.93rem;
}

.ct-map-card-price {
  margin: 0 0 12px;
  background: linear-gradient(180deg, var(--ct-gold-1) 0%, var(--ct-gold-3) 55%, var(--ct-gold-4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1rem;
  font-weight: 700;
}

.ct-map-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ct-map-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #1d1a18 0%, #141312 100%);
  color: #f1f1f1;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.22s ease;
}

.ct-map-card-btn:hover {
  background: linear-gradient(180deg, #26221d 0%, #181614 100%);
  color: #fff;
}

.ct-map-card-btn-primary {
  border-color: rgba(176, 129, 28, 0.55);
  background: linear-gradient(
    180deg,
    #f8e7b7 0%,
    #ebcc72 18%,
    #d6ad3c 52%,
    #b8841f 100%
  );
  color: #5f4a12;
  box-shadow:
    inset 0 2px 0 rgba(255, 248, 226, 0.55),
    inset 0 -1px 0 rgba(142, 98, 16, 0.25),
    0 8px 16px rgba(0, 0, 0, 0.14);
}

/* =========================
   MAPA
========================= */

.ct-map-main {
  min-width: 0;
}

.ct-map-wrap {
  position: relative;
}

.ct-map-box {
  width: 100%;
  height: 560px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(214, 166, 71, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 227, 150, 0.04),
    0 18px 40px rgba(0, 0, 0, 0.24);
  background: linear-gradient(180deg, var(--ct-dark-2) 0%, var(--ct-dark-3) 100%);
}

#ct-map-all .maplibregl-canvas {
  border-radius: 22px;
}

.maplibregl-ctrl-group {
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.maplibregl-ctrl button {
  width: 34px;
  height: 34px;
}

.maplibregl-popup-content {
  border-radius: 16px;
  padding: 12px 14px;
}

.ct-map-overlay-note {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(40, 31, 20, 0.92) 0%, rgba(18, 16, 14, 0.94) 100%);
  color: #f6ecd6;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid rgba(220, 166, 48, 0.18);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ct-map-overlay-note.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

/* =========================
   POPUP
========================= */

.ct-map-popup {
  font-size: 14px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ct-map-popup strong {
  color: #111;
}

.ct-map-price {
  font-weight: 700;
  color: #b88925;
}

.ct-map-popup a {
  color: #b88925;
  font-weight: 700;
  text-decoration: none;
}

.ct-map-popup a:hover {
  color: #d9a93d;
  text-decoration: underline;
}

/* =========================
   BOTÓN SINGLE LISTING
========================= */

.ct-single-listing-map-btn-wrap {
  margin: 14px 0 18px;
  display: flex;
  justify-content: center;
}

.ct-single-listing-map-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 230px;
  height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  text-decoration: none;
  background: linear-gradient(180deg, var(--ct-gold-1) 0%, var(--ct-gold-3) 50%, var(--ct-gold-4) 100%);
  color: #14110d !important;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid rgba(220, 166, 48, 0.38);
  transition:
    width 0.28s ease,
    border-radius 0.28s ease,
    transform 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 211, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.ct-single-listing-map-btn:hover {
  width: 150px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fae8b8 0%, #e1af3f 50%, #c2861c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 228, 0.34),
    0 12px 22px rgba(0, 0, 0, 0.18);
}

.ct-single-listing-map-btn__text,
.ct-single-listing-map-btn__icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.22s ease, transform 0.25s ease;
}

.ct-single-listing-map-btn__text {
  opacity: 1;
  transform: scale(1);
  white-space: nowrap;
}

.ct-single-listing-map-btn__icon {
  opacity: 0;
  transform: scale(0.65);
  font-size: 22px;
  text-align: center !important;
  align-content: center !important;
  justify-content: center !important;
  line-height: 1;
  font-variation-settings:
    'FILL' 0,
    'wght' 500,
    'GRAD' 0,
    'opsz' 24;
}

.ct-single-listing-map-btn:hover .ct-single-listing-map-btn__text {
  opacity: 0;
  transform: scale(0.85);
}

.ct-single-listing-map-btn:hover .ct-single-listing-map-btn__icon {
  opacity: 1;
  transform: scale(1);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1024px) {
  .ct-map-layout {
    grid-template-columns: 1fr;
  }

  .ct-map-sidebar {
    min-height: auto;
    max-height: none;
  }

  .ct-map-list {
    max-height: 320px;
  }
}

@media (max-width: 768px) {
  .ct-map-box {
    height: 400px;
  }

  .ct-map-title {
    font-size: 1.5rem;
  }

  .ct-map-overlay-note {
    max-width: calc(100% - 20px);
    white-space: normal;
    text-align: center;
    border-radius: 18px;
  }

  .ct-single-listing-map-btn {
    width: 210px;
  }
}


.ct-map-search {
  margin-bottom: 14px;
}

.ct-map-search-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(214, 166, 71, 0.24);
  background: linear-gradient(180deg, rgba(30, 24, 18, 0.98) 0%, rgba(18, 15, 13, 0.98) 100%);
  color: #f4ead4;
  font-size: 0.95rem;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 229, 165, 0.04);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.ct-map-search-input::placeholder {
  color: rgba(244, 234, 212, 0.52);
}

.ct-map-search-input:focus {
  border-color: rgba(225, 181, 84, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 179, 0.06),
    0 0 0 3px rgba(220, 166, 48, 0.08);
  background: linear-gradient(180deg, rgba(34, 27, 19, 0.98) 0%, rgba(20, 16, 13, 0.98) 100%);
}

.ct-map-empty {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(214, 166, 71, 0.16);
  background: linear-gradient(180deg, rgba(33, 26, 18, 0.98) 0%, rgba(18, 15, 13, 0.98) 100%);
  color: #d8ccb0;
  font-size: 0.92rem;
  text-align: center;
}