/* ===================================
   WEJHA - Shopping Centers (Malls) Section
   =================================== */

.malls {
    position: relative;
    width: 100%;
    padding: 100px 0 120px 0;
    background: #ffffff; /* White background */
    color: #333;
    z-index: 5;
    overflow: hidden;
}

/* Full Width Header on top */
.malls .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

.malls .section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header-right {
    text-align: right !important;
}

.section-header-right .section-badge {
    margin: 0 0 16px auto !important;
}

.section-header-right .section-title-line {
    justify-content: flex-start !important;
    margin-top: 14px !important;
}

.section-header-right .section-subtitle {
    margin: 10px 0 0 auto !important;
}

/* Split-Screen Container */
.malls-split {
    display: flex;
    gap: 40px;
    align-items: stretch;
    min-height: 600px;
}

/* --- Left Side: Typography List --- */
.malls-content {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    z-index: 2;
}

.malls-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mall-item {
    cursor: pointer;
    position: relative;
    padding: 15px 20px;
    opacity: 0.6;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: right center;
    border-radius: 12px;
    background: transparent;
}

.mall-name {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: inherit; /* Use default site font */
    margin: 0;
    position: relative;
    display: inline-block;
    transition: color 0.4s ease;
    color: #1a1a1a;
}

.mall-item.active {
    opacity: 1;
    transform: translateX(-15px);
    background: #f8f9fa; /* Slight highlight */
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.mall-item.active .mall-name {
    color: var(--clr-primary);
}

.mall-item:hover:not(.active) {
    opacity: 0.8;
    transform: translateX(-5px);
}

.mall-action {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--clr-primary);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mall-item.active .mall-action {
    opacity: 1;
    max-height: 30px;
    margin-top: 5px;
}

/* Hidden items for show more */
.mall-item.hidden-mall {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.mall-item.revealed-mall {
    max-height: 100px; /* enough to show the item */
    padding-top: 15px;
    padding-bottom: 15px;
    margin-bottom: 1.5rem; /* Matches gap of malls-list */
    opacity: 0.6;
    transform: translateX(0);
}

.mall-item.revealed-mall:hover:not(.active) {
    opacity: 0.8;
    transform: translateX(-5px);
}

.mall-item.revealed-mall.active {
    opacity: 1;
    transform: translateX(-15px);
}

.malls-actions-btn {
    margin-top: 30px;
    display: flex;
    justify-content: flex-start;
}

/* --- Right Side: Image Showcase --- */
.malls-showcase {
    flex: 0 0 55%;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.mall-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    z-index: 1;
}

.mall-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    transition: transform 6s ease-out; /* Slow cinematic zoom */
}

/* Optional soft gradient over image to make it look premium */
.mall-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.2) 0%, transparent 40%);
}

.mall-image.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.mall-image.active img {
    transform: scale(1);
}

/* Extra Malls Grid */
.malls-extra-grid {
    margin-top: 50px;
}

/* --- Mobile Responsive: Horizontal Cards --- */
@media (max-width: 992px) {
    .malls {
        padding: 80px 0;
    }

    .malls-split {
        flex-direction: column;
        gap: 20px;
    }

    .malls-showcase {
        display: none; /* Hide the split-screen image container on mobile */
    }

    .malls-content {
        padding: 0;
    }

    .malls-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 10px 5% 30px 5%;
        gap: 20px;
        -webkit-overflow-scrolling: touch;
        margin: 0 -5%; /* Break out of container */
    }

    .malls-list::-webkit-scrollbar {
        display: none;
    }

    .mall-item {
        scroll-snap-align: center;
        flex: 0 0 85vw;
        height: 400px;
        border-radius: 20px;
        overflow: hidden;
        opacity: 1;
        transform: none !important;
        padding: 0;
        background: #fff;
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        border: 1px solid rgba(0,0,0,0.05);
    }
    
    .mall-item.hidden-mall {
        max-height: none;
        margin-right: 20px;
        opacity: 1;
        flex: 0 0 85vw;
        border: 1px solid rgba(0,0,0,0.05);
    }
    
    .mall-item.revealed-mall {
        max-height: none;
        margin-right: 20px;
        opacity: 1;
        flex: 0 0 85vw;
        border: 1px solid rgba(0,0,0,0.05);
    }

    .malls-actions-container {
        display: none !important; /* Hide show more button on mobile as requested */
    }

    .mall-item .mall-mobile-img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 1;
        display: block !important;
    }

    .mall-item::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 50%;
        background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
        z-index: 2;
    }

    .mall-item-content {
        position: absolute;
        bottom: 25px;
        left: 0;
        width: 100%;
        padding: 0 20px;
        z-index: 3;
        text-align: center;
    }

    .mall-name {
        font-size: 1.6rem;
        color: #fff;
        font-family: inherit;
    }

    .mall-action {
        justify-content: center;
        opacity: 1;
        max-height: none;
        margin-top: 10px;
        color: #fff;
    }
}

/* Hide mobile images on desktop */
@media (min-width: 993px) {
    .mall-mobile-img,
    .mall-item-content {
        display: none;
    }
}
