/* ═══════════════════════════════════════════════════════════
   MPE Mobile Enhancement CSS
   Only loaded on screens ≤768px via <link media="(max-width:768px)">
   This file ONLY ADDS/OVERRIDES — never removes desktop styles.
   ═══════════════════════════════════════════════════════════ */

/* ─── Better Touch Targets ─────────────────────────────── */
/* Minimum 44×44px for all interactive elements (Apple HIG) */
a,
button,
.btn,
.nav-link,
.sidebar-link,
.filter-select,
.quick-link-card {
        min-height: 44px;
}

.nav-link {
        padding: 12px 16px;
        font-size: 1rem;
}

.sidebar-link {
        padding: 10px 16px;
        font-size: 0.88rem;
}

.filter-select {
        padding: 10px 34px 10px 14px;
        font-size: 0.9rem;
}

/* ─── Typography — Larger on Mobile ────────────────────── */
body {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
}

.property-title {
        font-size: 1.05rem;
        line-height: 1.35;
}

.property-location {
        font-size: 0.88rem;
}

.property-price {
        font-size: 1.15rem;
}

h1 {
        font-size: 1.5rem !important;
        line-height: 1.25;
}

h2 {
        font-size: 1.25rem;
}

h3 {
        font-size: 1.1rem;
}

/* ─── Cards — Full Width, Bigger Tap Area ──────────────── */
.card-wrap {
        width: 100%;
}

.property-card {
        border-radius: 12px;
}

.property-details {
        padding: 14px 16px;
}

/* ─── Card CTA Row — Bigger Buttons ────────────────────── */
.card-cta-row {
        display: flex;
        gap: 0;
        border-top: 1px solid var(--border);
}

.card-cta {
        flex: 1;
        padding: 13px 8px;
        font-size: 0.88rem;
        font-weight: 600;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
}

/* ─── Engagement Bar (Like + Share) ────────────────────── */
.card-engage {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 8px 16px;
        border-top: 1px solid var(--border);
}

.card-engage-btn {
        background: none;
        border: none;
        padding: 6px 8px;
        cursor: pointer;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        gap: 4px;
        color: var(--gray-600);
        transition: transform 0.2s;
        min-height: 40px;
}

.card-engage-btn:active {
        transform: scale(1.3);
}

.card-engage-btn.liked {
        color: #ef4444;
}

.card-engage-btn.liked svg {
        fill: #ef4444;
}

.card-engage-count {
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--gray-600);
}

.card-engage-spacer {
        flex: 1;
}

@keyframes heartPop {
        0% {
                transform: scale(1);
        }

        50% {
                transform: scale(1.4);
        }

        100% {
                transform: scale(1);
        }
}

.card-engage-btn.pop {
        animation: heartPop 0.3s ease;
}

/* ─── Hero — Compact on Mobile ─────────────────────────── */
.hero {
        padding: 2.5rem 1rem 2rem;
}

.hero-tag {
        font-size: 0.78rem;
        padding: 5px 14px;
        margin-bottom: 1rem;
}

.hero-subtitle {
        font-size: 0.92rem;
        margin-bottom: 1.5rem;
}

.stats-bar {
        gap: 0.8rem;
}

.stat-value {
        font-size: 1.2rem;
}

.stat-label {
        font-size: 0.7rem;
}

/* ─── Search Box — Full Width Stack ────────────────────── */
.search-box {
        flex-direction: column;
        border-radius: 12px;
        margin: 0 auto 1.5rem;
}

.search-select {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        padding: 14px;
        min-width: unset;
}

.search-input {
        padding: 14px 16px;
        font-size: 1rem;
}

.search-btn {
        padding: 14px;
        font-size: 1rem;
        border-radius: 0 0 12px 12px;
}

/* ─── Sections — Tighter Padding ───────────────────────── */
.featured-section,
.why-us-section {
        padding: 2.5rem 0.75rem;
}

.section-header {
        padding: 0 0.75rem 1.5rem;
}

.section-header h2 {
        font-size: 1.4rem;
}

/* ─── Quick Links — 2 Column Compact ───────────────────── */
.quick-links {
        padding: 2rem 0.75rem;
}

.quick-links-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
}

.quick-link-card {
        padding: 16px 12px;
        border-radius: 12px;
}

.quick-link-icon {
        font-size: 1.6rem;
        margin-bottom: 6px;
}

.quick-link-title {
        font-size: 0.88rem;
}

.quick-link-desc {
        font-size: 0.75rem;
}

/* ─── Featured Grid — Single Column + Swipe ────────────── */
.featured-grid,
.property-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 0;
}

/* ═══ Instagram-Style Image Carousel ═══════════════════════ */
.img-carousel {
        position: relative;
        width: 100%;
        overflow: hidden;
}

.img-carousel-track {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-behavior: smooth;
}

.img-carousel-track::-webkit-scrollbar {
        display: none;
}

.img-carousel-slide {
        flex: 0 0 100%;
        scroll-snap-align: start;
        aspect-ratio: 4 / 5;
        overflow: hidden;
}

.img-carousel-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
}

/* Dot indicators */
.img-carousel-dots {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 5px;
        z-index: 5;
}

.img-carousel-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        border: none;
        padding: 0;
        cursor: pointer;
        transition: all 0.25s;
}

.img-carousel-dot.active {
        background: #fff;
        width: 20px;
        border-radius: 4px;
}

/* Image counter (1/5 badge) */
.img-carousel-counter {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        padding: 3px 8px;
        border-radius: 12px;
        font-size: 0.72rem;
        font-weight: 600;
        z-index: 5;
}

/* Left/Right arrows */
.img-carousel-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.3);
        color: #fff;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 1rem;
        cursor: pointer;
        z-index: 5;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.2s;
}

.img-carousel:hover .img-carousel-arrow,
.img-carousel:active .img-carousel-arrow {
        opacity: 1;
}

.img-carousel-arrow.prev {
        left: 8px;
}

.img-carousel-arrow.next {
        right: 8px;
}

/* ─── Image Gallery — Swipe Horizontal ─────────────────── */
.gallery-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 8px;
        scrollbar-width: none;
}

.gallery-grid::-webkit-scrollbar {
        display: none;
}

.gallery-grid .gallery-card {
        flex: 0 0 85%;
        scroll-snap-align: start;
}

/* ─── Project Detail Page ──────────────────────────────── */
.proj-section {
        padding: 1.5rem 1rem;
}

.proj-section h2 {
        font-size: 1.2rem;
}

/* Tab bar — scrollable */
.proj-tabs {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        padding: 0;
}

.proj-tabs::-webkit-scrollbar {
        display: none;
}

.proj-tab {
        flex-shrink: 0;
        padding: 12px 14px;
        font-size: 0.82rem;
        white-space: nowrap;
}

/* Amenity pills — bigger touch */
.amenity-pill {
        padding: 8px 14px;
        font-size: 0.85rem;
        min-height: 40px;
}

/* Config/Pricing table — horizontal scroll */
.config-table,
.avail-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
}

/* Related projects — horizontal scroll */
.related-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 8px;
        scrollbar-width: none;
}

.related-grid::-webkit-scrollbar {
        display: none;
}

.related-grid .related-card {
        flex: 0 0 75%;
        scroll-snap-align: start;
}

/* ─── Builders Grid ────────────────────────────────────── */
.builder-grid {
        grid-template-columns: 1fr;
        gap: 12px;
}

.builder-card {
        padding: 16px;
        gap: 12px;
}

.builder-logo,
.builder-logo-placeholder {
        width: 56px;
        height: 56px;
}

.builder-name {
        font-size: 0.95rem;
}

/* ─── Filter Bar — Easier Scrolling ────────────────────── */
.filter-bar {
        padding: 10px 12px;
        gap: 8px;
}

/* ─── Breadcrumb — Smaller ─────────────────────────────── */
.breadcrumb {
        font-size: 0.78rem;
}

/* ─── CTA Section — Compact ────────────────────────────── */
.cta-section {
        padding: 3rem 1rem;
}

.cta-title {
        font-size: 1.5rem;
}

.cta-desc {
        font-size: 0.92rem;
}

.cta-actions {
        flex-direction: column;
        align-items: stretch;
}

.cta-actions .btn {
        width: 100%;
        justify-content: center;
}

/* ─── Footer — Mobile Optimized ────────────────────────── */
.footer {
        padding: 2.5rem 1rem 0;
}

.footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
}

.footer-column h4 {
        font-size: 1rem;
        margin-bottom: 10px;
        padding-bottom: 6px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-links {
        gap: 10px;
}

.footer-link {
        font-size: 0.92rem;
        padding: 4px 0;
        display: inline-flex;
        align-items: center;
        min-height: 36px;
}

/* ─── Image Optimization (Mobile) ──────────────────────── */
/* Brighter, sharper images on mobile screens — property images only */
.property-image-wrap img,
.gallery-card img,
.related-card img,
img.property-image,
.img-carousel-slide img {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 5;
        object-fit: cover;
        border-radius: 8px;
        filter: contrast(1.06) saturate(1.05);
        transition: transform 0.3s ease, filter 0.3s ease;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
}

.property-image-wrap img:hover,
.gallery-card img:hover {
        transform: scale(1.02);
}

/* Blur-up placeholder — subtle shimmer until loaded */
.property-image-wrap img[loading="lazy"],
.img-carousel-slide img[loading="lazy"] {
        background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}

/* Footer logo — keep small */
.footer-logo {
        height: 48px !important;
        width: auto !important;
        aspect-ratio: unset !important;
        filter: none !important;
}

/* ─── Skeleton Loading for Images ──────────────────────── */
@keyframes shimmer {
        0% {
                background-position: -200% 0;
        }

        100% {
                background-position: 200% 0;
        }
}

.property-image-wrap img[loading="lazy"]:not([src]),
.gallery-placeholder {
        background: linear-gradient(90deg,
                        #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
}

/* ─── Smooth Scroll Snap for Horizontal Scroll ─────────── */
.proj-card-scroll {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 14px;
        padding: 0 0 10px;
        scrollbar-width: none;
}

.proj-card-scroll::-webkit-scrollbar {
        display: none;
}

.proj-card-scroll>.card-wrap {
        flex: 0 0 85%;
        scroll-snap-align: start;
}

/* ─── Bottom Safe Area (for iPhones with notch) ────────── */
body {
        padding-bottom: max(56px, env(safe-area-inset-bottom, 56px));
}

/* ─── Prevent Horizontal Overflow ──────────────────────── */
html,
body {
        overflow-x: hidden;
}

/* ─── Smooth Animations — Reduce for Performance ───────── */
@media (prefers-reduced-motion: reduce) {
        * {
                animation-duration: 0.01ms !important;
                transition-duration: 0.01ms !important;
        }
}