.ce-expand-card-container {
    width: 100%;
    overflow: hidden;
}

.ce-expand-card-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

.ce-expand-card {
    position: relative;
    flex-grow: 1;
    background-image: var(--card-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.4s ease;
}

.ce-expand-card.ce-image-grayscale {
    filter: grayscale(100%);
}

.ce-expand-card.ce-image-grayscale:hover,
.ce-expand-card.ce-image-grayscale.active {
    filter: grayscale(0%);
}

.ce-expand-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.4s ease;
}

.ce-expand-card:hover::before,
.ce-expand-card.active::before {
    background: rgba(0, 0, 0, 0.1);
}

/* Title bar: always visible at bottom of each card */
.ce-expand-card-title-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 25px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
    z-index: 3;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Hide the always-visible title bar when card is active/hovered (detail title takes over) */
.ce-expand-card:hover .ce-expand-card-title-bar,
.ce-expand-card.active .ce-expand-card-title-bar {
    opacity: 0;
}

/* Expandable content area: desc + button (and detail title) */
.ce-expand-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    z-index: 2;
}

.ce-expand-card:hover .ce-expand-card-content,
.ce-expand-card.active .ce-expand-card-content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ce-expand-card-title {
    margin: 0;
    line-height: 1.2;
    font-weight: 800;
}

.ce-expand-card-title-detail {
    margin-bottom: 8px;
}

.ce-expand-card-desc {
    margin: 8px 0 0 0;
    font-weight: 500;
}

.ce-expand-card-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ce-expand-card-btn-icon {
    display: flex;
    line-height: 0;
}

@media (max-width: 767px) {
    .ce-expand-card-wrapper {
        flex-direction: column;
    }

    .ce-expand-card {
        margin: 5px 0 !important;
        flex-grow: 1 !important;
        height: 250px !important;
    }

    .ce-expand-card-title-bar {
        opacity: 0;
    }

    .ce-expand-card-content {
        opacity: 1;
        transform: translateY(0);
        padding: 20px;
        pointer-events: auto;
    }
}

/* ══════════════════════════════════════════════════════════
   MODAL POPUP CORE STYLES (FULLSCREEN & ZERO-PADDING DEFAULTS)
   ══════════════════════════════════════════════════════════ */
.ce-card-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: stretch;
    justify-content: stretch;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ce-card-modal.ce-modal-open {
    opacity: 1;
}

.ce-card-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.4s ease;
}

.ce-card-modal-content-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    pointer-events: none;
}

.ce-card-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.45s ease;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.ce-card-modal.ce-modal-open .ce-card-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.ce-card-modal-close {
    position: absolute;
    top: 30px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100;
    padding: 0;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.ce-card-modal-close.ce-close-left {
    left: 30px;
    right: auto;
}

.ce-card-modal-close.ce-close-right {
    right: 30px;
    left: auto;
}

.ce-card-modal-close:hover {
    opacity: 0.8;
}

.ce-card-modal-close .ce-modal-close-icon {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.ce-card-modal-close:hover .ce-modal-close-icon {
    transform: translateX(-4px);
}

.ce-card-modal-body {
    overflow-y: auto;
    width: 100%;
    line-height: 1.6;
    color: #333333;
    padding: 0;
    flex-grow: 1;
}
.ce-card-modal-body p {
    margin-top: 0;
}
