/*
 * WP Payment Plugin — Tour Integration Styles
 */

/* ── Pattern 1: Consultation + Purchase side-by-side ─────────────────────── */

.wpp-btn-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.wpp-btn-group .xmct-tp-service-btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 13px !important;
}

.wpp-btn-group .wpp-btn-consult:hover {
    opacity: 0.88;
}

.wpp-btn-group .wpp-btn-purchase {
    background: transparent !important;
    color: #0F5FC0 !important;
    box-shadow: none !important;
    outline: 2px solid #0F5FC0 !important;
    outline-offset: -2px !important;
}

.wpp-btn-group .wpp-btn-purchase:hover {
    background: #0F5FC0 !important;
    color: #fff !important;
    outline-color: #0F5FC0 !important;
}

/* ── Pattern 2: Subscription — native price heading + purchase button ────── */

.wpp-sub-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    margin-top: 8px;
}

/* Zero out any bottom spacing xmct applies to the native price element only
   when it directly precedes our button group — leaves all other cards untouched. */
.xmct-tp-service-price:has(+ .wpp-sub-group) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Purchase button — full width */
.wpp-sub-group .wpp-sub-purchase-btn {
    width: 100% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .wpp-btn-group {
        flex-direction: column;
    }
    .wpp-btn-group .xmct-tp-service-btn {
        white-space: normal !important;
    }
    .wpp-sub-price-amount {
        font-size: 13px;
    }
    .wpp-sub-badge,
    .wpp-sub-discount {
        font-size: 10px;
        padding: 1px 5px;
    }
}

/* ── Info icon ───────────────────────────────────────────────────────────── */

.wpp-info-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #B0BFD0;
    transition: color 0.15s;
    line-height: 0;
    z-index: 2;
}

.wpp-info-icon:hover { color: #0F5FC0; }

.wpp-info-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* ── Preview modal ───────────────────────────────────────────────────────── */

.wpp-preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.wpp-preview-modal--open {
    display: flex;
}

.wpp-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    animation: wpp-fade-in 0.2s ease;
}

.wpp-preview-dialog {
    position: relative;
    width: 80vw;
    height: 85vh;
    max-width: 1100px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wpp-slide-up 0.22s ease;
    z-index: 1;
}

.wpp-preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255,255,255,0.9);
    border: 1px solid #E2E8F0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7C93;
    z-index: 2;
    transition: background 0.15s, color 0.15s;
}

.wpp-preview-close:hover {
    background: #fff;
    color: #2F3B52;
}

.wpp-preview-close svg {
    width: 14px;
    height: 14px;
    display: block;
}

.wpp-preview-iframe-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.wpp-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    color: #6B7C93;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F8FAFC;
}

.wpp-preview-loading::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid #E2E8F0;
    border-top-color: #0F5FC0;
    border-radius: 50%;
    animation: wpp-spin 0.7s linear infinite;
}

@keyframes wpp-spin {
    to { transform: rotate(360deg); }
}

.wpp-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.2s;
}

@keyframes wpp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes wpp-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .wpp-preview-dialog {
        width: 95vw;
        height: 90vh;
    }
}
