.codflow-cod-wrapper {
    margin: 12px 0;
}

.codflow-cod-open-btn,
.codflow-cod-submit-btn {
    display: inline-block;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
}

/* v6.9.2 fix: the final "Book Your Order Now" CTA inside the form was
   only forced to full width inside the mobile media query further down
   — on desktop/tablet it fell back to inline-block's content-sized
   width, showing as a small button that looked out of place against the
   full-width form panel around it. Every reference screenshot this was
   reported against (and Releasit's own) shows this button spanning the
   full form width regardless of viewport, so it's unconditional now —
   the trigger button (.codflow-cod-open-btn) is intentionally left
   auto-width, that one was never part of the complaint. */
.codflow-cod-submit-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.codflow-cod-open-btn:hover,
.codflow-cod-submit-btn:hover {
    opacity: 0.9;
}

.codflow-cod-form-panel {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    max-width: 420px;
}

/* ---- Heading, announcement bar, form heading (v6.4.1) ----------------- */

.codflow-cod-heading {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-align: center;
    color: #1b1b1b;
}

.codflow-announcement-bar {
    margin: 0 0 14px 0;
    padding: 10px 12px;
    background: #fff4e0;
    border: 1px solid #f0c674;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    color: #6b4b00;
}

.codflow-form-heading {
    margin: 4px 0 12px 0;
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

/* ---- Product summary card (v6.4.1; v6.9.1: quantity stepper merged
   into the card itself instead of a separate labeled section below it —
   was showing quantity twice and looked oversized next to the compact
   card) ------------------------------------------------------------- */

.codflow-product-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.codflow-product-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.codflow-product-info {
    flex: 1;
    min-width: 0;
}

.codflow-product-name {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
}

.codflow-product-variation {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.codflow-product-price {
    font-size: 14px;
    font-weight: 700;
    color: #2e7d32;
    margin-top: 3px;
}

/* Compact variant used only inside the product card — smaller than the
   standalone fallback stepper (render_quantity_stepper_fallback()),
   which keeps its normal size since it has no card to sit inside. */
.codflow-qty-stepper-inline {
    flex-shrink: 0;
}

.codflow-qty-stepper-inline .codflow-qty-minus,
.codflow-qty-stepper-inline .codflow-qty-plus {
    width: 28px;
    font-size: 15px;
}

.codflow-qty-stepper-inline .codflow-qty-input {
    width: 36px;
    font-size: 13px;
}

/* ---- Shipping Method section (v6.4.2) ---------------------------------- */

.codflow-shipping-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 13px;
}

.codflow-shipping-method-cost.loading {
    opacity: 0.6;
}

/* ---- Quantity stepper (v6.4.1) ----------------------------------------- */

.codflow-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.codflow-qty-minus,
.codflow-qty-plus {
    border: none;
    background: #f0f0f0;
    width: 34px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.codflow-qty-minus:hover,
.codflow-qty-plus:hover {
    background: #e2e2e2;
}

.codflow-qty-input {
    width: 44px;
    text-align: center;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    -moz-appearance: textfield;
}

.codflow-qty-input::-webkit-outer-spin-button,
.codflow-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---- Price summary box (v6.4.1) ---------------------------------------- */

.codflow-price-summary {
    margin: 14px 0;
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 13px;
}

.codflow-price-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.codflow-price-total-row {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #e5e5e5;
    font-weight: 700;
    font-size: 15px;
}

.codflow-price-shipping.loading {
    opacity: 0.6;
}

.codflow-price-discount-row .codflow-price-discount {
    color: #2e7d32;
    font-weight: 600;
}

.codflow-price-addons-row .codflow-price-addons {
    color: #555;
}

/* ---- Button customizer (v6.4) --------------------------------------- */

.codflow-btn-size-small { padding: 8px 16px; font-size: 13px; }
.codflow-btn-size-medium { padding: 12px 24px; font-size: 15px; }
.codflow-btn-size-large { padding: 16px 32px; font-size: 17px; }

.codflow-btn-shadow {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.codflow-btn-icon {
    margin-right: 2px;
}

@keyframes codflow-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes codflow-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.codflow-btn-anim-pulse { animation: codflow-pulse 1.6s ease-in-out infinite; }
.codflow-btn-anim-bounce { animation: codflow-bounce 1.2s ease-in-out infinite; }

/* ---- Floating button (v6.4) ------------------------------------------ */

.codflow-floating-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

.codflow-floating-wrapper .codflow-cod-form-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
}

/* ---- Sticky-on-mobile inline button (v6.4) --------------------------- */

@media (max-width: 768px) {
    .codflow-btn-sticky-mobile {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 99998;
        border-radius: 0 !important;
        width: 100%;
        text-align: center;
    }
}

/* ---- Popup display mode (v6.4) ---------------------------------------- */

.codflow-cod-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
}

.codflow-cod-form-panel.codflow-popup-mode {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100001;
    max-height: 90vh;
    overflow-y: auto;
    width: 92%;
    max-width: 480px;
}

.codflow-cod-popup-close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

body.codflow-popup-open {
    overflow: hidden;
}

/* ---- Variable product selector (v6.4) --------------------------------- */

.codflow-variation-selector {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.codflow-variation-message.success {
    color: #1b5e20;
    font-size: 12px;
}

.codflow-variation-message.error {
    color: #b71c1c;
    font-size: 12px;
}

.codflow-variation-gate-note {
    font-size: 12px;
    color: #b71c1c;
    margin: 6px 0 0 0;
}

/* ---- Order bump / bundle offers (v6.5) --------------------------------- */

.codflow-order-bumps {
    margin: 12px 0;
}

.codflow-upsell-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    margin-bottom: 8px;
    background: #fffbea;
    border: 1px dashed #e0c46c;
    border-radius: 6px;
}

.codflow-upsell-box label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.codflow-offer-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.codflow-offer-copy {
    display: block;
    font-size: 13px;
}

.codflow-offer-description {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.codflow-offer-pricing {
    display: block;
    margin-top: 4px;
    font-weight: 700;
}

.codflow-offer-pricing del {
    font-weight: normal;
    color: #999;
    margin-right: 4px;
}

/* ---- Quantity discount hints (v6.5) ------------------------------------- */

.codflow-quantity-hints {
    list-style: none;
    margin: 6px 0 12px 0;
    padding: 0;
    font-size: 12px;
    color: #2e7d32;
}

.codflow-quantity-hints li {
    padding: 1px 0;
}

/* ---- One-click post-purchase offer + downsell (v6.5) -------------------- */

.codflow-post-purchase-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100010;
}

.codflow-post-purchase-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100011;
    width: 92%;
    max-width: 420px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.codflow-post-purchase-body h3 {
    margin: 0 0 12px 0;
    font-size: 17px;
}

.codflow-post-purchase-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.codflow-post-purchase-price {
    font-size: 18px;
    font-weight: 800;
    color: #2e7d32;
}

.codflow-post-purchase-price del {
    font-weight: normal;
    color: #999;
    font-size: 14px;
    margin-right: 6px;
}

.codflow-post-purchase-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.codflow-post-purchase-skip {
    border: none;
    background: none;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}


.codflow-field {
    margin: 0 0 10px 0;
}

.codflow-field-half {
    display: inline-block;
    width: calc(50% - 6px);
    vertical-align: top;
}

.codflow-field-half:nth-of-type(odd) {
    margin-right: 12px;
}

.codflow-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}

.codflow-field input[type="text"],
.codflow-field input[type="tel"],
.codflow-field input[type="email"],
.codflow-field input[type="number"],
.codflow-field input[type="date"],
.codflow-field select,
.codflow-field textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.codflow-choice {
    display: block;
    font-weight: normal !important;
    margin: 4px 0;
    font-size: 13px;
}

.codflow-choice input {
    margin-right: 6px;
}

/* ---- Field icons (v6.4.2 — rewritten to wrap only the input, not the
   whole field block, so the icon is always centered against the input's
   own height regardless of label wrapping) ------------------------------ */

.codflow-input-icon-wrap {
    position: relative;
    display: block;
}

.codflow-input-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
    opacity: 0.7;
}

.codflow-input-icon-wrap input {
    padding-left: 32px !important;
}

@media (max-width: 480px) {
    .codflow-field input[type="text"],
    .codflow-field input[type="tel"],
    .codflow-field input[type="email"],
    .codflow-field input[type="number"],
    .codflow-field input[type="date"],
    .codflow-field select,
    .codflow-field textarea {
        font-size: 16px; /* prevents iOS Safari auto-zoom on focus */
        padding: 10px 8px;
    }

    .codflow-input-icon-wrap input {
        padding-left: 34px !important;
    }

    .codflow-cod-submit-btn,
    .codflow-step-next,
    .codflow-step-back {
        width: 100%;
    }

    .codflow-product-summary {
        flex-wrap: wrap;
    }

    .codflow-qty-stepper-inline {
        margin-top: 8px;
        margin-left: 68px; /* aligns under the info column, past the thumbnail */
    }
}

/* ---- Multi-step (Form Builder) ------------------------------------- */

.codflow-step-progress {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}

.codflow-step-progress-bar {
    height: 100%;
    background: #2e7d32;
    transition: width 0.25s ease;
}

.codflow-step-indicator {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #999;
}

.codflow-step-dot.active {
    color: #2e7d32;
    font-weight: 700;
}

.codflow-step-nav {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.codflow-upsell-box {
    background: #fff8e1;
    border: 1px dashed #e0b400;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
}

.codflow-upsell-original-price del {
    color: #999;
    margin-right: 4px;
}

.codflow-upsell-discounted-price {
    color: #2e7d32;
    font-weight: 600;
}

.codflow-form-message {
    padding: 8px 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
}

.codflow-form-message.error {
    background: #fdecea;
    color: #b71c1c;
    display: block;
}

.codflow-form-message.success {
    background: #edf7ed;
    color: #1b5e20;
    display: block;
}

.codflow-otp-trigger-row {
    margin: -4px 0 10px 0;
}

.codflow-otp-send-btn {
    white-space: nowrap;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
}

.codflow-otp-panel {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid #cfe0ff;
    border-radius: 6px;
    background: #f4f8ff;
    font-size: 13px;
}

.codflow-otp-title {
    margin: 0 0 4px 0;
}

.codflow-otp-description {
    margin: 0 0 10px 0;
    color: #555;
}

.codflow-otp-code-input {
    width: 140px;
    letter-spacing: 4px;
    font-size: 18px;
    text-align: center;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.codflow-otp-message {
    padding: 6px 8px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 12px;
}

.codflow-otp-message.error {
    background: #fdecea;
    color: #b71c1c;
}

.codflow-otp-message.success {
    background: #edf7ed;
    color: #1b5e20;
}

.codflow-otp-actions {
    margin: 10px 0 0 0;
    color: #555;
}

.codflow-otp-actions a {
    margin: 0 4px;
}

.codflow-otp-verified-badge {
    color: #1b5e20;
    font-weight: 600;
    margin: 8px 0 0 0;
}

.codflow-otp-gate-note {
    font-size: 12px;
    color: #b71c1c;
    margin: 6px 0 0 0;
}

/* Mobile: force every field to single-column regardless of the builder's
   half-width setting, matching the Form Builder's own preview breakpoint. */
@media (max-width: 480px) {
    .codflow-cod-form-panel {
        max-width: 100%;
    }

    .codflow-field-half {
        display: block;
        width: 100%;
    }

    .codflow-field-half:nth-of-type(odd) {
        margin-right: 0;
    }
}
