/* ─────────────────────────────────────────────────────────
   Bulli CTA Delivery v2.3
   Animation 5: Unboxing
     1. Box von links rein
     2. Lid klappt auf
     3. Produkt steigt aus der Box (klein, oben raus)
     4. Produkt wächst & wandert nach unten vor die Box
     5. Box fällt nach unten weg, Produkt bleibt
     6. Produkt zieht nach rechts raus
   ───────────────────────────────────────────────────────── */

.bulli-cta-delivery {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    user-select: none;
}


/* ── Slot (1 pro Produkt) ─────────────────────────────── */
.bulli-cta-delivery__slot {
    position: absolute;
    inset: 0;
    pointer-events: none;
}


/* ── Stage (rein-/raus-Bewegung der Box) ──────────────── */
.bulli-cta-delivery__stage {
    position: absolute;
    bottom: 18%;
    left: 50%;
    width: 30%;
    aspect-ratio: 5 / 3;
    transform: translateX(-250%);
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ── Boden-Schatten (folgt der Box) ───────────────────── */
.bulli-cta-delivery__shadow {
    position: absolute;
    bottom: -14px;
    left: 6%;
    right: 6%;
    height: 14px;
    background: radial-gradient(ellipse at center,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.18) 50%,
        rgba(0, 0, 0, 0) 75%);
    pointer-events: none;
    z-index: 1;
    transition: transform 0.55s cubic-bezier(0.55, 0.05, 0.7, 0.3),
                opacity 0.35s ease;
}


/* ── Paket ──────────────────────────────────────────── */
.bulli-cta-delivery__box {
    position: absolute;
    inset: 0;
    z-index: 4;
    transition: transform 0.55s cubic-bezier(0.55, 0.05, 0.7, 0.3);
}

.bulli-cta-delivery__box-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: #c39466;
    border: 2px solid #1c1c1c;
    border-top: none;
    box-shadow:
        inset 0 8px 16px rgba(0, 0, 0, 0.18),
        0 6px 14px rgba(0, 0, 0, 0.4);
}
.bulli-cta-delivery__box-tape {
    position: absolute;
    top: 32%;
    left: 0;
    right: 0;
    height: 12px;
    background: #d4a373;
    border-top: 1.5px solid #1c1c1c;
    border-bottom: 1.5px solid #1c1c1c;
}

.bulli-cta-delivery__box-lid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    transform-origin: 50% 100%;
    transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
    z-index: 2;
}
.bulli-cta-delivery__box-lid-flap {
    position: absolute;
    inset: 0;
    background: #d4a373;
    border: 2px solid #1c1c1c;
    border-bottom: none;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}


/* ── Produkt ───────────────────────────────────────── */
.bulli-cta-delivery__product {
    position: absolute;
    bottom: 30%;
    left: 50%;
    width: 70%;
    aspect-ratio: 1 / 1;
    z-index: 5;  /* über Box */
    transform: translate(-50%, 60%) scale(0.4);
    opacity: 0;
    transition:
        transform 0.55s cubic-bezier(0.34, 1.5, 0.64, 1),
        opacity 0.3s ease;
}

.bulli-cta-delivery__product-svg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bulli-cta-delivery__product-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bulli-cta-delivery__product-overlay {
    position: absolute;
    pointer-events: none;
}
.bulli-cta-delivery__product-overlay svg {
    width: 100%;
    height: auto;
    display: block;
}
.bulli-cta-delivery__product-overlay .elementor,
.bulli-cta-delivery__product-overlay .elementor-section-wrap,
.bulli-cta-delivery__product-overlay .elementor-section,
.bulli-cta-delivery__product-overlay .elementor-container,
.bulli-cta-delivery__product-overlay .elementor-widget-wrap,
.bulli-cta-delivery__product-overlay .elementor-widget {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}


/* ── Phasen ──────────────────────────────────────────── */

/* idle = Snap-Reset: Transitions aus → Stage/Box/Product springen instant */
.bulli-cta-delivery__slot[data-phase="idle"] .bulli-cta-delivery__stage,
.bulli-cta-delivery__slot[data-phase="idle"] .bulli-cta-delivery__box,
.bulli-cta-delivery__slot[data-phase="idle"] .bulli-cta-delivery__box-lid,
.bulli-cta-delivery__slot[data-phase="idle"] .bulli-cta-delivery__product,
.bulli-cta-delivery__slot[data-phase="idle"] .bulli-cta-delivery__shadow {
    transition: none !important;
}

/* entering — Stage von links zur Mitte */
.bulli-cta-delivery__slot[data-phase="entering"] .bulli-cta-delivery__stage {
    transform: translateX(-50%);
}

/* opening — Lid klappt auf */
.bulli-cta-delivery__slot[data-phase="opening"] .bulli-cta-delivery__stage {
    transform: translateX(-50%);
}
.bulli-cta-delivery__slot[data-phase="opening"] .bulli-cta-delivery__box-lid {
    transform: rotateX(135deg) translateY(-10%);
}

/* rising — Produkt steigt klein nach oben aus der Box */
.bulli-cta-delivery__slot[data-phase="rising"] .bulli-cta-delivery__stage {
    transform: translateX(-50%);
}
.bulli-cta-delivery__slot[data-phase="rising"] .bulli-cta-delivery__box-lid {
    transform: rotateX(135deg) translateY(-10%);
}
.bulli-cta-delivery__slot[data-phase="rising"] .bulli-cta-delivery__product {
    transform: translate(-50%, -90%) scale(0.6);
    opacity: 1;
}

/* landing — Produkt wächst & wandert nach unten vor die Box,
   gleichzeitig fällt die Box nach unten weg */
.bulli-cta-delivery__slot[data-phase="landing"] .bulli-cta-delivery__stage {
    transform: translateX(-50%);
}
.bulli-cta-delivery__slot[data-phase="landing"] .bulli-cta-delivery__box-lid {
    transform: rotateX(135deg) translateY(-10%);
}
.bulli-cta-delivery__slot[data-phase="landing"] .bulli-cta-delivery__box {
    transform: translateY(200%);
    transition: transform 0.7s cubic-bezier(0.55, 0.05, 0.7, 0.3);
}
.bulli-cta-delivery__slot[data-phase="landing"] .bulli-cta-delivery__shadow {
    transform: translateY(200%);
    opacity: 0;
    transition:
        transform 0.7s cubic-bezier(0.55, 0.05, 0.7, 0.3),
        opacity 0.5s ease;
}
.bulli-cta-delivery__slot[data-phase="landing"] .bulli-cta-delivery__product {
    transform: translate(-50%, 25%) scale(1.7);
    opacity: 1;
    transition:
        transform 0.7s cubic-bezier(0.34, 1.4, 0.64, 1),
        opacity 0.3s ease;
}

/* productout — Produkt zieht nach rechts raus (Box ist schon weg) */
.bulli-cta-delivery__slot[data-phase="productout"] .bulli-cta-delivery__stage {
    transform: translateX(-50%);
}
.bulli-cta-delivery__slot[data-phase="productout"] .bulli-cta-delivery__box,
.bulli-cta-delivery__slot[data-phase="productout"] .bulli-cta-delivery__shadow {
    transform: translateY(200%);
    opacity: 0;
}
.bulli-cta-delivery__slot[data-phase="productout"] .bulli-cta-delivery__product {
    transform: translate(450%, 25%) scale(1.7);
    opacity: 1;
    transition:
        transform 0.75s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease;
}


/* ── Reduced-Motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .bulli-cta-delivery__slot[data-phase="landing"] .bulli-cta-delivery__product {
        transition: opacity 0.2s ease !important;
    }
}


/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .bulli-cta-delivery__stage { width: 50%; }
}
