/* ============================================================
   Custom Payment Page — Classic Checkout Layout
   Single page: Billing → Payment → Place Order
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
    --f: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --text: #1a1a1a;
    --text2: #555;
    --text3: #999;
    --border: #ddd;
    --bg: #f5f5f5;
    --white: #fff;
    --green: #4ab866;
    --green-dark: #3a9e56;
    --red: #e74c3c;
    --radius: 4px;
    --tr: .15s ease;
}

/* ---- Body ---- */
.cpp-body {
    margin: 0;
    padding: 0;
    background: var(--white);
    font-family: var(--f);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Hide theme header/footer */
.cpp-body #masthead,
.cpp-body .site-header,
.cpp-body .site-footer,
.cpp-body .whb-header,
.cpp-body .wd-header,
.cpp-body .website-wrapper > header,
.cpp-body .website-wrapper > footer,
.cpp-body footer.site-footer,
.cpp-body .woodmart-prefooter,
.cpp-body .copyrights-wrapper,
.cpp-body .return-to-shop { display: none !important; }

/* ================================================================== */
/*  Green notification bar                                             */
/* ================================================================== */
.cpp-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--green);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.cpp-notice a {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    margin-left: auto;
}

/* ================================================================== */
/*  Page layout                                                        */
/* ================================================================== */
.cpp-page {
    display: flex;
    gap: 48px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 32px 60px;
    align-items: flex-start;
}

.cpp-main {
    flex: 1;
    min-width: 0;
    max-width: 640px;
}

.cpp-sidebar {
    flex: 0 0 340px;
    position: sticky;
    top: 24px;
}

/* ================================================================== */
/*  Sections (Billing, Payment)                                        */
/* ================================================================== */
.cpp-section {
    margin-bottom: 36px;
}

.cpp-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 24px;
    color: var(--text);
}

.cpp-section__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--text);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
}

.cpp-section__footer {
    margin-top: 8px;
}

.cpp-link-back {
    font-size: 14px;
    color: var(--text2);
    text-decoration: none;
    transition: color var(--tr);
}

.cpp-link-back:hover { color: var(--text); }

/* ================================================================== */
/*  Form fields                                                        */
/* ================================================================== */
.cpp-field {
    margin-bottom: 16px;
}

.cpp-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.cpp-req { color: var(--red); }

.cpp-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-family: var(--f);
    font-size: 15px;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--tr), box-shadow var(--tr);
    outline: none;
    appearance: none;
}

.cpp-input::placeholder { color: var(--text3); }
.cpp-input:focus { border-color: #333; box-shadow: 0 0 0 1px #333; }
.cpp-input.is-invalid { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }

/* Select */
.cpp-select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Rows */
.cpp-row { display: flex; gap: 16px; }
.cpp-row .cpp-field { flex: 1; }

/* ================================================================== */
/*  Payment method                                                     */
/* ================================================================== */
.cpp-payment-method {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.cpp-payment-method__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.cpp-payment-method__badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cpp-badge {
    font-size: 11px;
    color: var(--text3);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Radio */
.cpp-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.cpp-radio input { display: none; }

.cpp-radio__dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border);
    position: relative;
    transition: border-color var(--tr);
}

.cpp-radio input:checked + .cpp-radio__dot {
    border-color: #333;
}

.cpp-radio input:checked + .cpp-radio__dot::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #333;
}

/* Card form inside payment method */
.cpp-card-form {
    padding: 20px 16px;
}

/* Card number with brand */
.cpp-input-wrap { position: relative; }

.cpp-input--card {
    padding-right: 56px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .03em;
}

.cpp-brand-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.cpp-brand-icon .brand-visa,
.cpp-brand-icon .brand-mastercard,
.cpp-brand-icon .brand-amex { display: none; }

.cpp-brand-icon[data-brand="visa"] .brand-visa,
.cpp-brand-icon[data-brand="mastercard"] .brand-mastercard,
.cpp-brand-icon[data-brand="amex"] .brand-amex { display: block; }

.cpp-brand-icon span svg { width: 34px; height: 22px; }
.cpp-brand-icon span img { width: 34px; height: 22px; }

/* CVC hint icon */
.cpp-cvc-hint {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: help;
    line-height: 1;
}

/* Encrypted note */
.cpp-encrypted {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text2);
}

/* ================================================================== */
/*  Alert                                                              */
/* ================================================================== */
.cpp-alert {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #9e1c34;
    background: #fff0f3;
    border: 1px solid #fecdd3;
    border-radius: var(--radius);
}

.cpp-alert.is-visible { display: flex; }
.cpp-alert svg { flex-shrink: 0; margin-top: 1px; }
.cpp-alert__messages { flex: 1; }
.cpp-alert__messages p { margin: 0 0 2px; }
.cpp-alert__messages p:last-child { margin: 0; }

/* ================================================================== */
/*  Privacy note                                                       */
/* ================================================================== */
.cpp-privacy {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.6;
    margin: 0 0 20px;
}

.cpp-privacy a {
    color: var(--green-dark);
    text-decoration: underline;
}

/* ================================================================== */
/*  Place Order button                                                 */
/* ================================================================== */
.cpp-place-order {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    font-family: var(--f);
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    background: #bbb;
    border: none;
    border-radius: var(--radius);
    cursor: not-allowed;
    transition: background .3s ease, transform .1s ease, box-shadow .3s ease;
    overflow: hidden;
}

.cpp-place-order.is-ready {
    background: var(--green);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(74, 184, 102, .4);
}

.cpp-place-order.is-ready:hover { background: var(--green-dark); }
.cpp-place-order.is-ready:active { transform: scale(.985); }
.cpp-place-order:disabled:not(.is-ready) { opacity: 1; }

.cpp-place-order__label { transition: opacity var(--tr); }
.cpp-place-order.is-loading .cpp-place-order__label { opacity: 0; }
.cpp-place-order.is-loading .cpp-place-order__spinner { opacity: 1; }

.cpp-place-order__spinner {
    position: absolute;
    width: 22px; height: 22px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cppSpin .55s linear infinite;
    opacity: 0;
    transition: opacity var(--tr);
}

@keyframes cppSpin { to { transform: rotate(360deg); } }

/* ================================================================== */
/*  Sidebar — YOUR ORDER                                               */
/* ================================================================== */
.cpp-sidebar__inner {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
}

.cpp-sidebar__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

/* Order items */
.cpp-order-items {
    padding: 16px 20px;
}

.cpp-order-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
}

.cpp-order-item + .cpp-order-item {
    border-top: 1px solid #eee;
}

.cpp-order-item__img {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg);
}

.cpp-order-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cpp-order-item__info { flex: 1; min-width: 0; }

.cpp-order-item__name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 4px;
}

.cpp-order-item__meta {
    font-size: 13px;
    color: var(--text2);
}

.cpp-order-item__qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.cpp-order-item__subtotal {
    font-size: 13px;
    color: var(--text2);
    margin-top: 2px;
}

/* Order totals */
.cpp-order-totals {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

.cpp-order-totals__row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: var(--text2);
}

.cpp-order-totals__row--total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.cpp-order-totals__row--total span:last-child {
    font-size: 20px;
}

/* Safe & Secure Checkout */
.cpp-safe-checkout {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.cpp-safe-checkout__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text3);
    margin-bottom: 10px;
}

.cpp-safe-checkout__cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ================================================================== */
/*  Empty state                                                        */
/* ================================================================== */
.cpp-empty {
    text-align: center;
    padding: 100px 24px;
    max-width: 400px;
    margin: 0 auto;
}

.cpp-empty__icon {
    width: 64px; height: 64px;
    margin: 0 auto 20px;
    background: #f0eeff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpp-empty h2 { font-size: 20px; margin: 0 0 8px; }
.cpp-empty p { font-size: 15px; color: var(--text2); margin: 0 0 24px; }

.cpp-empty__btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--f);
    font-size: 14px;
    font-weight: 600;
    color: var(--green-dark);
    border: 1.5px solid var(--green);
    border-radius: var(--radius);
    text-decoration: none;
    transition: background var(--tr);
}

.cpp-empty__btn:hover { background: rgba(74,184,102,.06); }

/* ================================================================== */
/*  Responsive                                                         */
/* ================================================================== */
@media (max-width: 860px) {
    .cpp-page {
        flex-direction: column-reverse;
        padding: 24px 16px 48px;
        gap: 24px;
    }

    .cpp-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .cpp-main { max-width: 100%; }
    .cpp-notice { padding: 12px 16px; font-size: 13px; }
}

@media (max-width: 480px) {
    .cpp-row { flex-direction: column; gap: 0; }
}

/* ================================================================== */
/*  Modal — exact copy from style.css                                  */
/* ================================================================== */
.modal {
    background-color: #00000062;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0; left: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.modal.is-visible {
    display: flex;
}

.modal .modal-container {
    background-color: #fff;
    width: 400px;
    min-height: 450px;
    border-radius: 3px;
    padding-top: 10px;
    font-family: Arial, Helvetica, sans-serif;
}

.modal .modal-container .logos {
    display: flex;
    justify-content: space-between;
    padding-left: 30px;
    padding-right: 30px;
    align-items: center;
    height: 50px;
}

.modal .modal-container .logos img {
    width: 50px;
}

.modal .modal-container hr {
    border: none;
    border-top: 1px solid #e5e5e5;
}

.hidden { display: none !important; }

/* Screen 1: Processing */
.text {
    color: #424242;
    font-size: 12px;
    text-align: center;
    margin-top: 25px;
}

.loader {
    position: relative;
    width: 28px;
    height: 28px;
    margin: 24px auto 0;
}

.loader span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #c8c8c8;
    border-radius: 50%;
    animation: dotFade 1s infinite linear;
}

.loader span:nth-child(1) { top: 0;     left: 12px;  animation-delay: 0s; }
.loader span:nth-child(2) { top: 3px;   left: 21px;  animation-delay: -.875s; }
.loader span:nth-child(3) { top: 12px;  left: 24px;  animation-delay: -.75s; }
.loader span:nth-child(4) { top: 21px;  left: 21px;  animation-delay: -.625s; }
.loader span:nth-child(5) { top: 24px;  left: 12px;  animation-delay: -.5s; }
.loader span:nth-child(6) { top: 21px;  left: 3px;   animation-delay: -.375s; }
.loader span:nth-child(7) { top: 12px;  left: 0;     animation-delay: -.25s; }
.loader span:nth-child(8) { top: 3px;   left: 3px;   animation-delay: -.125s; }

@keyframes dotFade {
    0%   { background: #333; }
    12%  { background: #555; }
    25%  { background: #c8c8c8; }
    100% { background: #c8c8c8; }
}

/* Screen 2: Payment Authentication */
.auth-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 24px 28px 0;
}

.timer-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 24px auto;
}

.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring__bg { fill: none; stroke: #e8e8e8; stroke-width: 5; }
.timer-ring__progress { fill: none; stroke: #2d6fba; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }

.timer-ring__text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.auth-desc {
    font-size: 12px;
    color: #777;
    line-height: 1.6;
    padding: 0 28px 28px;
    text-align: left;
}

.auth-error {
    gap: 6px;
    margin-bottom: 20px;
    font-size: 11.5px;
    text-align: center;
    color: #e74c3c;
}

.auth-continue {
    display: block;
    height: 30px;
    width: 100px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #2d6fba;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background .15s;
    position: relative;
    left: 50%;
    transform: translate(-50%);
}

.auth-continue:hover { background: #245a9a; }

/* Screen 3: SMS */
.sms-subtitle {
    font-size: 12px;
    color: #777;
    line-height: 1.6;
    padding: 8px 28px 0;
}

.sms-code-section {
    text-align: center;
    padding: 0 28px 20px;
}

.sms-code-label {
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.sms-code-input {
    display: block;
    width: 60% !important;
    margin: 0 auto;
    height: 36px;
    padding: 0 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
}

.sms-code-input:focus { border-color: #2d6fba; }

.resend-link {
    display: block;
    width: 100%;
    margin-top: 70px;
    padding-bottom: 24px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #2d6fba;
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    letter-spacing: .3px;
}

.resend-link:hover { text-decoration: underline; }

/* Card image sizing */
.cpp-card-img {
    height: 22px;
    width: auto;
    vertical-align: middle;
}

.cpp-safe-checkout__cards .cpp-card-img { height: 26px; }
.cpp-payment-method__badges svg { height: 22px; width: auto; vertical-align: middle; }
.cpp-safe-checkout__cards svg { height: 26px; width: auto; vertical-align: middle; }
.cpp-brand-icon span svg { width: 34px; height: 22px; }
.cpp-brand-icon span img { width: 34px; height: 22px; }
