/**
 * Veleiras — Payment Modal Styles
 * Dark theme, consistent with veleiras.css
 */

/* ── Overlay ── */
.pm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 300ms ease;
}
.pm-overlay.pm-active {
    opacity: 1;
}

/* ── Dialog ── */
.pm-dialog {
    background: #0f1219;
    border: 1px solid var(--ash, #1e2030);
    border-radius: 16px;
    max-width: 880px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.pm-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-whisper, #64748b);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 4px;
    z-index: 2;
}
.pm-close-btn:hover {
    color: var(--text-primary, #f1f5f9);
}

/* ── Grid ── */
.pm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
@media (max-width: 640px) {
    .pm-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Left Column: Product Summary ── */
.pm-col-left {
    padding: 40px 32px;
    border-right: 1px solid var(--ash, #1e2030);
}
@media (max-width: 640px) {
    .pm-col-left {
        border-right: none;
        border-bottom: 1px solid var(--ash, #1e2030);
        padding: 24px;
    }
}

.pm-product-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-primary, #f1f5f9);
    margin: 0 0 8px;
}
.pm-product-desc {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0 0 24px;
}

/* Summary box */
.pm-summary-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ash, #1e2030);
    border-radius: 10px;
    padding: 16px;
}
.pm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9375rem;
    color: var(--text-secondary, #94a3b8);
}
.pm-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 4px;
    border-top: 1px solid var(--ash, #1e2030);
    margin-top: 8px;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
}
.pm-tax-percent {
    font-size: 0.75rem;
    color: var(--text-whisper, #64748b);
}

/* ── Right Column: Payment Form ── */
.pm-col-right {
    padding: 40px 32px;
    position: relative;
}
@media (max-width: 640px) {
    .pm-col-right {
        padding: 24px;
    }
}

.pm-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pm-stripe-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--ash, #1e2030);
    border-radius: 8px;
    padding: 12px;
    min-height: 44px;
}

/* VAT ID field */
.pm-input-field {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--ash, #1e2030);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #f1f5f9);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s;
}
.pm-input-field:focus {
    border-color: var(--flame-warm, #ffd93d);
}

/* ── Legal Checkboxes ── */
.pm-legal-group {
    margin-top: 16px;
}
.pm-legal-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}
.pm-legal-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--flame-warm, #ffd93d);
    margin-top: 2px;
    flex-shrink: 0;
}
.pm-legal-item span {
    font-size: 0.8125rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.5;
}
.pm-legal-item a {
    color: var(--flame-warm, #ffd93d);
    text-decoration: underline;
}

/* ── Pay Button ── */
.pm-pay-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px 24px;
    border: 1px solid rgba(244,166,35,0.40);
    border-radius: var(--btn-radius, 6px);
    background: linear-gradient(135deg, rgba(244,166,35,0.90), rgba(232,117,26,0.85));
    color: #0A0A0F;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 200ms ease, box-shadow 600ms ease, transform 200ms ease;
    position: relative;
    box-shadow: 0 0 20px rgba(244,166,35,0.18);
}
.pm-pay-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255,217,61,0.95), rgba(244,166,35,0.90));
    box-shadow: 0 0 32px rgba(244,166,35,0.28), 0 0 8px rgba(244,166,35,0.15);
    transform: translateY(-1px);
}
.pm-pay-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.pm-pay-btn .pm-spinner {
    display: none;
}
.pm-pay-btn.pm-loading .pm-btn-text {
    visibility: hidden;
}
.pm-pay-btn.pm-loading .pm-spinner {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #0A0A0F;
    border-top-color: transparent;
    border-radius: 50%;
    animation: pm-spin 0.6s linear infinite;
}
@keyframes pm-spin {
    to { transform: rotate(360deg); }
}

/* ── Loader ── */
.pm-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f1219;
    border-radius: 16px;
    z-index: 3;
}
.pm-loader-icon {
    width: 32px;
    height: 32px;
    border: 3px solid var(--ash, #1e2030);
    border-top-color: var(--flame-warm, #ffd93d);
    border-radius: 50%;
    animation: pm-spin 0.8s linear infinite;
}

/* Error */
.pm-error-msg {
    color: var(--error, #ef4444);
    font-size: 0.875rem;
    margin-top: 8px;
    min-height: 20px;
}

/* ── Secure note ── */
.pm-secure-note {
    text-align: center;
    color: var(--text-whisper, #64748b);
    font-size: 0.75rem;
    margin-top: 12px;
}

/* ── Success overlay ── */
.pm-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(10, 14, 23, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pm-success-dialog {
    text-align: center;
    max-width: 400px;
    padding: 48px 32px;
}
.pm-success-flame {
    font-size: 4rem;
    margin-bottom: 24px;
    animation: flame-glow 3s ease-in-out infinite;
}
@keyframes flame-glow {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(255, 217, 61, 0.3)); }
    50% { filter: drop-shadow(0 0 24px rgba(255, 217, 61, 0.6)); }
}
.pm-success-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 12px;
}
.pm-success-text {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 32px;
}
/* ── Checkout Page ── */
.checkout-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
}
.checkout-hero {
    text-align: center;
    margin-bottom: 40px;
}
.checkout-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 2.25rem;
    color: var(--text-primary, #f1f5f9);
    margin: 0;
}
.checkout-subtitle {
    color: var(--text-secondary, #94a3b8);
    font-size: 1.0625rem;
    margin-top: 12px;
    line-height: 1.6;
}
.checkout-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--ash, #1e2030);
    border-radius: 16px;
    padding: 36px 40px;
    max-width: 540px;
    width: 100%;
}
.checkout-includes {
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-whisper, #64748b);
    margin: 0 0 20px;
}
.checkout-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: 32px;
}
.checkout-feature {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.45;
}
.checkout-check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--flame-warm, #ffd93d);
    margin-top: 1px;
}
.checkout-price-block {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--ash, #1e2030);
}
.checkout-price {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    margin: 0;
}
.checkout-price-label {
    color: var(--text-whisper, #64748b);
    font-size: 0.875rem;
    margin: 4px 0 0;
}
.checkout-secure {
    text-align: center;
    color: var(--text-whisper, #64748b);
    font-size: 0.75rem;
    margin-top: 12px;
}
.checkout-cooling {
    text-align: center;
    color: var(--text-whisper, #64748b);
    font-size: 0.75rem;
    line-height: 1.5;
    margin-top: 16px;
}
.checkout-guarantee {
    text-align: center;
    color: var(--text-whisper, #64748b);
    font-size: 0.6875rem;
    line-height: 1.5;
    margin-top: 12px;
    opacity: 0.7;
}
@media (max-width: 560px) {
    .checkout-page { padding: 80px 16px 40px; }
    .checkout-title { font-size: 1.75rem; }
    .checkout-card { padding: 28px 24px; }
    .checkout-features { grid-template-columns: 1fr; gap: 10px; }
}

.pm-success-btn {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, rgba(244,166,35,0.90), rgba(232,117,26,0.85));
    color: #0A0A0F;
    font-weight: 600;
    border: 1px solid rgba(244,166,35,0.40);
    border-radius: var(--btn-radius, 6px);
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    box-shadow: 0 0 20px rgba(244,166,35,0.18);
}
