/* =========================================================
   Sprout WhatsApp Chat — Frontend Styles
   ========================================================= */

.sprout-wa-widget {
    position: fixed;
    z-index: 999999;
    display: grid;
    gap: 12px;
    max-width: min(360px, calc(100vw - 32px));
    font-family: Inter, Arial, Helvetica, sans-serif;
}

.sprout-wa-tooltip {
    position: relative;
    width: min(340px, calc(100vw - 32px));
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(31, 29, 25, 0.08);
    background:
        radial-gradient(circle at top left, rgba(108, 140, 87, 0.16), transparent 34%),
        linear-gradient(180deg, var(--sprout-wa-bg), #f8f2e8);
    box-shadow: 0 24px 70px rgba(31, 29, 25, 0.18);
    color: var(--sprout-wa-text);
    animation: sproutWaFloatIn 0.45s ease both;
}

.sprout-wa-tooltip.is-hidden {
    display: none;
}

.sprout-wa-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    color: rgba(31, 29, 25, 0.62);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.sprout-wa-tooltip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 26px;
}

.sprout-wa-avatar {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    background: rgba(108, 140, 87, 0.14);
    color: var(--sprout-wa-brand-dark);
    font-size: 20px;
}

.sprout-wa-tooltip strong {
    display: block;
    color: var(--sprout-wa-text);
    font-size: 15px;
    line-height: 1.2;
}

.sprout-wa-tooltip span,
.sprout-wa-tooltip p,
.sprout-wa-tooltip small {
    color: rgba(31, 29, 25, 0.68);
}

.sprout-wa-tooltip span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
}

.sprout-wa-tooltip p {
    margin: 14px 0 8px;
    font-size: 14px;
    line-height: 1.55;
}

.sprout-wa-tooltip small {
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.sprout-wa-button {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 14px 20px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.28);
    background: var(--sprout-wa-brand);
    color: #ffffff !important;
    box-shadow: 0 20px 45px rgba(31, 29, 25, 0.22);
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.sprout-wa-button:hover,
.sprout-wa-button:focus {
    background: var(--sprout-wa-brand-dark);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 26px 60px rgba(31, 29, 25, 0.28);
}

.sprout-wa-icon {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.sprout-wa-icon svg {
    display: block;
}

.sprout-wa-hide-label .sprout-wa-button {
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 50%;
}

.sprout-wa-hide-label .sprout-wa-label {
    display: none;
}

.sprout-wa-no-tooltip {
    gap: 0;
}

/* Style: Classic WhatsApp */
.sprout-wa-style-classic .sprout-wa-button {
    background: #25D366;
}

.sprout-wa-style-classic .sprout-wa-button:hover,
.sprout-wa-style-classic .sprout-wa-button:focus {
    background: #128C7E;
}

/* Style: Minimal */
.sprout-wa-style-minimal .sprout-wa-button {
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 50%;
    background: #ffffff;
    color: var(--sprout-wa-brand-dark) !important;
    border: 1px solid rgba(31, 29, 25, 0.08);
}

.sprout-wa-style-minimal .sprout-wa-label {
    display: none;
}

.sprout-wa-style-minimal .sprout-wa-button:hover,
.sprout-wa-style-minimal .sprout-wa-button:focus {
    background: var(--sprout-wa-bg);
    color: var(--sprout-wa-brand-dark) !important;
}

/* Style: Bubble */
.sprout-wa-style-bubble .sprout-wa-button {
    border-radius: 20px 20px 6px 20px;
    background: linear-gradient(135deg, var(--sprout-wa-brand), var(--sprout-wa-brand-dark));
}

.sprout-wa-style-bubble .sprout-wa-tooltip {
    border-radius: 24px 24px 8px 24px;
}

@keyframes sproutWaFloatIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 760px) {
    .sprout-wa-widget {
        max-width: calc(100vw - 32px);
    }

    .sprout-wa-tooltip {
        width: min(320px, calc(100vw - 32px));
        padding: 16px;
    }

    .sprout-wa-button {
        min-height: 54px;
        padding: 13px 17px;
        font-size: 14px;
    }

    .sprout-wa-hide-label .sprout-wa-button,
    .sprout-wa-style-minimal .sprout-wa-button {
        width: 56px;
        height: 56px;
    }
}
