/* WhatsApp Channel Add-on: isolated mobile bottom-sheet styles. */

html.wa-channel-open,
html.wa-channel-open body {
    overflow: hidden;
}

.wa-channel-dialog {
    --wa-channel-green: #087a60;
    --wa-channel-green-hover: #06664f;
    --wa-channel-green-active: #055440;
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 1.5rem);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 1rem 1rem 0 0;
    background-color: var(--color-surface);
    color: var(--color-text);
    overflow: auto;
    overscroll-behavior: contain;
    transform-origin: bottom center;
}

.wa-channel-dialog[open] {
    animation: wa-channel-in 0.24s ease-out;
}

.wa-channel-dialog:focus-visible {
    outline: 0;
}

.wa-channel-dialog.is-closing {
    animation: wa-channel-out 0.2s ease-in;
}

.wa-channel-dialog::backdrop {
    background-color: rgb(4 17 39 / 55%);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: wa-channel-backdrop-in 0.24s ease-out;
}

.wa-channel-dialog.is-closing::backdrop {
    animation: wa-channel-backdrop-out 0.2s ease-in;
}

.wa-channel-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1rem;
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    text-align: center;
}

.wa-channel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 44px;
    height: 44px;
    margin: -0.5rem -0.5rem 0 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background-color: transparent;
    color: var(--color-text-strong);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.wa-channel-close:is(:hover, :active) {
    background-color: var(--color-surface-subtle);
    color: var(--wa-channel-green);
}

.wa-channel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    border-radius: 50%;
    background-color: #e9fbf3;
    color: var(--wa-channel-green);
}

.wa-channel-dialog h2 {
    max-width: 24rem;
    color: var(--color-text-strong);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    text-wrap: balance;
}

.wa-channel-dialog p {
    max-width: 30rem;
    margin: 0.5rem 0 1rem;
    color: var(--color-text);
    font-size: 0.875rem;
    line-height: 1.6;
    text-wrap: pretty;
}

.wa-channel-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--wa-channel-green);
    border-radius: var(--radius);
    background-color: var(--wa-channel-green);
    color: var(--color-on-primary);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.wa-channel-cta:hover {
    border-color: var(--wa-channel-green-hover);
    background-color: var(--wa-channel-green-hover);
}

.wa-channel-cta:active {
    border-color: var(--wa-channel-green-active);
    background-color: var(--wa-channel-green-active);
    transform: translateY(1px);
}

.wa-channel-close:focus-visible,
.wa-channel-cta:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

@keyframes wa-channel-in {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
}

@keyframes wa-channel-out {
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

@keyframes wa-channel-backdrop-in {
    from {
        opacity: 0;
    }
}

@keyframes wa-channel-backdrop-out {
    to {
        opacity: 0;
    }
}

@media (min-width: 768px) {
    .wa-channel-dialog[open] {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wa-channel-dialog[open],
    .wa-channel-dialog.is-closing,
    .wa-channel-dialog::backdrop,
    .wa-channel-dialog.is-closing::backdrop {
        animation: none;
    }

    .wa-channel-close,
    .wa-channel-cta {
        transition: none;
    }
}

/* End WhatsApp Channel Add-on. */
