/* =========================================================
   WF WhatsApp Forms — WooCommerce Integration Styles
   ========================================================= */

/* ── WC Pay button inside form footer ─────────────────────── */

.wf-wc-pay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s ease, transform .1s ease;
    width: 100%;
}

.wf-wc-pay-btn:hover {
    filter: brightness(1.08);
}

.wf-wc-pay-btn:active {
    transform: scale(.98);
}

/* ── Popup in checkout mode (expanded height) ──────────────── */

.wf-wc-popup-checkout .wf-popup-modal {
    max-height: 92vh;
    height: 92vh;
    width: min(680px, 96vw);
    display: flex;
    flex-direction: column;
}

.wf-wc-popup-checkout .wf-popup-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

/* ── Checkout iframe wrapper ──────────────────────────────── */

.wf-wc-iframe-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

.wf-wc-iframe-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: #666;
    font-size: 14px;
}

.wf-wc-checkout-iframe {
    flex: 1;
    width: 100%;
    border: none;
    min-height: 480px;
    background: #fff;
}

/* ── WA countdown block ───────────────────────────────────── */

/* ── Blocking WA modal ────────────────────────────────────── */

.wf-wc-wa-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 16px;
    box-sizing: border-box;
    transition: opacity .3s ease;
}

.wf-wc-wa-modal--dismissed {
    opacity: 0;
    pointer-events: none;
}

.wf-wc-wa-modal-inner {
    background: #fff;
    border-radius: 20px;
    padding: 36px 28px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: wf-modal-in .35s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes wf-modal-in {
    from { opacity: 0; transform: scale(.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

.wf-wc-wa-modal-icon {
    width: 72px;
    height: 72px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 24px rgba(37,211,102,.4);
    flex-shrink: 0;
}

.wf-wc-wa-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.wf-wc-wa-modal-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #9a3412;
    line-height: 1.4;
}

.wf-wc-wa-modal-hint {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* The main CTA button — an <a> so mobile opens the app reliably */
.wf-wc-wa-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: #25D366;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(37,211,102,.4);
    cursor: pointer;
    transition: background .15s, transform .1s;
    width: 100%;
    box-sizing: border-box;
}

.wf-wc-wa-modal-btn:hover,
.wf-wc-wa-modal-btn:focus {
    background: #1da851;
    color: #fff;
    text-decoration: none;
    outline: 3px solid rgba(37,211,102,.5);
}

.wf-wc-wa-modal-btn:active { transform: scale(.97); }

/* Pulse animation — immediate, always on */
.wf-wc-wa-btn--pulse {
    animation: wf-wc-btn-pulse 1.1s ease-in-out infinite;
}

@keyframes wf-wc-btn-pulse {
    0%   { box-shadow: 0 0 0 0    rgba(37,211,102,.7); }
    60%  { box-shadow: 0 0 0 16px rgba(37,211,102,0);  }
    100% { box-shadow: 0 0 0 0    rgba(37,211,102,0);  }
}

.wf-wc-wa-modal-after {
    font-size: 13px;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 16px 0 0;
}

.wf-wc-wa-resend-text {
    display: block;
    text-align: center;
}

.wf-wc-wa-modal-close-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 7px 20px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: background .15s;
}

.wf-wc-wa-modal-close-btn:hover { background: #f3f4f6; }

/* Resend link — looks like the main WA button but smaller */
.wf-wc-wa-resend-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25D366;
    color: #fff;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    opacity: .85;
    transition: opacity .15s;
}
.wf-wc-wa-resend-link svg { flex-shrink: 0; }
.wf-wc-wa-resend-link:hover { opacity: 1; color: #fff; }

/* Confirmation block inside popup success screen */
.wf-wc-wa-confirm-block {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ── Admin: WC metabox tweaks ─────────────────────────────── */

.wf-waf-order-meta table th {
    font-weight: 600;
}

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

@media (max-width: 480px) {
    .wf-wc-wa-modal-inner {
        padding: 28px 18px 22px;
        border-radius: 16px;
    }
    .wf-wc-wa-modal-title { font-size: 16px; }
    .wf-wc-wa-modal-btn   { font-size: 14px; padding: 13px 18px; }

    .wf-wc-popup-checkout .wf-popup-modal {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* ── wc_quantity stepper ──────────────────────────────────── */

.wf-wc-qty-wrap { }

.wf-wc-qty-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
    max-width: 160px;
}

.wf-wc-qty-btn {
    flex-shrink: 0;
    width: 38px;
    height: 40px;
    background: #f5f5f5;
    border: none;
    font-size: 20px;
    font-weight: 300;
    color: #444;
    cursor: pointer;
    line-height: 1;
    transition: background .12s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wf-wc-qty-btn:hover { background: #e8e8e8; }
.wf-wc-qty-btn:active { background: #ddd; }

.wf-wc-qty-input {
    flex: 1;
    min-width: 0;
    border: none !important;
    border-left: 1px solid #d0d5dd !important;
    border-right: 1px solid #d0d5dd !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 6px 4px !important;
    -moz-appearance: textfield;
}
.wf-wc-qty-input::-webkit-outer-spin-button,
.wf-wc-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── wc_coupon field ──────────────────────────────────────── */

.wf-wc-coupon-wrap { }

.wf-wc-coupon-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wf-wc-coupon-input {
    flex: 1;
    letter-spacing: .06em;
    font-weight: 600;
}

.wf-wc-coupon-status {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    transition: opacity .2s ease;
}

.wf-wc-coupon-status--valid   { color: #16a34a; }
.wf-wc-coupon-status--invalid { color: #dc2626; }
.wf-wc-coupon-status--loading { opacity: .5; }

.wf-wc-coupon-hint {
    margin: 4px 0 0 !important;
    font-size: 11px !important;
}

.wf-wc-coupon-discount {
    font-size: 12px;
    font-weight: 700;
    color: #16a34a;
    margin-top: 2px;
}
