/* ════════════════════════════════════════
   unidades.css — Página de propiedades StayBaires
════════════════════════════════════════ */

/* ── Page hero header ── */
.page-hero {
  padding: 110px 0 48px;
  background: linear-gradient(135deg, var(--navy3) 0%, var(--navy2) 100%);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(239,184,16,.12) 0%, transparent 60%);
  pointer-events: none;
}
.page-hero-inner { position: relative; z-index: 2; }
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  margin-bottom: 18px;
  transition: color var(--dur) var(--ease);
}
.breadcrumb:hover { color: rgba(255,255,255,.85); }
.breadcrumb::before { content: '←'; }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 12px;
}
.page-hero h1 span { color: var(--sky4); }
.page-hero p {
  font-size: 16px;
  color: rgba(255,255,255,.7);
  font-family: var(--font-body);
}

/* ── Search / Filter bar ── */
#search-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 68px;
  z-index: 500;
  transition: box-shadow var(--dur) var(--ease);
}
#search-bar.pinned { box-shadow: var(--shadow-md); }

.search-inner {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 64px;
}

.search-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 20px;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
  position: relative;
}
.search-field:last-of-type { border-right: none; }
.search-field:hover { background: var(--bg); }

.search-field label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-heading);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 3px;
  pointer-events: none;
}
.search-field label svg { width: 11px; height: 11px; flex-shrink: 0; }

.search-field input[type="date"] {
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  outline: none;
  padding: 0;
  width: 140px;
}
.search-field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.4;
  cursor: pointer;
}

/* Guests button */
.guests-field { min-width: 180px; }
.guests-btn {
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chevron { color: var(--text3); font-size: 11px; }

/* Guests dropdown */
.guests-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  z-index: 600;
  display: none;
}
.guests-dropdown.open { display: block; }

.guest-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--bg2);
}
.guest-row:last-of-type { border-bottom: none; }
.guest-label strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.guest-label span { font-size: 12px; color: var(--text3); }

.counter {
  display: flex;
  align-items: center;
  gap: 12px;
}
.counter-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  font-family: var(--font-heading);
  line-height: 1;
}
.counter-btn:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.counter-btn:disabled { opacity: .35; cursor: default; }
.counter-val {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  min-width: 20px;
  text-align: center;
}

.guests-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--bg2);
}
.guests-footer #guests-clear {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}
.guests-footer #guests-clear:hover { color: var(--navy); }

/* Search action */
.search-action {
  display: flex;
  align-items: center;
  padding: 0 16px 0 8px;
}

/* ── Barrio chips row ── */
.barrio-chips-row {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.barrio-chips-row::-webkit-scrollbar { display: none; }

#barrio-chips {
  display: flex;
  gap: 6px;
  padding: 10px clamp(16px, 4vw, 48px);
  white-space: nowrap;
  width: max-content;
}

.barrio-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  flex-shrink: 0;
}
.barrio-chip:hover  { border-color: var(--sky4); color: var(--navy); }
.barrio-chip.active { border-color: var(--navy); background: var(--navy); color: var(--white); }
.barrio-chip.active .chip-count { background: rgba(255,255,255,.2); color: var(--white); }

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 50px;
  background: var(--bg2);
  color: var(--text3);
  font-size: 11px;
  font-weight: 700;
}

/* ── Results header ── */
.units-main {
  padding-block: 32px var(--section-py);
  min-height: 60vh;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

#results-count {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

#results-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--sky3);
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

/* ── Units grid ── */
.units-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Unit card ── */
.unit-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  cursor: default;
}
.unit-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.card-img-wrap {
  position: relative;
  height: 210px;
  overflow: hidden;
}
.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .45s var(--ease);
}
.unit-card:hover .card-img { transform: scale(1.05); }

.card-barrio-badge {
  position: absolute;
  bottom: 12px; left: 12px;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 50px;
}
.card-rating {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-rating svg, #modal-rating svg { flex-shrink: 0; }
.icon-star { width: 12px; height: 12px; fill: #F5A623; stroke: #F5A623; }
#modal-rating { display: flex; align-items: center; gap: 5px; }
#modal-rating .icon-star { width: 15px; height: 15px; }

/* Modal specs inline icons */
.modal-specs span { display: inline-flex; align-items: center; gap: 5px; }
.modal-specs svg { width: 13px; height: 13px; flex-shrink: 0; }
.card-tags {
  position: absolute;
  top: 12px; left: 12px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.card-tag {
  background: var(--sky4);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 50px;
  letter-spacing: .04em;
}

.card-body { padding: 16px 18px 20px; }
.card-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-body-lg);
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 8px;
}
.card-specs {
  display: flex;
  gap: 12px;
  font-size: var(--fs-sm);
  color: var(--text3);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.card-amenities {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-am {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text3);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
  flex-shrink: 0;
}
.card-am svg { width: 15px; height: 15px; flex-shrink: 0; }
.card-am:hover { background: var(--sky3); color: var(--sky); transform: translateY(-1px); }

/* ── Specs inline icons ── */
.card-specs span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-specs svg { width: 12px; height: 12px; flex-shrink: 0; }

.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bg2);
}
.card-price-block { display: flex; flex-direction: column; gap: 2px; }
.card-price {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  color: var(--navy);
}
.card-per { font-size: 12px; color: var(--text3); }
.card-total {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  margin-top: 2px;
}

.btn-sm {
  padding: 9px 18px !important;
  font-size: 13px !important;
}

/* ── Share button (card) ── */
.card-share-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  color: var(--navy);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  z-index: 4;
  opacity: 0;
  transform: scale(.85);
}
.unit-card:hover .card-share-btn,
.card-share-btn:focus {
  opacity: 1;
  transform: scale(1);
}
.card-share-btn:hover {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(31,64,96,.35);
}

/* ── Share toast ── */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.share-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 50px;
  box-shadow: 0 6px 24px rgba(0,0,0,.22);
  z-index: 9999;
  white-space: nowrap;
  animation: toastIn .22s var(--ease) both;
  transition: opacity .3s var(--ease);
}
.share-toast.hide { opacity: 0; }

/* No results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}
.no-results p { font-size: 16px; margin-block: 12px 20px; }

/* ════════════════════════════════════════
   MODAL
════════════════════════════════════════ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
.modal-bg.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 420px 1fr;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
  transform: translateY(20px);
  transition: transform .25s var(--ease);
}
.modal-bg.open .modal-box { transform: translateY(0); }

/* Close button */
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur) var(--ease);
}
.modal-close:hover { background: var(--red); color: var(--white); border-color: var(--red); }

/* Gallery */
.modal-gallery {
  position: relative;
  height: 100%;
  min-height: 400px;
  background: var(--navy3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#gal-main-img {
  width: 100%;
  flex: 1;
  object-fit: cover;
  object-position: center;
  transition: opacity .2s var(--ease);
}

.gal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur) var(--ease);
  z-index: 5;
  color: var(--navy);
}
.gal-arrow:hover { background: var(--white); box-shadow: var(--shadow-md); transform: translateY(-50%) scale(1.08); }
.gal-prev { left: 12px; }
.gal-next { right: 12px; }

.gal-counter {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(0,0,0,.55);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  backdrop-filter: blur(4px);
}

.gal-thumbs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0,0,0,.4);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.gal-thumbs::-webkit-scrollbar { display: none; }

.gal-thumb {
  width: 56px; height: 42px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all var(--dur) var(--ease);
  opacity: .65;
}
.gal-thumb.active { border-color: var(--sky4); opacity: 1; }
.gal-thumb:hover  { opacity: 1; }

/* Info panel */
.modal-info {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 28px 24px;
}

.modal-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.modal-barrio {
  display: inline-block;
  padding: 4px 12px;
  background: var(--sky3);
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.modal-rating {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.modal-reviews { font-weight: 400; color: var(--text3); font-size: 12px; }

.modal-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 8px;
}

.modal-specs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 14px;
}
.modal-specs span {
  background: var(--bg2);
  padding: 3px 10px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
}

.modal-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 18px;
}

.modal-amenities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-md);
}
.modal-am-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}
.modal-am-icon { display: flex; align-items: center; flex-shrink: 0; color: var(--sky); }
.modal-am-icon svg { width: 17px; height: 17px; }

/* Booking block */
.modal-booking {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-price-row { margin-bottom: 10px; }
.modal-price-num {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 24px;
  color: var(--navy);
}
.modal-price-per { font-size: 14px; color: var(--text3); margin-left: 4px; }

.modal-dates-row {
  background: var(--sky3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  flex-direction: column;
  gap: 10px;
}
.modal-dates-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--navy);
}
.modal-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,.10);
}
.modal-total-label {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text2);
}
.modal-total-amount {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  color: var(--navy);
}

.modal-ctas {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-ctas .btn {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  border-radius: var(--radius-md);
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 1024px) {
  .units-grid { grid-template-columns: repeat(2,1fr); }
  .modal-box  { grid-template-columns: 340px 1fr; max-width: 780px; }
}

@media (max-width: 768px) {
  .units-grid { grid-template-columns: 1fr; }
  .search-inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 12px;
    gap: 8px;
  }
  .search-field {
    border-right: none;
    border-bottom: 1px solid var(--border);
    width: 100%;
    padding: 10px 0;
  }
  .search-field:last-of-type { border-bottom: none; }
  .search-action { width: 100%; padding: 8px 0 0; }
  .search-action .btn { width: 100%; justify-content: center; }

  .modal-box {
    grid-template-columns: 1fr;
    grid-template-rows: 260px 1fr;
    max-height: 95vh;
    border-radius: var(--radius-lg);
  }
  .modal-gallery { min-height: 260px; }
  .modal-info { max-height: 60vh; }
  .modal-amenities { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .card-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-cta { width: 100%; justify-content: center; }
}
