/* =============================================
   EXPAND CARDS WIDGET – Elementor Plugin v1.1
   Zmeny: smer rozbalovanie (zlava/zprava), okruhle tlacidlo
   ============================================= */

.ec-cards-wrapper {
    position: relative;
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 420px;
    gap: 16px;
    overflow: hidden;
    align-items: stretch;
    box-sizing: border-box;
    z-index: 1;
}

/* Základná karta */
.ec-card {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: 20px;
    cursor: pointer;
    transition: flex 0.55s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
    background: #e8e8e8;
}

.ec-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

/* Rozbalená karta */
.ec-card.is-expanded {
    flex: 2.4;
}

/* Obrázok */
.ec-card-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.ec-card:hover .ec-card-image {
    transform: scale(1.04);
}

/* Overlay gradient */
.ec-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.30) 100%);
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.ec-card.is-expanded .ec-card-overlay {
    opacity: 0.12;
}

/* Header – nadpis */
.ec-card-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    pointer-events: none;
}

.ec-card-title {
    margin: 0;
    padding: 20px 24px 0 24px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.45);
    word-break: break-word;
}

/* =============================================
   TEXTOVÝ PANEL – SPOLOČNÉ
   ============================================= */
.ec-card-content {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    min-width: 180px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 70px 28px 80px 28px;
    box-sizing: border-box;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    /* transition sa nastavuje cez JS podľa rýchlosti */
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
                opacity   0.40s ease;
}

/* ─── SMER: ZĽAVA (default) ─── */
.ec-direction-left .ec-card-content {
    left: 0;
    right: auto;
    transform: translateX(-110%);
}

.ec-direction-left .ec-card.is-expanded .ec-card-content {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* ─── SMER: ZPRAVA ─── */
.ec-direction-right .ec-card-content {
    right: 0;
    left: auto;
    transform: translateX(110%);
}

.ec-direction-right .ec-card.is-expanded .ec-card-content {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Rozbalený stav – spoločné */
.ec-card.is-expanded .ec-card-content {
    opacity: 1;
    pointer-events: auto;
}

.ec-card-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.75;
    color: #333;
    word-break: break-word;
}

/* =============================================
   TLAČIDLO + / × – OKRÚHLE
   ============================================= */
.ec-toggle-btn {
    position: absolute;
    z-index: 10;
    width: 40px;
    height: 40px;
    /* Pevný border-radius pre okrúhly tvar – nesmie byť prepísaný */
    border-radius: 50% !important;
    border: none;
    background: #ffffff;
    color: #000000;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 14px rgba(0,0,0,0.20);
    outline: none;
    padding: 0;
    /* Predvolená pozícia: vľavo dole */
    bottom: 20px;
    left: 24px;
    /* Zaistenie pomeru strán = kruh */
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    transition: background 0.25s ease,
                color      0.25s ease,
                box-shadow 0.25s ease,
                transform  0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity    0.3s ease;
}

.ec-toggle-btn:hover {
    background: #111111;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.32);
    transform: scale(1.10);
}

.ec-toggle-btn:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* Ikona + → × rotácia */
.ec-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    pointer-events: none;
    line-height: 1;
}

.ec-card.is-expanded .ec-toggle-btn {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Pozícia: vpravo dole */
.ec-card.ec-btn-bottom-right .ec-toggle-btn {
    left: auto;
    right: 24px;
}

/* Pozícia: stred dole */
.ec-card.ec-btn-bottom-center .ec-toggle-btn {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}
.ec-card.ec-btn-bottom-center .ec-toggle-btn:hover {
    transform: translateX(-50%) scale(1.10);
}
.ec-card.ec-btn-bottom-center.is-expanded .ec-btn-icon {
    transform: rotate(45deg);
}

/* ── RESPONZIVITA ── */
@media (max-width: 768px) {
    .ec-cards-wrapper {
        flex-direction: column !important;
        height: auto !important;
    }
    .ec-card {
        flex: none !important;
        height: 280px;
    }
    .ec-card.is-expanded {
        height: 420px;
    }
    /* Na mobile vždy vysunutie zdola */
    .ec-direction-left .ec-card-content,
    .ec-direction-right .ec-card-content {
        width: 100% !important;
        min-width: unset;
        left: 0 !important;
        right: 0 !important;
        top: auto;
        bottom: 0;
        height: 55%;
        transform: translateY(110%) !important;
        padding: 20px 24px 95px 24px !important;
        overflow-y: auto !important;
    }
    .ec-direction-left .ec-card.is-expanded .ec-card-content,
    .ec-direction-right .ec-card.is-expanded .ec-card-content {
        transform: translateY(0) !important;
    }
}

@media (max-width: 480px) {
    .ec-card { height: 240px; }
    .ec-card.is-expanded { height: 380px; }
    .elementor-widget-expand_cards .ec-card-title,
    .ec-card-title { 
        font-size: 15px !important; 
        line-height: 1.25 !important;
        padding: 16px 16px 0 16px !important;
    }
}
