/* =====================================================
   IWT Directory — Checkout Styles
   ===================================================== */

/* ── Plan Selector ─────────────────────────────────── */
#iwt-plan-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.iwt-plan-card {
    position: relative;
    background: #ffffff;
    border: 2px solid #e2e6f0;
    border-radius: 12px;
    padding: 20px 18px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    user-select: none;
}

.iwt-plan-card:hover {
    border-color: #ff6b35;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,53,.12);
}

.iwt-plan-card.selected {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255,107,53,.15), 0 6px 20px rgba(255,107,53,.12);
}

.iwt-plan-popular-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff6b35;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: .04em;
}

.iwt-plan-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.iwt-plan-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #ff6b35;
    cursor: pointer;
    flex-shrink: 0;
}

.iwt-plan-name {
    font-family: 'Syne', sans-serif;
    font-size: 17px;
    font-weight: 800;
    color: #1a1f2e;
    letter-spacing: -.01em;
}

.iwt-plan-price {
    margin-top: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.iwt-plan-amount {
    font-family: 'Syne', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #1a1f2e;
    letter-spacing: -.02em;
    line-height: 1;
}

.iwt-plan-cycle {
    font-size: 13px;
    color: #6b778e;
}

.iwt-plan-desc {
    font-size: 13px;
    color: #6b778e;
    margin-bottom: 12px;
    line-height: 1.5;
}

.iwt-plan-features-mini {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.iwt-pf-item {
    font-size: 12px;
    color: #4a5268;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Payment Section ────────────────────────────────── */
#iwt-payment-section {
    background: #f8f9fc;
    border: 1px solid #e2e6f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    animation: iwt-fade-in .25s ease;
}

@keyframes iwt-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Gateway Tabs ───────────────────────────────────── */
.iwt-gateway-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.iwt-gateway-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1.5px solid #e2e6f0;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #6b778e;
    cursor: pointer;
    transition: all .2s;
}

.iwt-gateway-tab:hover {
    border-color: #ff6b35;
    color: #ff6b35;
}

.iwt-gateway-tab.active {
    background: #fff2ec;
    border-color: #ff6b35;
    color: #ff6b35;
}

.iwt-gateway-tab img {
    height: 20px;
    width: auto;
}

/* ── Stripe Card Element ────────────────────────────── */
.iwt-stripe-label {
    font-size: 13px;
    font-weight: 600;
    color: #343a4f;
    margin-bottom: 8px;
    display: block;
}

#iwt-card-element {
    background: #ffffff;
    border: 1.5px solid #e2e6f0;
    border-radius: 8px;
    padding: 14px 16px;
    transition: border-color .2s, box-shadow .2s;
}

#iwt-card-element.StripeElement--focus {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255,107,53,.12);
}

#iwt-card-element.StripeElement--invalid {
    border-color: #ef4444;
}

#iwt-card-errors {
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}

.iwt-secure-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 11px;
    color: #9aa4bc;
}

.iwt-secure-badge svg {
    width: 13px;
    height: 13px;
    color: #22c55e;
}

/* ── PayPal Panel ───────────────────────────────────── */
#iwt-gateway-paypal {
    display: none;
}

#iwt-paypal-buttons {
    min-height: 50px;
}

/* ── Expiry Notice (Free Plan) ──────────────────────── */
.iwt-free-expiry-notice {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
}

.iwt-free-expiry-notice .notice-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Upgrade Modal ──────────────────────────────────── */
#iwt-upgrade-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(26,31,46,.65);
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}

#iwt-upgrade-modal.active,
#iwt-upgrade-modal[style*="display: flex"] {
    display: flex !important;
}

.iwt-upgrade-modal-inner {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(26,31,46,.3);
    position: relative;
    animation: iwt-modal-in .25s ease;
}

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

.iwt-upgrade-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.iwt-upgrade-modal-title {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #1a1f2e;
    letter-spacing: -.02em;
}

.iwt-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #e2e6f0;
    background: #f8f9fc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #6b778e;
    transition: all .2s;
    flex-shrink: 0;
}

.iwt-modal-close:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #ef4444;
}

.iwt-upgrade-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f2f8;
    gap: 12px;
}

/* ── Listing Expiry Status Banner ───────────────────── */
.iwt-expiry-banner {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.iwt-expiry-banner.expires-soon {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.iwt-expiry-banner.expired {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.iwt-expiry-banner.active {
    background: #f0fdf4;
    border: 1px solid #22c55e;
    color: #166534;
}

.iwt-expiry-banner .expiry-text {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
    #iwt-plan-selector { grid-template-columns: 1fr; }
    .iwt-gateway-tabs  { flex-direction: column; }
    .iwt-upgrade-modal-inner { padding: 20px; border-radius: 12px; }
    .iwt-upgrade-actions { flex-direction: column-reverse; }
    .iwt-upgrade-actions .iwt-btn { width: 100%; justify-content: center; }
}
