/* ── Pacy CTA Frontend ── */

/* Sticky Trigger Button */
.pacy-cta-trigger {
    all: unset !important;
    box-sizing: border-box !important;
    position: fixed !important;
    bottom: 24px !important;
    z-index: 99998 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: var(--pacy-cta-btn-padding, 14px 28px) !important;
    margin: 0 !important;
    background: var(--pacy-cta-color, #dc2626) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50px !important;
    cursor: pointer !important;
    font-size: var(--pacy-cta-btn-font-size, 16px) !important;
    font-weight: 600 !important;
    font-family: 'Kanit', sans-serif !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    line-height: 1.3 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Flash / pulse animation */
@keyframes pacy-cta-pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 0 var(--pacy-cta-color, #dc2626) !important;
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 12px rgba(220, 38, 38, 0) !important;
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(220, 38, 38, 0) !important;
    }
}

.pacy-cta-trigger.pacy-cta-flash {
    animation: pacy-cta-pulse var(--pacy-cta-flash-speed, 2s) ease-in-out infinite !important;
}

.pacy-cta-trigger.pacy-cta-flash:hover {
    animation: none !important;
}

.pacy-cta-trigger:hover {
    background: var(--pacy-cta-color, #dc2626) !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3) !important;
    opacity: 0.9 !important;
}

.pacy-cta-trigger:active {
    background: var(--pacy-cta-color, #dc2626) !important;
    color: #fff !important;
    transform: translateY(0) !important;
}

.pacy-cta-trigger:focus {
    background: var(--pacy-cta-color, #dc2626) !important;
    color: #fff !important;
    outline: none !important;
}

.pacy-cta-trigger.pacy-cta-right {
    right: 24px;
}

.pacy-cta-trigger.pacy-cta-left {
    left: 24px;
}

.pacy-cta-trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pacy-cta-trigger-icon .pacy-icon {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.pacy-cta-trigger-icon .pacy-icon path {
    fill: #fff;
}

/* ── Popup Card ── */
.pacy-cta-card {
    all: unset;
    box-sizing: border-box;
    position: fixed;
    bottom: 90px;
    z-index: 99999;
    width: 320px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    font-family: 'Kanit', sans-serif;
}

.pacy-cta-card[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.pacy-cta-card.pacy-cta-right {
    right: 24px;
}

.pacy-cta-card.pacy-cta-left {
    left: 24px;
}

/* Card Header */
.pacy-cta-card-header {
    background: var(--pacy-cta-color, #dc2626);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pacy-cta-card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.pacy-cta-card-close {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
}

.pacy-cta-card-close svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    pointer-events: none;
}

.pacy-cta-card-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* Card Body */
.pacy-cta-card-body {
    padding: 0;
}

/* Reset all plugin elements */
.pacy-cta-card *,
.pacy-cta-trigger * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Action Item */
.pacy-cta-item {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    line-height: 1.3;
}

.pacy-cta-item:last-child {
    border-bottom: none;
}

.pacy-cta-item:hover {
    background: #f8f8f8;
}

.pacy-cta-item-icon-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
}

.pacy-cta-item-icon-left .pacy-icon {
    width: 28px;
    height: 28px;
    fill: #555;
}

.pacy-cta-item-icon-left .pacy-icon path {
    fill: #555;
}

.pacy-cta-item-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pacy-cta-item-headline {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}

.pacy-cta-item-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.4;
}

.pacy-cta-item-icon-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.pacy-cta-item-icon-right .pacy-icon {
    width: 14px;
    height: 14px;
    fill: #bbb;
}

.pacy-cta-item-icon-right .pacy-icon path {
    fill: #bbb;
}

/* Card Footer */
.pacy-cta-card-footer {
    padding: 0px 20px;
    text-align: center;
    font-size: 10px;
    color: #bbb;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.pacy-cta-footer-logo {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/* ── Backdrop / overlay for mobile ── */
.pacy-cta-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99997;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.pacy-cta-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Mobile adjustments ── */
@media (max-width: 480px) {
    .pacy-cta-trigger {
        bottom: 16px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .pacy-cta-trigger.pacy-cta-right {
        right: 16px;
    }

    .pacy-cta-trigger.pacy-cta-left {
        left: 16px;
    }

    .pacy-cta-card {
        bottom: 80px;
        width: calc(100vw - 32px);
        max-width: none;
    }

    .pacy-cta-card.pacy-cta-right {
        right: 16px;
    }

    .pacy-cta-card.pacy-cta-left {
        left: 16px;
    }
}
