/* ── Pacy CTA Frontend ── */

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

.pacy-cta-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
}

.pacy-cta-trigger:active {
    transform: translateY(0);
}

.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 {
    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;
}

/* Action Item */
.pacy-cta-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.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;
    }
}
