/* =========================
   CARD
========================= */
.prop-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: 0.25s ease;

  display: flex;
  flex-direction: column;
  height: 100%;
}

.prop-card:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}


/* =========================
   IMAGE
========================= */
.img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f5f5f5;
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Status Badge on Card */
.status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  z-index: 2;
}

.status-active {
  background: #4caf50;
  color: white;
}

.status-closed {
  background: #f44336;
  color: white;
}

/* =========================
   BODY
========================= */
.prop-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.prop-body h3 {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.price {
  font-size: 25px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

/* Property Details Icons */
.prop-details {
  display: flex;
  gap: 12px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #555;
  background: #f5f5f5;
  padding: 4px 10px;
  border-radius: 20px;
}

.detail-item i {
  font-size: 12px;
  color: var(--primary);
}

/* =========================
   BUTTONS
========================= */
.btn-group {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.card_Btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  border: none;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* WhatsApp */
.whatsapp-btn {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: #fff;
}

.whatsapp-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Enquiry */
.enquiry-btn {
  background: var(--primary);
  color: #fff;
}

.enquiry-btn:hover {
  opacity: 0.9;
}

/* Know more */
.know-more {
  background: #f3f3f3;
}

/* =========================
   POPUP BASE
========================= */
.popup {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999;

  justify-content: center;
  align-items: center;
}

.popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
}

/* =========================
   POPUP CONTENT (PC)
========================= */
.popup-content {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 14px;

  width: 90%;
  max-width: 900px;
  max-height: 85vh;

  display: flex;
  flex-direction: column;

  overflow: hidden;
  animation: popupFade 0.25s ease;
}

/* PC VIEW - FIXED BODY WITH SCROLL ONLY FOR CONTENT SECTION */
.popup-body {
  display: flex;
  overflow-y: auto;
  flex: 1;
}

/* Image Wrapper for Popup */
.popup-img-wrapper {
  position: relative;
  width: 45%;
}

/* IMAGE LEFT - WITH MARGIN FIX */
.popup-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  margin-top: 20px;
  margin-left: 20px;
  border-radius: 8px;
}

/* Popup Status Badge */
.popup-status-badge {
  position: absolute;
  top: 30px;
  right: 10px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

/* INFO RIGHT */
.popup-info {
  width: 60%;
  padding: 20px;
  margin-left: 12px;
}

/* BIGGER PRICE IN POPUP */
.popup-info .price {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin: 10px 0;
}

/* GRID - 2 COLUMN FOR PC */
.popup-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 12px;
  font-size: 14px;
}

/* Status text in popup grid */
.popup-grid .status-active,
.popup-grid .status-closed {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* CONTENT SECTION WITH SLIDE EFFECT */
.popup-info {
  overflow-y: auto;
  max-height: 100%;
  scroll-behavior: smooth;
}

/* Custom scrollbar for content section */
.popup-info::-webkit-scrollbar {
  width: 6px;
}

.popup-info::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.popup-info::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* ACTIONS */
.popup-actions {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #eee;
}

/* CLOSE BUTTON - SMALLER FOR PC */
.close {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 3;
}

.close:hover {
  background: rgba(0,0,0,0.8);
  transform: scale(1.05);
}

/* =========================
   MOBILE (REAL POPUP FIX - NO HORIZONTAL SCROLL)
========================= */
@media (max-width: 768px) {

  .popup-content {
    width: 85%;
    max-width: 85%;
    height: auto;
    max-height: 85vh;
    border-radius: 20px;
    margin: 20px;
    overflow: hidden;
  }

  /* STACK EVERYTHING - NO HORIZONTAL SCROLL */
  .popup-body {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Image wrapper full width on mobile */
  .popup-img-wrapper {
    width: 100%;
    flex-shrink: 0;
  }

  /* SMALLER IMAGE */
  .popup-img {
    width: calc(100% - 32px);
    aspect-ratio: 4 / 5;
    object-fit: cover;
    margin: 16px 16px 0 16px;
    border-radius: 12px;
  }

  /* Popup status badge on mobile */
  .popup-status-badge {
    top: 26px;
    right: 26px;
    padding: 5px 10px;
    font-size: 11px;
  }

  /* DETAILS SCROLL AREA - NO HORIZONTAL SCROLL WHATSOEVER */
  .popup-info {
    width: 100%;
    padding: 16px;
    overflow-y: visible;
    overflow-x: hidden;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* MOBILE: LINE BY LINE STRUCTURE - ABSOLUTELY NO SCROLLING SIDEWAYS */
  .popup-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .popup-grid p {
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    gap: 8px;
  }

  .popup-grid p strong {
    font-weight: 600;
    color: #333;
    min-width: 100px;
    flex-shrink: 0;
  }

  /* PRICE SIZE ON MOBILE */
  .popup-info .price {
    font-size: 24px;
    margin: 8px 0;
  }

  /* Property details on mobile */
  .prop-details {
    gap: 8px;
  }
  
  .detail-item {
    font-size: 12px;
    padding: 3px 8px;
  }

  /* BUTTONS LIFTED UP - NOT FIXED ANYMORE */
  .popup-actions {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    background: #fff;
    border-top: 1px solid #eee;
    border-radius: 0 0 20px 20px;
    padding: 16px;
    gap: 10px;
    margin-top: auto;
    flex-shrink: 0;
  }

  .popup-actions .btn {
    font-size: 14px;
    padding: 12px;
  }

  /* BETTER VISIBLE CLOSE BUTTON ON MOBILE */
  .close {
    right: 12px;
    top: 12px;
    font-size: 20px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }

  /* Ensure background page is visible */
  .popup-overlay {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
  }
}

/* =========================
   EXTRA SMALL DEVICES
========================= */
@media (max-width: 480px) {
  .popup-content {
    width: 92%;
    max-width: 92%;
    max-height: 90vh;
    margin: 10px;
  }

  .popup-img {
    margin: 12px 12px 0 12px;
  }

  .popup-status-badge {
    top: 22px;
    right: 22px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .popup-info .price {
    font-size: 22px;
  }

  .popup-grid {
    gap: 8px;
    font-size: 13px;
  }

  .popup-grid p {
    padding: 6px 0;
  }

  .popup-grid p strong {
    min-width: 90px;
    font-size: 13px;
  }

  .close {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .prop-details {
    gap: 6px;
  }

  .detail-item {
    font-size: 11px;
    padding: 3px 6px;
  }

  .detail-item i {
    font-size: 10px;
  }
}

/* =========================
   ANIMATION
========================= */
@keyframes popupFade {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}