/* cta-pack-cursos.css
 * Estilos del CTA "Crea tu pack" en fichas de cursos empaquetables.
 * Spec: docs/superpowers/specs/2026-04-27-cta-pack-cursos-en-fichas-design.md
 */

/* Estado oculto (compartido desktop+mobile) */
.cta-pack-hidden { display: none !important; }

body.cta-pack-modal-open { overflow: hidden; }

/* ========== DESKTOP (>=1106px): sticky lateral derecho ========== */
@media (min-width: 1106px) {

    .cta-pack-fab,
    .cta-pack-modal {
        display: none !important;
    }

    .cta-pack-sticky {
        position: fixed;
        right: 24px;
        bottom: 140px;
        width: 280px;
        padding: 22px 20px 20px;
        background: rgba(255, 255, 255, 0.82);
        backdrop-filter: blur(14px) saturate(140%);
        -webkit-backdrop-filter: blur(14px) saturate(140%);
        border-radius: 12px;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
        border-top: 4px solid #005348;
        z-index: 9000;
        font-family: 'Open Sans', sans-serif;
        animation: cta-pack-slide-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .cta-pack-sticky .cta-pack-close {
        position: absolute;
        top: 6px;
        right: 8px;
        background: transparent;
        border: none;
        font-size: 22px;
        line-height: 1;
        color: #767676;
        cursor: pointer;
        padding: 8px 12px;
        min-width: 36px;
        min-height: 36px;
    }
    .cta-pack-sticky .cta-pack-close:hover { color: #333; }

    .cta-pack-sticky .cta-pack-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 14px;
    }

    .cta-pack-sticky .cta-pack-icon {
        flex: 0 0 auto;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(253, 126, 20, 0.12);
        color: #fd7e14;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }

    .cta-pack-sticky .cta-pack-title {
        flex: 1 1 auto;
        font-size: 17px;
        font-weight: 700;
        color: #333;
        margin: 0;
        line-height: 1.25;
    }

    .cta-pack-sticky .cta-pack-subtitle {
        margin: 0 0 16px;
    }
    .cta-pack-sticky .cta-pack-discount {
        display: block;
        font-size: 28px;
        font-weight: 800;
        color: #fd7e14;
        line-height: 1;
        letter-spacing: -0.5px;
        margin-bottom: 4px;
    }
    .cta-pack-sticky .cta-pack-discount-detail {
        display: block;
        font-size: 13px;
        color: #555;
        line-height: 1.4;
    }

    .cta-pack-sticky .cta-pack-cta {
        display: block;
        background: #fd7e14;
        color: #fff !important;
        text-align: center;
        text-decoration: none;
        font-weight: 700;
        font-size: 13px;
        padding: 12px 14px;
        border-radius: 50px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transition: background-color 0.2s ease;
    }
    .cta-pack-sticky .cta-pack-cta:hover {
        background: #e36b00 !important;
    }
}

@keyframes cta-pack-slide-in {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* ========== MOBILE (<1106px): FAB + modal ========== */
@media (max-width: 1105px) {

    .cta-pack-sticky {
        display: none !important;
    }

    .cta-pack-fab {
        position: fixed;
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: #fd7e14;
        color: #fff;
        font-size: 22px;
        border: none;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
        z-index: 9000;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        animation: cta-pack-fab-pulse 1.6s ease-in-out 3;
    }
    .cta-pack-fab:active { transform: scale(0.95); }

    .cta-pack-modal {
        position: fixed;
        inset: 0;
        z-index: 9100;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .cta-pack-modal[hidden] { display: none; }

    .cta-pack-modal-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
    }

    .cta-pack-modal-card {
        position: relative;
        width: calc(100% - 40px);
        max-width: 360px;
        background: #fff;
        border-radius: 14px;
        padding: 28px 22px 18px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
        border-top: 4px solid #005348;
        font-family: 'Open Sans', sans-serif;
        animation: cta-pack-modal-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .cta-pack-modal-card .cta-pack-modal-close {
        position: absolute;
        top: 6px;
        right: 10px;
        background: transparent;
        border: none;
        font-size: 26px;
        line-height: 1;
        color: #767676;
        cursor: pointer;
        padding: 8px 12px;
        min-width: 40px;
        min-height: 40px;
    }

    .cta-pack-modal-card .cta-pack-header {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        margin-bottom: 14px;
    }

    .cta-pack-modal-card .cta-pack-icon {
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(253, 126, 20, 0.12);
        color: #fd7e14;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
    }

    .cta-pack-modal-card .cta-pack-title {
        flex: 0 1 auto;
        font-size: 18px;
        font-weight: 700;
        color: #333;
        margin: 0;
        text-align: left;
        line-height: 1.25;
    }

    .cta-pack-modal-card .cta-pack-subtitle {
        margin: 0 0 18px;
        text-align: center;
    }
    .cta-pack-modal-card .cta-pack-discount {
        display: block;
        font-size: 32px;
        font-weight: 800;
        color: #fd7e14;
        line-height: 1;
        letter-spacing: -0.5px;
        margin-bottom: 4px;
    }
    .cta-pack-modal-card .cta-pack-discount-detail {
        display: block;
        font-size: 13px;
        color: #555;
        line-height: 1.4;
    }

    .cta-pack-modal-card .cta-pack-cta {
        display: block;
        background: #fd7e14;
        color: #fff !important;
        text-align: center;
        text-decoration: none;
        font-weight: 700;
        font-size: 14px;
        padding: 13px 14px;
        border-radius: 50px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .cta-pack-modal-card .cta-pack-dismiss-permanent {
        display: block;
        margin: 12px auto 0;
        background: transparent;
        border: none;
        color: #767676;
        font-size: 12px;
        text-decoration: underline;
        cursor: pointer;
    }
}

@keyframes cta-pack-fab-pulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%      { transform: scale(1.12); opacity: 0.85; }
}

@keyframes cta-pack-modal-in {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* ========== VARIANTE V2 (?cta_pack=v2): estilo "submenú principal" ========== */

.cta-pack-sticky.cta-pack-v2,
.cta-pack-modal-card.cta-pack-v2 {
    background-color: #005348;
    background-size: cover;
    background-position: center;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: hidden;
    border-top-color: #FF8200;
}

.cta-pack-sticky.cta-pack-v2::before,
.cta-pack-modal-card.cta-pack-v2::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 83, 72, 0.87), rgba(0, 40, 35, 0.93));
    z-index: 0;
    pointer-events: none;
}

.cta-pack-sticky.cta-pack-v2 > *:not(.cta-pack-close),
.cta-pack-modal-card.cta-pack-v2 > *:not(.cta-pack-modal-close) {
    position: relative;
    z-index: 1;
}

.cta-pack-sticky.cta-pack-v2 .cta-pack-close,
.cta-pack-modal-card.cta-pack-v2 .cta-pack-modal-close {
    z-index: 2;
    color: rgba(255, 255, 255, 0.7);
}
.cta-pack-sticky.cta-pack-v2 .cta-pack-close:hover,
.cta-pack-modal-card.cta-pack-v2 .cta-pack-modal-close:hover {
    color: #fff;
}

.cta-pack-sticky.cta-pack-v2 .cta-pack-icon,
.cta-pack-modal-card.cta-pack-v2 .cta-pack-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
}

.cta-pack-sticky.cta-pack-v2 .cta-pack-title,
.cta-pack-modal-card.cta-pack-v2 .cta-pack-title {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
}

.cta-pack-sticky.cta-pack-v2 .cta-pack-discount,
.cta-pack-modal-card.cta-pack-v2 .cta-pack-discount {
    color: #FF8200;
}

.cta-pack-sticky.cta-pack-v2 .cta-pack-discount-detail,
.cta-pack-modal-card.cta-pack-v2 .cta-pack-discount-detail {
    color: rgba(255, 255, 255, 0.85);
}

.cta-pack-sticky.cta-pack-v2 .cta-pack-cta,
.cta-pack-modal-card.cta-pack-v2 .cta-pack-cta {
    background: #FF8200;
}
.cta-pack-sticky.cta-pack-v2 .cta-pack-cta:hover,
.cta-pack-modal-card.cta-pack-v2 .cta-pack-cta:hover {
    background: #e36b00 !important;
}

.cta-pack-modal-card.cta-pack-v2 .cta-pack-dismiss-permanent {
    color: rgba(255, 255, 255, 0.65);
}
.cta-pack-modal-card.cta-pack-v2 .cta-pack-dismiss-permanent:hover {
    color: rgba(255, 255, 255, 0.95);
}

/* ========== MODO COMPARACIÓN (?cta_pack=both): v1 + v2 lado a lado ========== */

@media (min-width: 1106px) {
    .cta-pack-sticky.cta-pack-compare-right {
        right: 24px;
    }
    .cta-pack-sticky.cta-pack-compare-left {
        right: 320px;
    }
}
