/* WhatsApp Widget PRO — Frontend styles */
.wawp-widget {
    position: fixed;
    bottom: var(--wawp-bottom-desktop, 20px);
    z-index: var(--wawp-z, 9999);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}
.wawp-widget.wawp-pos-bottom-right { right: 20px; }
.wawp-widget.wawp-pos-bottom-left  { left:  20px; }

.wawp-widget * { box-sizing: border-box; }

/* Floating action button */
.wawp-fab {
    position: relative;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: var(--wawp-primary, #25D366);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .18), 0 6px 8px rgba(0, 0, 0, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.wawp-fab:hover  { transform: scale(1.06); background: var(--wawp-secondary, #128C7E); }
.wawp-fab:focus  { outline: 3px solid rgba(37, 211, 102, .35); outline-offset: 2px; }
.wawp-fab:active { transform: scale(.97); }

/* Keep the button itself as the only click target: without this, clicks on the
   icon vs. the surrounding button report different `event.target` elements,
   which breaks GTM click tracking (Click Element/Classes/Text vary per click). */
.wawp-fab svg {
    pointer-events: none;
}

.wawp-fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--wawp-primary, #25D366);
    opacity: .45;
    z-index: -1;
    animation: wawp-pulse 2.2s ease-out infinite;
    pointer-events: none;
}
@keyframes wawp-pulse {
    0%   { transform: scale(1);   opacity: .45; }
    80%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .wawp-fab-pulse { animation: none; }
}

/* Panel */
.wawp-panel {
    position: absolute;
    bottom: 76px;
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: 70vh;
    background: #fff;
    color: #1f2937;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22), 0 4px 10px rgba(0, 0, 0, .08);
    overflow: hidden;
    transform-origin: bottom right;
    transform: translateY(8px) scale(.96);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
}
.wawp-pos-bottom-left .wawp-panel { left: 0; right: auto; transform-origin: bottom left; }
.wawp-pos-bottom-right .wawp-panel { right: 0; }

.wawp-widget.is-open .wawp-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}
.wawp-widget.is-open .wawp-fab-pulse { display: none; }

.wawp-panel-header {
    background: var(--wawp-secondary, #128C7E);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wawp-panel-title { font-weight: 600; flex: 1; font-size: 14px; line-height: 1.25; }
.wawp-panel-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}
.wawp-panel-close:hover { background: rgba(255, 255, 255, .15); }

.wawp-panel-body {
    padding: 12px;
    overflow-y: auto;
    max-height: calc(70vh - 56px);
}

.wawp-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 0 4px 8px;
}

.wawp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

.wawp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    font: inherit;
    transition: background-color .18s ease, transform .18s ease, border-color .18s ease;
}
.wawp-item:hover {
    background: #f1f5f9;
    border-color: var(--wawp-primary, #25D366);
    transform: translateY(-1px);
}

.wawp-item-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
    /* Same reasoning as .wawp-fab svg above: prevent this child from ever
       becoming the click target so GTM always sees .wawp-item as clicked. */
    pointer-events: none;
}
.wawp-item-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wawp-item-logo[data-fallback] { background: var(--wawp-primary, #25D366); }

.wawp-item-text { display: flex; flex-direction: column; pointer-events: none; }
.wawp-item-title { font-weight: 600; font-size: 14px; }
.wawp-item-sub   { font-size: 12px; color: #6b7280; }

.wawp-back {
    background: transparent;
    border: 0;
    color: var(--wawp-secondary, #128C7E);
    cursor: pointer;
    padding: 4px 0 8px;
    font: inherit;
    font-size: 13px;
}
.wawp-back:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .wawp-widget { bottom: var(--wawp-bottom-mobile, 16px); }
    .wawp-widget.wawp-pos-bottom-right { right: 16px; }
    .wawp-widget.wawp-pos-bottom-left  { left:  16px; }
    .wawp-panel { width: calc(100vw - 32px); }
}
