/**
 * Floating contact widget
 *
 * Desktop: slide-in panel paremalt (380px)
 * Mobile:  bottom-sheet alt ülespoole (90vh)
 */

/* ═══════════════════════════════════════════════════════════════════
 * Floating button (trigger)
 * ═══════════════════════════════════════════════════════════════════ */

.bubblos-floating-contact__trigger {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9990;

    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.4rem 0.95rem 1.1rem;

    background: var(--wp--preset--color--carnival-orange);
    color: var(--wp--preset--color--white);
    border: 2px solid var(--wp--preset--color--brass-gold);
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);

    font-family: var(--wp--preset--font-family--posada);
    font-size: 1rem;
    letter-spacing: 0.04em;
    cursor: pointer;

    transition: all 0.25s ease;
    overflow: hidden;
}

.bubblos-floating-contact__trigger:hover,
.bubblos-floating-contact__trigger:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
    background: var(--wp--preset--color--carnival-orange-dark);
    outline: none;
}

.bubblos-floating-contact__trigger-text {
    position: relative;
    z-index: 2;
}

/* Mullide dekoor nupul */
.bubblos-floating-contact__trigger-bubbles {
    position: relative;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.bubblos-floating-contact__trigger-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.85),
        rgba(255, 255, 255, 0.25) 60%,
        transparent 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: bubblos-floating-bubble 5s ease-in-out infinite;
}

.bubblos-floating-contact__trigger-bubble--1 { width: 16px; height: 16px; top: 0;    left: 6px;  animation-delay: 0s; }
.bubblos-floating-contact__trigger-bubble--2 { width: 10px; height: 10px; top: 14px; left: 0;    animation-delay: 1.5s; }
.bubblos-floating-contact__trigger-bubble--3 { width: 12px; height: 12px; top: 12px; left: 14px; animation-delay: 3s; }

@keyframes bubblos-floating-bubble {
    0%, 100% { transform: translateY(0) scale(1);    opacity: 0.9; }
    50%      { transform: translateY(-4px) scale(1.08); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .bubblos-floating-contact__trigger-bubble { animation: none; }
}

/* Mobiilis ainult ikoon, ilma tekstita */
@media (max-width: 640px) {
    .bubblos-floating-contact__trigger {
        padding: 0.85rem;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        justify-content: center;
        bottom: 1rem;
        right: 1rem;
    }

    .bubblos-floating-contact__trigger-text {
        display: none;
    }

    .bubblos-floating-contact__trigger-bubbles {
        width: 32px;
        height: 32px;
    }
}

/* ═══════════════════════════════════════════════════════════════════
 * Panel container
 * ═══════════════════════════════════════════════════════════════════ */

.bubblos-floating-contact {
    position: fixed;
    inset: 0;
    z-index: 9995;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
}

.bubblos-floating-contact[hidden] {
    display: none;
}

.bubblos-floating-contact__overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 52, 56, 0.55);
    backdrop-filter: blur(3px);
    animation: bubblos-floating-fade-in 0.25s ease;
}

@keyframes bubblos-floating-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── Panel — desktop (paremalt slide-in) ─── */

.bubblos-floating-contact__panel {
    position: relative;
    width: 380px;
    max-width: 100%;
    height: 100vh;
    background: var(--wp--preset--color--vintage-cream);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: bubblos-floating-slide-right 0.3s cubic-bezier(0.32, 0.72, 0.32, 1);
}

@keyframes bubblos-floating-slide-right {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* ─── Panel — mobile (alt ülespoole, bottom-sheet) ─── */

@media (max-width: 640px) {
    .bubblos-floating-contact {
        align-items: flex-end;
    }

    .bubblos-floating-contact__panel {
        width: 100%;
        height: 90vh;
        max-height: 90vh;
        border-radius: var(--bubblos-radius-lg) var(--bubblos-radius-lg) 0 0;
        animation: bubblos-floating-slide-up 0.35s cubic-bezier(0.32, 0.72, 0.32, 1);
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.3);
    }

    @keyframes bubblos-floating-slide-up {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .bubblos-floating-contact__panel,
    .bubblos-floating-contact__overlay {
        animation: none;
    }
}

/* ─── Drag handle (ainult mobiil) ─── */

.bubblos-floating-contact__handle {
    display: none;
}

@media (max-width: 640px) {
    .bubblos-floating-contact__handle {
        display: block;
        width: 44px;
        height: 4px;
        background: var(--wp--preset--color--body-text-light);
        border-radius: 2px;
        margin: 0.75rem auto 0;
        opacity: 0.4;
    }
}

/* ═══════════════════════════════════════════════════════════════════
 * Header (title + close)
 * ═══════════════════════════════════════════════════════════════════ */

.bubblos-floating-contact__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid rgba(201, 162, 92, 0.25);
    flex-shrink: 0;
}

.bubblos-floating-contact__title {
    margin: 0;
    font-family: var(--wp--preset--font-family--posada);
    font-size: 1.25rem;
    color: var(--wp--preset--color--deep-charcoal);
    line-height: 1.2;
}

.bubblos-floating-contact__close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--wp--preset--color--body-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.bubblos-floating-contact__close:hover,
.bubblos-floating-contact__close:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: var(--wp--preset--color--deep-charcoal);
    outline: none;
}

/* ═══════════════════════════════════════════════════════════════════
 * Body (scroll'iv) + accordion-sektsioonid
 * ═══════════════════════════════════════════════════════════════════ */

.bubblos-floating-contact__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.bubblos-floating-contact__section {
    border-bottom: 1px solid rgba(201, 162, 92, 0.15);
}

.bubblos-floating-contact__section:last-child {
    border-bottom: none;
}

.bubblos-floating-contact__section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.bubblos-floating-contact__section-toggle:hover,
.bubblos-floating-contact__section-toggle:focus-visible {
    background-color: rgba(232, 136, 56, 0.06);
    outline: none;
}

.bubblos-floating-contact__section-label {
    font-family: var(--wp--preset--font-family--posada);
    font-size: 1rem;
    color: var(--wp--preset--color--deep-charcoal);
    letter-spacing: 0.02em;
}

.bubblos-floating-contact__section-chevron {
    color: var(--wp--preset--color--body-text-light);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.bubblos-floating-contact__section-toggle[aria-expanded="true"] .bubblos-floating-contact__section-chevron {
    transform: rotate(180deg);
}

.bubblos-floating-contact__section-toggle[aria-expanded="true"] .bubblos-floating-contact__section-label {
    color: var(--wp--preset--color--carnival-orange-dark);
}

.bubblos-floating-contact__section-content {
    padding: 0.25rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bubblos-floating-contact__section-content[hidden] {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════
 * CTA-nupud sektsioonide sees
 * ═══════════════════════════════════════════════════════════════════ */

.bubblos-floating-contact__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    background: var(--wp--preset--color--carnival-orange);
    color: var(--wp--preset--color--white);
    border-radius: var(--bubblos-radius-md);
    font-family: var(--wp--preset--font-family--roboto);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.bubblos-floating-contact__cta:hover,
.bubblos-floating-contact__cta:focus-visible {
    background: var(--wp--preset--color--carnival-orange-dark);
    color: var(--wp--preset--color--white);
    transform: translateY(-1px);
    outline: none;
}

.bubblos-floating-contact__cta--messenger { background: #0084ff; }
.bubblos-floating-contact__cta--messenger:hover { background: #006bd6; }

.bubblos-floating-contact__cta--phone { background: var(--wp--preset--color--circus-teal-dark); }
.bubblos-floating-contact__cta--phone:hover { background: var(--wp--preset--color--deep-charcoal); }

.bubblos-floating-contact__cta--email { background: var(--wp--preset--color--carnival-orange); }

.bubblos-floating-contact__cta--whatsapp { background: #25d366; }
.bubblos-floating-contact__cta--whatsapp:hover { background: #128c7e; }

.bubblos-floating-contact__cta--primary { background: var(--wp--preset--color--sage-green); }
.bubblos-floating-contact__cta--primary:hover { background: #6a8862; }

.bubblos-floating-contact__cta--secondary {
    background: transparent;
    color: var(--wp--preset--color--deep-charcoal);
    border: 2px solid var(--wp--preset--color--brass-gold);
}

.bubblos-floating-contact__cta--secondary:hover {
    background: var(--wp--preset--color--vintage-paper);
    color: var(--wp--preset--color--deep-charcoal);
}

.bubblos-floating-contact__cta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bubblos-floating-contact__meta {
    margin: 0;
    color: var(--wp--preset--color--body-text-light);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════
 * Sotsiaalmeedia ikoonid
 * ═══════════════════════════════════════════════════════════════════ */

.bubblos-floating-contact__social {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bubblos-floating-contact__social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--wp--preset--color--deep-charcoal);
    color: var(--wp--preset--color--vintage-cream);
    border-radius: var(--bubblos-radius-md);
    transition: all 0.15s ease;
}

.bubblos-floating-contact__social-icon:hover,
.bubblos-floating-contact__social-icon:focus-visible {
    background: var(--wp--preset--color--carnival-orange);
    color: var(--wp--preset--color--white);
    transform: translateY(-2px);
    outline: none;
}