/* project-hero-swiper */
#primary {
    overflow-x: clip;
}

.project-hero-swiper {
    position: absolute;
    inset: 0;
}

.project-hero-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* legal-swiper */
.legal-swiper {
    margin-bottom: 2.5rem;
    overflow: hidden !important;
}

.legal-swiper .swiper-wrapper {
    will-change: transform;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.legal-swiper .swiper-slide {
    transform: translate3d(0, 0, 0);
    /* Force GPU */
}

.legal-swiper .swiper-slide img {
    max-height: 70vh;
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

.project-hero-swiper .swiper-wrapper {
    will-change: transform;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Upgraded Modules Styles */
.lhag-fp-tab {
    will-change: transform, background-color;
}

.lhag-fp-content {
    backface-visibility: hidden;
    perspective: 1000px;
}

/*
 * Keep Swiper's intrinsic width from expanding its CSS Grid item on iOS/iPadOS.
 * Without min-width: 0 the floor-plan carousel can grow to Chrome/WebKit's
 * maximum layout width and make the whole page appear zoomed out/unresponsive.
 */
#mat-bang .grid,
#mat-bang .grid > *,
#mat-bang .group\/fp,
#mat-bang .group\/fp > *,
#mat-bang .fp-gallery-swiper {
    min-width: 0;
    max-width: 100%;
}

#mat-bang .fp-gallery-swiper {
    width: 100%;
    touch-action: pan-y;
}

#mat-bang [data-glightbox] {
    touch-action: manipulation;
}

/* Payment schedule: cards on mobile/tablet, data table on desktop. */
@media (max-width: 1023px) {
    .payment-schedule-scroll {
        overflow: visible;
    }

    .payment-schedule-table,
    .payment-schedule-table tbody,
    .payment-schedule-table tfoot,
    .payment-schedule-table tr,
    .payment-schedule-table td {
        display: block;
        width: 100%;
    }

    .payment-schedule-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .payment-schedule-table tbody {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.75rem;
        background: #f8fafc;
    }

    .payment-schedule-table tbody tr {
        min-width: 0;
        overflow: hidden;
        border: 1px solid #e2e8f0;
        border-radius: 1rem;
        background: #ffffff;
        box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
    }

    .payment-schedule-table tbody td {
        min-width: 0;
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #f1f5f9;
        text-align: left !important;
        font-size: 0.875rem;
        line-height: 1.55;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .payment-schedule-table tbody td:last-child {
        border-bottom: 0;
    }

    .payment-schedule-table tbody td::before {
        display: block;
        margin-bottom: 0.25rem;
        color: #94a3b8;
        font-family: 'Montserrat', system-ui, sans-serif;
        font-size: 0.625rem;
        font-weight: 800;
        line-height: 1.4;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .payment-schedule-table tbody td:nth-child(1)::before {
        content: "Đợt thanh toán";
    }

    .payment-schedule-table tbody td:nth-child(2)::before {
        content: "Giai đoạn / Thời điểm";
    }

    .payment-schedule-table tbody td:nth-child(3)::before {
        content: "Tỷ lệ thanh toán";
    }

    .payment-schedule-table tbody td:nth-child(4)::before {
        content: "Hồ sơ pháp lý & Ghi chú";
    }

    .payment-schedule-table tbody td:nth-child(1),
    .payment-schedule-table tbody td:nth-child(3) {
        font-size: 1rem;
        font-weight: 800;
    }

    .payment-schedule-table tfoot {
        padding: 0 0.75rem 0.75rem;
        background: #f8fafc;
    }

    .payment-schedule-table tfoot tr {
        overflow: hidden;
        border: 1px solid #d6dee9;
        border-radius: 1rem;
        background: #eef2f7;
    }

    .payment-schedule-table tfoot td {
        padding: 0.65rem 1rem !important;
        text-align: left !important;
        line-height: 1.5;
    }

    .payment-schedule-table tfoot td:first-child {
        padding-bottom: 0 !important;
    }

    .payment-schedule-table tfoot td:nth-child(2) {
        color: #8c6a22;
        font-size: 1rem;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .payment-schedule-table tbody {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    #mat-bang .fp-desc-box {
        padding: 1.25rem;
    }

    #mat-bang .fp-gallery-swiper .swiper-slide {
        width: 100%;
    }
}

#nha-mau img {
    will-change: transform;
}

@media (max-width: 1023px) {
    #nha-mau .auto-rows-\[300px\] {
        grid-auto-rows: 250px;
    }
}

[data-reveal="left"] {
    transform: translate3d(-40px, 0, 0);
}

[data-reveal="right"] {
    transform: translate3d(40px, 0, 0);
}

[data-reveal="bottom"] {
    transform: translate3d(0, 40px, 0);
}

@media (max-width: 767px) {
    [data-reveal="left"],
    [data-reveal="right"] {
        transform: translate3d(0, 32px, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal="left"],
    [data-reveal="right"],
    [data-reveal="bottom"] {
        transform: none;
    }
}
