/* ==========================================================================
   Latest Properties Section
   ========================================================================== */

.latest-properties-section {
    padding: 80px 20px;
    background-color: #ffffff;
}

.properties-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header & Controls Layout */
.properties-header-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 40px;
}

.properties-subtitle {
    color: #6366f1;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.properties-title {
    color: #eab308; /* Bright yellow main heading */
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0 0 12px 0;
}

.properties-description {
    color: #94a3b8;
    font-size: 0.95rem;
    max-width: 480px;
    margin: 0;
    line-height: 1.5;
}

/* Navigation Arrow Controls */
.properties-nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prop-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.prop-arrow-next {
    background: #eab308; /* Yellow highlighted active arrow */
    color: #000000;
}

.prop-arrow:hover {
    transform: translateY(-2px);
}

/* Swiper Carousel & Property Cards */
.properties-swiper {
    overflow: hidden;
    padding-bottom: 10px;
}

.property-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.property-card:hover {
    transform: translateY(-6px);
}

/* Image Thumbnail Container */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Popular Badge Pill */
.badge-popular {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: #ffe4e6;
    color: #f43f5e;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Content Details */
.card-content {
    padding: 16px 4px 0 4px;
}

.card-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.card-type {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    margin: 0 0 2px 0;
}

.card-address {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0 0 12px 0;
}

/* Beds & Baths Specs Footer */
.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .properties-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .properties-title {
        font-size: 1.75rem;
    }
}


/* ==========================================================================
   Light-Blue Custom Property Card Design
   ========================================================================== */

.property-card {
    background: #eef7ff; /* Soft light-blue background matching reference */
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Image Wrapper */
.card-image-wrapper {
    width: 100%;
    height: 220px;
    border-radius: 10px;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Text Content Stack */
.card-content {
    padding: 14px 6px 6px 6px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.card-address {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 500;
}

.card-description {
    font-size: 0.88rem;
    color: #475569;
    margin: 0 0 24px 0;
    line-height: 1.4;
}

/* Approvals & Tags Row */
.card-approvals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.approvals-label {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.approvals-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: 60%;
    color: #101011;
}

.tag-pill {
    background: #000000;
    color: #fbfbfb;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ==========================================================================
   Card Layout & Anti-Stretching Rules
   ========================================================================== */

/* 1. Prevent Swiper slides from auto-expanding to fill empty space */
.properties-swiper .swiper-wrapper {
    display: flex;
    justify-content: flex-start; /* Aligns cards to the left when < 4 cards */
}

.properties-swiper .swiper-slide {
    height: auto; /* Keeps cards uniform in height */
    /* Width calculation based on 4 columns with 24px gaps */
    max-width: calc((100% - (3 * 24px)) / 4); 
    box-sizing: border-box;
}

/* 2. Responsive max-width adjustments for smaller breakpoints */
@media (max-width: 1199px) {
    .properties-swiper .swiper-slide {
        max-width: calc((100% - (2 * 24px)) / 3); /* 3 cards max */
    }
}

@media (max-width: 991px) {
    .properties-swiper .swiper-slide {
        max-width: calc((100% - 20px) / 2); /* 2 cards max */
    }
}

@media (max-width: 639px) {
    .properties-swiper .swiper-slide {
        max-width: 100%; /* 1 card on mobile */
    }
}

/* 3. Ensure card fills its slide wrapper cleanly */
.property-card {
    background: #eef7ff;
    border-radius: 16px;
    padding: 12px;
    height: 100%; /* Equal height cards */
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ==========================================
   Latest Properties Animations & Styling
========================================== */

/* Base Section Styling */
.latest-properties-section {
    padding: 60px 0;
    overflow: hidden;
}

.property-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* Image Container Zoom Animation */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.property-card:hover .card-image-wrapper img {
    transform: scale(1.08); /* Smooth image zoom */
}

/* Subtly darken image on hover */
.card-image-wrapper .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.property-card:hover .image-overlay {
    opacity: 1;
}

/* Navigation Arrows Transition */
.prop-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background-color 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.prop-arrow:hover {
    background: #1e40af;
    color: #ffffff;
    border-color: #1e40af;
    transform: scale(1.08);
}

.prop-arrow:active {
    transform: scale(0.95);
}

/* ==========================================
   Scroll-Driven Entry Animations
========================================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Triggered by JS IntersectionObserver */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delay swiper slide entry slightly after header */
.properties-swiper.animate-on-scroll.is-visible {
    transition-delay: 0.15s;
}