/* ============================================================
   Rentals — listing grid + detail page
   Colors: primary #D46960 | secondary #112945 | tertiary #5BB691
   Font: Poppins (loaded globally via theme)
   ============================================================ */

/* ---------- Layout ---------- */

.rentals-page {
  background: #f5f6f8;
  min-height: 60vh;
  padding-bottom: 4rem;
}

/* ---------- Filter bar ---------- */

.rentals-filters {
  background: #112945;
  padding: 1.25rem 1rem;
  top: 136px;
  z-index: 40;
}

.rentals-filters .filters-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
  align-items: center;
}

.rentals-filters input[type="text"],
.rentals-filters select {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: 6px;
  padding: .45rem .75rem;
  font-family: inherit;
  font-size: .875rem;
  outline: none;
  transition: border-color .2s, background .2s;
  min-width: 0;
}

.rentals-filters input[type="text"]::placeholder { color: rgba(255,255,255,.6); }
.rentals-filters select option { color: #111; background: #fff; }
.rentals-filters input[type="text"]:focus,
.rentals-filters select:focus {
  border-color: #D46960;
  background: rgba(255,255,255,.2);
}

.filters-search { flex: 1 1 200px; }
.filters-select { flex: 1 1 130px; }

.rentals-filters .filter-sort {
  margin-left: auto;
  flex: 0 0 auto;
}

.rentals-count {
  color: rgba(255,255,255,.75);
  font-size: .8rem;
  padding: .4rem .6rem;
  white-space: nowrap;
}

.btn-clear-filters {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: rgba(255,255,255,.8);
  border-radius: 6px;
  padding: .45rem .9rem;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-clear-filters:hover { border-color: #D46960; color: #D46960; }

/* ---------- Grid ---------- */

.rentals-grid {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .rentals-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .rentals-grid { grid-template-columns: 1fr; gap: 1rem; }
  .rentals-filters .filters-inner { gap: .5rem; }
}

/* ---------- Card ---------- */

.listing-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}

.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
}

.listing-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.listing-card__photo {
  position: relative;
  padding-top: 62%;
  overflow: hidden;
  background: #e8ecf0;
}

.listing-card__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.listing-card:hover .listing-card__photo img { transform: scale(1.04); }

.card-badge {
  position: absolute;
  top: .625rem;
  left: .625rem;
  background: #D46960;
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 4px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.card-badge--new {
  top: 2.4rem;
  left: .625rem;
  background: #5BB691;
}

.card-badge--pet {
  top: auto;
  bottom: .625rem;
  left: .625rem;
  background: rgba(17,41,69,.85);
  font-size: .75rem;
  padding: .25rem .55rem;
}

.card-media-badges {
  position: absolute;
  top: .625rem;
  right: .625rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .35rem;
}

.card-media-badge {
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  padding: .2rem .5rem;
  border-radius: 4px;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  gap: .3rem;
  backdrop-filter: blur(2px);
}
.card-media-badge i { font-size: .75rem; }

.listing-card__body {
  padding: 1rem 1.1rem .75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.listing-card__price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #D46960;
  letter-spacing: -.01em;
  line-height: 1;
}
.listing-card__price span {
  font-size: .85rem;
  font-weight: 400;
  color: #666;
}

.listing-card__address {
  font-size: .82rem;
  color: #444;
  line-height: 1.4;
}

.listing-card__meta {
  display: flex;
  gap: .75rem;
  font-size: .8rem;
  color: #555;
  flex-wrap: wrap;
}
.listing-card__meta i { color: #112945; margin-right: .3rem; }

.listing-card__title {
  font-size: .83rem;
  color: #112945;
  font-weight: 600;
  margin-top: .15rem;
  line-height: 1.35;
}

.listing-card__avail {
  font-size: .77rem;
  color: #5BB691;
  font-weight: 600;
  margin-top: auto;
  padding-top: .35rem;
}

.listing-card__footer {
  padding: .75rem 1.1rem;
  border-top: 1px solid #f0f0f0;
}

.btn-rentals {
  display: inline-block;
  background: #112945;
  color: #fff;
  padding: .5rem 1.1rem;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .2s;
}
.listing-card:hover .btn-rentals { background: #D46960; }

/* ---------- No results ---------- */

.rentals-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: #666;
}
.rentals-empty i { font-size: 3rem; color: #ccc; margin-bottom: 1rem; display: block; }

/* ============================================================
   Detail Page
   ============================================================ */

.detail-page { background: #fff; }

/* Gallery */
.detail-gallery-wrap {
  background: #111;
  position: relative;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .detail-gallery-wrap {
    width: 90%;
  }
}
@media (min-width: 1024px) {
  .detail-gallery-wrap {
    width: 70%;
  }
}
@media (min-width: 1280px) {
  .detail-gallery-wrap {
    width: 60%;
  }
}
.detail-gallery .owl-item img {
  width: auto !important;
  height: 420px;
  object-fit: cover;
  justify-self: center;
}

@media (max-width: 767px) {
  .detail-gallery .owl-item img {
    height: 280px;
  }
}

/* Thumbnail strip */
.gallery-thumbs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  padding: 4px;
  background: #111;
  scrollbar-width: thin;
  scrollbar-color: #444 #111;
}

.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-track { background: #111; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

.gallery-thumb {
  flex: 0 0 100px;
  cursor: pointer;
  overflow: hidden;
  opacity: .55;
  transition: opacity .2s;
  aspect-ratio: 4/3;
}

.gallery-thumb.active,
.gallery-thumb:hover {
  opacity: 1;
  outline: 2px solid #D46960;
  outline-offset: -2px;
}

.gallery-thumb img {
  width: auto;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-counter {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .8rem;
  padding: .3rem .7rem;
  border-radius: 20px;
  pointer-events: none;
}

/* Owl nav overrides */
.detail-gallery .owl-nav button {
  position: absolute !important;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.45) !important;
  color: #fff !important;
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  font-size: 1.1rem !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.detail-gallery .owl-nav button:hover { background: #D46960 !important; }
.detail-gallery .owl-nav .owl-prev { left: .75rem; }
.detail-gallery .owl-nav .owl-next { right: .75rem; }

/* Layout */
.detail-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .detail-body { grid-template-columns: 1fr; }
  .detail-sidebar { position: static !important; }
}

/* Main column */
.detail-main .detail-address {
  font-size: 1.6rem;
  font-weight: 700;
  color: #112945;
  margin-bottom: .25rem;
  line-height: 1.2;
}

.detail-main .detail-subtitle {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1rem;
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: #D46960;
  letter-spacing: -.02em;
}
.detail-price span { font-size: 1rem; font-weight: 400; color: #666; }

.detail-avail {
  font-size: .9rem;
  color: #5BB691;
  font-weight: 600;
}

.detail-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  font-size: .95rem;
  color: #444;
}
.detail-meta i { color: #112945; margin-right: .4rem; }

/* Sections */
.detail-section {
  margin-bottom: 2rem;
}

.detail-section h3 {
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #112945;
  font-weight: 700;
  border-bottom: 2px solid #D46960;
  padding-bottom: .4rem;
  margin-bottom: 1rem;
}

.detail-section .description-text {
  font-size: .92rem;
  line-height: 1.75;
  color: #444;
}

/* Iframe wrappers — responsive 16:9 */
.iframe-wrap {
  position: relative;
  padding-top: 56.25%;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  margin-bottom: 1rem;
}
.iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Map */
.listing-map-container {
  z-index: 0;
  height: 380px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.map-pin {
  width: 22px;
  height: 22px;
  background: #D46960;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.map-link { font-size: .8rem; text-align: right; margin-top: .5rem; margin-bottom: .5rem; }
.map-link a { color: #888; text-decoration: none; }
.map-link a:hover { color: #D46960; }

/* Sidebar */
.detail-sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-card {
  background: #f8f9fb;
  border: 1px solid #e5e8ed;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.sidebar-card h4 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #112945;
  font-weight: 700;
  margin-bottom: .75rem;
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .45rem 0;
  border-bottom: 1px solid #ececec;
  font-size: .875rem;
  color: #444;
}
.sidebar-row:last-child { border-bottom: none; }
.sidebar-row .label { color: #777; }
.sidebar-row .value { font-weight: 600; color: #112945; }

.sidebar-amenities-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .83rem;
  color: #444;
}
.sidebar-amenities-list li {
  padding: .3rem 0;
  padding-left: 1.1rem;
  position: relative;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.4;
}
.sidebar-amenities-list li:last-child { border-bottom: none; }
.sidebar-amenities-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .55rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5BB691;
}

.sidebar-pet {
  font-size: .85rem;
  padding: .35rem 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #444;
}
.sidebar-pet i { width: 1.2rem; text-align: center; }
.pet-ok { color: #5BB691; }
.pet-no { color: #D46960; }

/* CTA buttons */
.btn-apply {
  display: block;
  width: 100%;
  text-align: center;
  background: #D46960;
  color: #fff;
  padding: .8rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
  transition: background .2s;
  margin-bottom: .6rem;
}
.btn-apply:hover { background: #b55851; color: #fff; }
.btn-apply--disabled {
  background: #e0e0e0;
  color: #888;
  cursor: not-allowed;
  pointer-events: none;
  border: 1px dashed #bbb;
}
.btn-apply-note {
  font-size: .8rem;
  color: #888;
  text-align: center;
  margin: -.2rem 0 .6rem;
}

.btn-tour {
  display: block;
  width: 100%;
  text-align: center;
  background: transparent;
  color: #112945;
  border: 2px solid #112945;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
  transition: all .2s;
  margin-bottom: .6rem;
}
.btn-tour:hover { background: #112945; color: #fff; }

.contact-info { font-size: .875rem; color: #555; text-align: center; margin-top: .75rem; }
.contact-info a { color: #112945; font-weight: 600; text-decoration: none; }
.contact-info a:hover { color: #D46960; }

/* Share */
.detail-share {
  display: flex;
  gap: .6rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .8rem;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .2s;
}
.share-btn:hover { opacity: .8; }
.share-btn--fb { background: #1877F2; color: #fff; }
.share-btn--tw { background: #1DA1F2; color: #fff; }
.share-btn--email { background: #555; color: #fff; }

/* ── Intro text (all-rentals) ── */
.rentals-intro {
    max-width: 860px;
    margin: 1.5rem auto .25rem;
    padding: 0 1rem;
    text-align: center;
    color: #555;
    font-size: .9rem;
    line-height: 1.65;
}

/* ── Disclaimer (listing-detail) ── */
.detail-disclaimer {
    max-width: 900px;
    margin: 2rem auto 0;
    padding: .75rem 1rem;
    background: #f8f8f8;
    border-left: 3px solid #D46960;
    color: #666;
    font-size: .85rem;
    line-height: 1.6;
}

/* ============================================================
   All-rentals: Split view (map + results)
   ============================================================ */

[x-cloak] { display: none !important; }

/* Map toggle button — always visible in filter bar */
.btn-map-toggle {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.85);
  border-radius: 6px;
  padding: .45rem .85rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  flex: 0 0 auto;
}
.btn-map-toggle:hover { border-color: #D46960; color: #D46960; }

/* Outer layout: map col + results col */
.rentals-layout {
  display: grid;
  grid-template-columns: minmax(340px, 42%) 1fr;
  gap: 1.25rem;
  max-width: 1440px;
  margin: 1.5rem auto 0;
  padding: 0 1rem 3rem;
  align-items: start;
}

/* Map column — sticky below header + filter bar */
.rentals-map-col {
  position: sticky;
  z-index: 0;
  top: 220px;
  height: calc(100vh - 230px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  background: #e8ecf0;
}

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

/* Reset map button — floats inside map bottom-right */
.map-reset-btn {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #fff;
  color: #112945;
  border: 1px solid #dde2ea;
  border-radius: 20px;
  padding: .4rem 1rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: all .2s;
  white-space: nowrap;
}
.map-reset-btn:hover { background: #D46960; color: #fff; border-color: #D46960; }

/* Results column */
.rentals-results-col { min-width: 0; }

/* When map is hidden, results span full width */
.rentals-results-col.full-width { grid-column: 1 / -1; }

/* Grid inside results col: 2 cols (narrower space) */
.rentals-results-col .rentals-grid {
  max-width: none;
  margin-top: 0;
  padding: 0;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

/* Card highlight on pin click */
.card-highlight {
  outline: 3px solid #D46960;
  outline-offset: 2px;
  border-radius: 10px;
}

/* When map hidden: results revert to wide 3-col grid (desktop only) */
@media (min-width: 901px) {
  .rentals-results-col.full-width .rentals-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* ── Responsive ── */

@media (max-width: 1100px) {
  .rentals-results-col .rentals-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .rentals-layout {
    grid-template-columns: 1fr;
    padding: 0 .75rem 3rem;
    margin-top: 1rem;
  }

  .rentals-map-col {
    position: relative;
    top: auto;
    height: 320px;
    border-radius: 10px;
  }

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

@media (max-width: 600px) {
  .rentals-results-col .rentals-grid { grid-template-columns: 1fr; gap: 1rem; }
  .rentals-map-col { height: 260px; }
}
