/* ============================================================
   PA Jeneponto – Floating Contact Widget v1.3.0
   ============================================================ */

#pa-floating-widget *,
#pa-floating-widget *::before,
#pa-floating-widget *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Root Container ── */
#pa-floating-widget {
    position: fixed;
    z-index: 99999;
    bottom: 50px;
    right: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;  /* label teks rata tengah di bawah tombol */
}

/* ── Wrapper tombol + label ── */
.pa-toggle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* ── Tombol bulat ── */
.pa-widget-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(22,163,74,0.5);
    transition: transform .25s, box-shadow .25s, background .25s;
    position: relative;
    flex-shrink: 0;
}

.pa-widget-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(22,163,74,0.65);
    background: linear-gradient(135deg, #15803d, #166534);
}

.pa-widget-toggle:focus {
    outline: 3px solid rgba(22,163,74,0.5);
    outline-offset: 3px;
}

/* pulse ring */
.pa-widget-toggle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(22,163,74,0.45);
    animation: pa-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes pa-pulse {
    0%   { transform: scale(1);   opacity: .8; }
    70%  { transform: scale(1.5); opacity: 0;  }
    100% { transform: scale(1.5); opacity: 0;  }
}

.pa-floating-widget.pa-is-open .pa-widget-toggle::after {
    animation: none;
    opacity: 0;
}

/* ── Ikon di dalam tombol ── */
.pa-toggle-icon-open,
.pa-toggle-icon-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    transition: opacity .2s ease, transform .2s ease;
}

.pa-toggle-icon-close {
    opacity: 0;
    transform: rotate(-90deg);
}

.pa-floating-widget.pa-is-open .pa-toggle-icon-open {
    opacity: 0;
    transform: rotate(90deg);
}

.pa-floating-widget.pa-is-open .pa-toggle-icon-close {
    opacity: 1;
    transform: rotate(0deg);
}

/* ── Label teks di bawah tombol ── */
.pa-toggle-label {
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-align: center;
    background: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
}

/* ── Panel: muncul ke KIRI tombol ── */
.pa-widget-panel {
    position: absolute;
    bottom: 0;
    right: calc(100% + 14px);
    width: 300px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
    overflow: hidden;
    opacity: 0;
    transform: translateX(12px) scale(.97);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity .28s ease, transform .28s ease;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
}

.pa-floating-widget.pa-is-open .pa-widget-panel {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

/* ── Header ── */
.pa-widget-header {
    background: linear-gradient(135deg, #16a34a, #15803d);
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pa-header-icon { display: flex; align-items: center; flex-shrink: 0; }

.pa-widget-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    flex: 1;
}

.pa-widget-close-btn {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    font-size: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
    line-height: 1;
}
.pa-widget-close-btn:hover { background: rgba(255,255,255,.35); }

/* ── Body ── */
.pa-widget-body {
    padding: 10px 14px;
    overflow-y: auto;
    flex: 1;
}

.pa-contact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.pa-contact-item:last-child { border-bottom: none; }

.pa-contact-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.pa-contact-value {
    font-size: 13px;
    color: #1f2937;
    line-height: 1.5;
    font-weight: 500;
}

.pa-contact-link {
    font-size: 13px;
    color: #15803d;
    text-decoration: none;
    font-weight: 600;
    transition: color .2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pa-contact-link:hover { color: #166534; text-decoration: underline; }
.pa-whatsapp-link { color: #16a34a; }

/* ── Footer CTA ── */
.pa-widget-footer {
    padding: 10px 14px 12px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.pa-cta-button {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff !important;
    text-decoration: none !important;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: background .25s, transform .15s, box-shadow .25s;
    box-shadow: 0 2px 8px rgba(22,163,74,.35);
}
.pa-cta-button:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22,163,74,.5);
}

/* ── Posisi KANAN (default) ── */
#pa-floating-widget.pa-pos-right {
    right: var(--pa-h-offset, 20px);
    left: auto;
    align-items: center;
}
#pa-floating-widget.pa-pos-right .pa-widget-panel {
    right: calc(100% + 14px);
    left: auto;
    transform-origin: bottom right;
}

/* ── Posisi KIRI ── */
#pa-floating-widget.pa-pos-left {
    left: var(--pa-h-offset, 20px);
    right: auto;
    align-items: center;
}
#pa-floating-widget.pa-pos-left .pa-widget-panel {
    left: calc(100% + 14px);
    right: auto;
    transform-origin: bottom left;
    transform: translateX(-12px) scale(.97);
}
#pa-floating-widget.pa-pos-left.pa-is-open .pa-widget-panel {
    transform: translateX(0) scale(1);
}

/* ── Posisi TENGAH ── */
#pa-floating-widget.pa-pos-center {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    align-items: center;
}
#pa-floating-widget.pa-pos-center .pa-widget-panel {
    left: 50%;
    right: auto;
    bottom: calc(100% + 12px);
    transform: translateX(-50%) translateY(10px) scale(.97);
    transform-origin: bottom center;
}
#pa-floating-widget.pa-pos-center.pa-is-open .pa-widget-panel {
    transform: translateX(-50%) translateY(0) scale(1);
}

/* ── Mobile ── */
@media (max-width: 560px) {
    .pa-widget-panel {
        width: calc(100vw - 24px);
        right: auto !important;
        left: auto !important;
        bottom: calc(100% + 10px) !important;
        transform: translateY(10px) scale(.97) !important;
    }
    .pa-floating-widget.pa-is-open .pa-widget-panel {
        transform: translateY(0) scale(1) !important;
    }
    #pa-floating-widget {
        right: 12px !important;
        left: auto !important;
        transform: none !important;
    }
}
