/* ═══════════════════════════════════════════════
   ZEM Panels Accordion  v4
   ═══════════════════════════════════════════════ */

/* ── Outer wrapper ──────────────────────────── */
.zem__panels-accordion {
    width: 100%;
}

/* ── Bars row ───────────────────────────────── */
.zem-pa-bars {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 720px;
    gap: 3px;
    overflow: hidden;
    align-items: stretch;
}

/* ── Individual bar ─────────────────────────── */
.zem-pa-bar {
    position: relative;
    flex: 1;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.55s cubic-bezier(0.77, 0, 0.175, 1);

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

/* Dark overlay */
.zem-pa-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    z-index: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.zem-pa-bar.is-active::before {
    background: rgba(0, 0, 0, 0.20);
}

/* Background image layer */
.zem-pa-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: center;
}

/* Zoom effect on hover */
.zem-pa-bar:not(.is-active):hover .zem-pa-bg {
    transform: scale(1.05);
}

/* ── Label (h3) — in flow, NOT absolute ─────── */
.zem-pa-label {
    /* reset browser defaults */
    margin: 0;
    padding: 0 0 20px 0;
    font-weight: 300;

    position: relative;
    z-index: 3;
    color: #fff;
    font-size: 40px;
    letter-spacing: 3px;
    text-transform: uppercase;
    line-height: 46px;
    white-space: normal;
    max-width: 100%;
    overflow: hidden;
    pointer-events: none;

    transition: opacity 0.3s ease;
}

/* Desktop: vertical writing bottom-to-top */
@media (min-width: 1025px) {
    .zem-pa-label {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        text-align: left;
        padding: 60px 0;
    }
}

/* Hide label when bar is active */
.zem-pa-bar.is-active .zem-pa-label {
    opacity: 0;
}

/* ── Inner content (Elementor nested container) ── */
.zem-pa-bar > .e-con,
.zem-pa-bar > .elementor-container,
.zem-pa-bar > .elementor-section {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 60%);

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    width: 100% !important;
    height: 100%;
}

.zem-pa-bar.is-active > .e-con,
.zem-pa-bar.is-active > .elementor-container,
.zem-pa-bar.is-active > .elementor-section {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.4s ease 0.25s;
}

/* Inner expanded image */
.zem-pa-inner-image {
    position: absolute;
    top: -60%;
    left: 0;
    right: 0;
    height: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: top 0.5s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.3s ease;
}

.zem-pa-bar.is-active .zem-pa-inner-image {
    top: 0;
    opacity: 1;
    pointer-events: auto;
    transition: top 0.5s cubic-bezier(0.77, 0, 0.175, 1) 0.1s, opacity 0.4s ease 0.1s;
}

/* ── Classic WYSIWYG content ── */
.zem-pa-classic-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -60%;
    height: 50%;
    background: #ffffff;
    z-index: 5;
    padding: 60px 40px 40px;
    opacity: 0;
    pointer-events: none;
    transition: bottom 0.5s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.zem-pa-bar.is-active .zem-pa-classic-content {
    opacity: 1;
    bottom: 0;
    pointer-events: auto;
    transition: bottom 0.5s cubic-bezier(0.77, 0, 0.175, 1) 0.1s, opacity 0.4s ease 0.1s;
}

/* Inner Text Styles */
.zem-pa-inner-title {
    font-size: 40px;
    line-height: 45px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 35px 0;
    color: var(--e-global-color-primary, #333333);
}

.zem-pa-desc {
    font-family: 'Lato', sans-serif;
    font-size: 24px;
    line-height: 30px;
    font-weight: 300;
    margin: 0 0 20px 0;
    color: var(--e-global-color-primary, #666666);
}

/* Price & Button Row */
.zem-pa-price-action {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 40px;
    margin-top: auto;
    padding-top: 15px;
}

.zem-pa-price {
    font-family: 'Lato', sans-serif;
    font-size: 24px;
    line-height: 30px;
    font-weight: 300;
    color: var(--e-global-color-primary, #888888);
}

.zem-pa-button {
    background: #5c4a45;
    color: #ffffff;
    padding: 12px 24px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
}

.zem-pa-button:hover {
    background: #4a3a36;
}

/* ── Expand / Collapse (CSS :has) ───────────── */
.zem-pa-bars:has(.zem-pa-bar.is-active) .zem-pa-bar {
    flex: 0.4;
}

.zem-pa-bars:has(.zem-pa-bar.is-active) .zem-pa-bar.is-active {
    flex: 2.11;
    background-color: #ffffff;
}

/* ══════════════════════════════════════════════
   ELEMENTOR EDITOR
   ══════════════════════════════════════════════ */
.elementor-editor-active .zem-pa-bars {
    height: auto !important;
    min-height: 260px;
    flex-wrap: wrap;
}

.elementor-editor-active .zem-pa-bar {
    flex: 1 1 200px;
    min-height: 260px;
}

.elementor-editor-active .zem-pa-label {
    opacity: 1 !important;
    writing-mode: horizontal-tb !important;
    transform: none !important;
    text-align: center;
    padding: 10px 8px;
    font-size: 11px;
    background: rgba(0,0,0,0.4);
    width: 100%;
}

.elementor-editor-active .zem-pa-bar > .e-con,
.elementor-editor-active .zem-pa-bar > .elementor-container,
.elementor-editor-active .zem-pa-bar > .elementor-section {
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
    inset: auto !important;
    background: rgba(0, 0, 0, 0.15);
    flex: 1;
    min-height: 100px;
}

/* ══════════════════════════════════════════════
   MOBILE  ≤1024px — stack vertically
   ══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .zem-pa-inner-title {
        font-size: 38px;
    }
    .zem-pa-desc, .zem-pa-price {
        font-size: 20px;
        line-height: 26px;
    }

    .zem-pa-bars {
        flex-direction: column;
        height: auto !important;
    }

    .zem-pa-bar {
        height: 140px;
        flex: none !important;
        justify-content: center;
        align-items: flex-start;
        overflow: visible;
        transition: height 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    }

    .zem-pa-label {
        padding: 50px 20px;
    }

    .zem-pa-bar.is-active {
        height: auto !important;
        overflow: visible;
        justify-content: flex-start;
    }

    .zem-pa-bar.is-active .zem-pa-inner-image {
        position: relative;
        top: auto;
        opacity: 1;
        height: 280px;
        width: 100%;
        pointer-events: auto;
        transition: none;
    }

    .zem-pa-bar.is-active .zem-pa-classic-content {
        position: relative;
        bottom: auto;
        height: auto;
        width: 100%;
        opacity: 1;
        padding: 40px 20px;
        pointer-events: auto;
        transition: none;
    }

    .zem-pa-bar.is-active .zem-pa-label {
        padding: 0 20px;
        height: 0;
        overflow: hidden;
        opacity: 0;
    }

    /* Override :has() for tablet — bars don't shrink */
    .zem-pa-bars:has(.zem-pa-bar.is-active) .zem-pa-bar {
        flex: none;
    }
}

@media (max-width: 767px) {
    /* Mobile: let the active panel expand naturally with its content */
    .zem-pa-bar {
        overflow: visible;
        height: 160px;
    }

    .zem-pa-bar.is-active {
        height: auto !important;
        overflow: visible;
    }

    .zem-pa-bar.is-active .zem-pa-inner-image {
        position: relative;
        top: auto;
        opacity: 1;
        height: 220px;
        width: 100%;
        pointer-events: auto;
        transition: none;
    }

    .zem-pa-bar.is-active .zem-pa-classic-content {
        position: relative;
        bottom: auto;
        height: auto;
        width: 100%;
        opacity: 1;
        padding: 40px 20px;
        pointer-events: auto;
        transition: none;
    }

    .zem-pa-inner-title {
        font-size: 28px;
    }

    .zem-pa-desc, .zem-pa-price {
        font-size: 16px;
        line-height: 22px;
    }

    .zem-pa-bar.is-active .zem-pa-label {
        padding: 0 20px;
        height: 0;
        overflow: hidden;
        opacity: 0;
    }

    .zem-pa-label {
        padding: 40px 20px;
        font-size: 22px;
        line-height: 28px;
    }
}
