:root {
  --red: #d60000;
  --red-dark: #b50000;
  --accent: #ff3d3d;
  --ink: #151515;
  --muted: #5d6470;
  --line: rgba(20, 20, 20, 0.12);
  --shadow: 0 22px 60px rgba(21, 21, 21, 0.12);
  --glow: 0 0 0 1px rgba(214, 0, 0, 0.16), 0 20px 46px rgba(214, 0, 0, 0.14);
}

.properties-hero {
  position: relative;
  min-height: 330px;
  display: grid;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.38)),
    url("https://images.unsplash.com/photo-1600607688969-a5bfcd646154?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.properties-hero-inner {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 70px 28px;
}

.properties-hero h1 {
  max-width: 850px;
  margin: 0 0 14px;
  font-size: 52px;
  line-height: 1.05;
  font-weight: 900;
}

.properties-hero nav {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.property-tools {
  padding-bottom: 42px;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(214, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.filter-panel label,
.listing-bar label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.filter-panel input,
.filter-panel select,
.listing-bar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-self: end;
}

.filter-actions button,
.card-actions a,
.card-actions button,
.pagination button,
.modal-details a {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  font-weight: 900;
}

.filter-actions button:first-child,
.card-actions a,
.modal-details a {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: 0 12px 24px rgba(214, 0, 0, 0.24);
}

.filter-actions button:last-child,
.card-actions button,
.pagination button {
  border: 1px solid rgba(214, 0, 0, 0.22);
  background: #fff5f5;
  color: var(--red);
}

.category-strip {
  margin: 22px 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.category-strip button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(214, 0, 0, 0.2);
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  font-weight: 900;
}

.category-strip button.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 12px 24px rgba(214, 0, 0, 0.2);
}

.listing-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
}

.listing-bar p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.all-property-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.listing-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.listing-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--glow);
}

.listing-image {
  position: relative;
  width: 100%;
  height: 205px;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #f4f4f4;
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.listing-card:hover .listing-image img {
  transform: scale(1.08);
}

.listing-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(214, 0, 0, 0.94);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.listing-body {
  padding: 16px;
}

.listing-body h2 {
  min-height: 46px;
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 900;
}

.listing-meta {
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.listing-price {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 18px;
  font-weight: 900;
}

.listing-description {
  min-height: 58px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-actions a,
.card-actions button {
  width: calc(50% - 5px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  text-align: center;
  font-size: 13px;
}

.pagination {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination button {
  min-width: 42px;
  padding: 0 12px;
}

.pagination button.active {
  background: var(--red);
  color: #fff;
}

.property-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.78);
}

.property-modal.open {
  display: grid;
}

.property-modal-panel {
  position: relative;
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
}

.modal-close {
  position: sticky;
  top: 14px;
  left: calc(100% - 58px);
  z-index: 4;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

.gallery-stage {
  position: relative;
  min-height: 520px;
  margin-top: -44px;
  display: grid;
  place-items: center;
  background: #f7f7f7;
}

.gallery-stage img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
}

.modal-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(214, 0, 0, 0.92);
  color: #fff;
  font-size: 34px;
}

.modal-prev {
  left: 16px;
}

.modal-next {
  right: 16px;
}

.thumbnail-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: #fff;
}

.thumbnail-strip button {
  height: 86px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f2f2f2;
}

.thumbnail-strip button.active {
  border-color: var(--red);
}

.thumbnail-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-details {
  padding: 22px;
}

.modal-details h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.detail-summary span {
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(214, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff5f5;
  color: var(--muted);
  font-size: 13px;
}

.detail-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.modal-details p {
  color: var(--muted);
  line-height: 1.65;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.detail-list strong {
  color: var(--ink);
}

.property-video-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 12px;
  margin: 20px 0;
}

.property-video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #171717;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.property-video-shell.is-vertical {
  justify-self: center;
  width: min(100%, 420px);
  aspect-ratio: 9 / 16;
}

.property-video-shell img,
.property-video-shell iframe,
.video-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.property-video-shell img {
  z-index: 1;
  object-fit: cover;
}

.video-fallback {
  z-index: 0;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.68)),
    radial-gradient(circle at 28% 20%, rgba(214, 0, 0, 0.34), transparent 34%),
    #202020;
}

.property-video-shell iframe {
  z-index: 1;
  border: 0;
}

.video-play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.72);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.video-play:hover,
.video-play:focus-visible {
  background: #ff0000;
  transform: translate(-50%, -50%) scale(1.04);
}

.video-play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 20px solid #fff;
}


.property-video-shell.playing {
  background: #000;
}

.modal-details a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 210px;
  padding: 0 18px;
}

.floating-whatsapp,
.back-top {
  position: fixed;
  z-index: 40;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
  font-weight: 900;
}

.floating-whatsapp {
  bottom: 24px;
  width: 56px;
  height: 56px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  font-size: 32px;
  transition: 0.3s ease;
}

.floating-whatsapp:hover {
  transform: scale(1.1);
}

.floating-whatsapp img{
    width:30px;
    height:30px;
    display:block;
}


@media (max-width: 1100px) {
  .filter-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .all-property-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .properties-hero h1 {
    font-size: 38px;
  }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .all-property-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .listing-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .listing-image {
    height: 160px;
  }

  .listing-body {
    padding: 12px;
  }

  .listing-body h2 {
    min-height: 48px;
    font-size: 16px;
  }

  .listing-description {
    display: none;
  }

  .card-actions {
    gap: 8px;
  }

  .card-actions a,
  .card-actions button {
    min-height: 38px;
    padding: 0 6px;
    font-size: 12px;
  }

  .gallery-stage {
    min-height: 360px;
  }

  .thumbnail-strip {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
  }

  .detail-summary,
  .detail-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .properties-hero-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .filter-actions {
    grid-template-columns: 1fr 1fr;
  }

  .listing-image {
    height: 130px;
  }

  .listing-meta {
    font-size: 12px;
  }

  .listing-price {
    font-size: 15px;
  }

  .property-modal {
    padding: 0;
  }

  .property-modal-panel {
    max-height: 100vh;
    border-radius: 0;
  }
}
