/**
 * COD Scale Bridge - Checkout Form Styles
 *
 * Clean, modern COD checkout form that works with any WordPress theme.
 */

.baha-checkout-form-wrap {
    max-width: 560px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    min-width: 0;
    width: 100%;
}

.baha-checkout-form-wrap *,
.baha-checkout-form-wrap *::before,
.baha-checkout-form-wrap *::after {
    box-sizing: border-box;
}

.baha-checkout-form {
    background: var(--baha-form-background, #ffffff);
    border: 1px solid var(--baha-border-color, #e2e8f0);
    border-radius: calc(var(--baha-radius, 8px) + 8px);
    padding: clamp(20px, 5vw, 32px);
    box-shadow: 0 18px 45px -28px rgba(15, 23, 42, 0.45);
    color: var(--baha-text-color, #1a202c);
    max-width: 100%;
    counter-reset: baha-checkout-step;
}

.baha-checkout-title {
    margin: 0;
    font-size: clamp(22px, 5vw, 28px);
    line-height: 1.2;
    font-weight: 750;
    color: var(--baha-text-color, #172033);
    text-align: start;
}

.baha-checkout-intro {
    margin: 8px 0 24px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
}

/* Sections */
.baha-checkout-section {
    margin-bottom: 20px;
    border-top: 1px solid var(--baha-border-color, #e2e8f0);
    padding-top: 20px;
}

.baha-checkout-section h4 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--baha-text-color, #243047);
    letter-spacing: 0;
    text-transform: none;
}

.baha-checkout-section h4::before {
    counter-increment: baha-checkout-step;
    content: counter(baha-checkout-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--baha-primary-color, #2b6cb0);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

/* Field Layout */
.baha-checkout-field {
    margin-bottom: 16px;
    min-width: 0;
}

.baha-checkout-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.baha-checkout-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.baha-checkout-field label .required {
    color: #e53e3e;
}

.baha-checkout-field input,
.baha-checkout-field textarea,
.baha-checkout-field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: var(--baha-radius, 8px);
    font-size: 15px;
    color: #2d3748;
    background: #f7fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.baha-checkout-field select:disabled {
    background: #edf2f7;
    color: #94a3b8;
    cursor: not-allowed;
}

.baha-checkout-field input:focus,
.baha-checkout-field textarea:focus,
.baha-checkout-field select:focus {
    outline: none;
    border-color: var(--baha-primary-color, #4299e1);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    background: #fff;
}

/* Two-column row */
.baha-checkout-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.baha-checkout-field--half {
    flex: 1 1 220px;
}

/* Total display */
.baha-checkout-total {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: var(--baha-radius, 8px);
    padding: 12px 16px;
    font-size: 16px;
    color: #22543d;
    text-align: center;
}

.baha-checkout-product-card {
    display: flex;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: var(--baha-radius, 8px);
    background: #fff;
    box-shadow: 0 8px 20px -18px rgba(15, 23, 42, 0.7);
}

.baha-checkout-product-card.is-unavailable {
    opacity: 0.75;
}

.baha-checkout-product-image {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: var(--baha-radius, 8px);
    background: #edf2f7;
    flex: 0 0 auto;
}

.baha-checkout-product-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 12px;
    text-align: center;
}

.baha-checkout-product-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.baha-checkout-product-details strong {
    display: block;
    font-size: 16px;
    color: #1a202c;
}

.baha-checkout-product-details p {
    margin: 4px 0;
    color: #4a5568;
    font-size: 13px;
    line-height: 1.4;
}

.baha-checkout-product-price {
    display: inline-block;
    margin-top: 4px;
    color: #22543d;
    font-weight: 700;
}

.baha-checkout-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.baha-checkout-compare-price {
    color: #718096;
    text-decoration: line-through;
    font-size: 13px;
}

.baha-stock-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    background: #edf2f7;
    color: #334155;
    text-transform: capitalize;
}

.baha-stock-badge--in_stock {
    background: #dcfce7;
    color: #166534;
}

.baha-stock-badge--out_of_stock {
    background: #fee2e2;
    color: #991b1b;
}

.baha-stock-badge--on_backorder {
    background: #fef3c7;
    color: #92400e;
}

.baha-variant-options,
.baha-shipping-options {
    display: grid;
    gap: 10px;
}

.baha-variant-options {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.baha-variant-pill,
.baha-shipping-card {
    min-height: 48px;
    border: 1px solid #cbd5e0;
    border-radius: var(--baha-radius, 8px);
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.baha-variant-pill {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
}

.baha-variant-pill small {
    color: #64748b;
    font-size: 12px;
}

.baha-shipping-card {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
}

.baha-shipping-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.baha-shipping-card-logo {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 6px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.baha-shipping-card-title {
    font-weight: 700;
}

.baha-shipping-card-description {
    color: #64748b;
    font-size: 13px;
}

.baha-shipping-card strong {
    color: #22543d;
}

.baha-variant-pill:hover,
.baha-shipping-card:hover,
.baha-variant-pill.is-selected,
.baha-shipping-card.is-selected {
    border-color: var(--baha-primary-color, #2b6cb0);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.14);
}

.baha-variant-pill.is-selected,
.baha-shipping-card.is-selected {
    background: #f8fbff;
}

.baha-variant-pill:focus-visible,
.baha-shipping-card:focus-visible,
.baha-quantity-btn:focus-visible,
.baha-checkout-btn:focus-visible,
.baha-whatsapp-btn:focus-visible,
.baha-upload-input:focus-visible {
    outline: 3px solid rgba(43, 108, 176, 0.28);
    outline-offset: 2px;
}

.baha-quantity-stepper {
    display: grid;
    grid-template-columns: 44px minmax(64px, 1fr) 44px;
    gap: 8px;
    align-items: center;
}

.baha-quantity-btn {
    min-height: 44px;
    border: 1px solid #cbd5e0;
    border-radius: var(--baha-radius, 8px);
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
}

.baha-quantity-btn:hover {
    border-color: var(--baha-primary-color, #2b6cb0);
}

.baha-price-summary {
    display: grid;
    gap: 8px;
    margin-top: 0;
    padding: 14px 16px;
    border: 1px solid #c6f6d5;
    border-radius: var(--baha-radius, 8px);
    background: #f0fff4;
}

.baha-checkout-section--summary {
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .baha-checkout-form {
        border-radius: calc(var(--baha-radius, 8px) + 4px);
        padding: 18px;
    }

    .baha-checkout-product-image {
        width: 76px;
        height: 76px;
    }
}

.baha-price-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #22543d;
    font-size: 14px;
}

.baha-price-summary-row--total {
    border-top: 1px solid #bbf7d0;
    padding-top: 8px;
    font-size: 16px;
}

.baha-price-summary-row--discount {
    color: #166534;
}

.baha-price-summary-note {
    margin: 0;
    color: #3f6212;
    font-size: 12px;
    line-height: 1.4;
}

.baha-checkout-help {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.baha-upload-dropzone {
    display: grid;
    gap: 6px;
    align-items: center;
    min-height: 96px;
    padding: 16px;
    border: 1px dashed var(--baha-border-color, #cbd5e0);
    border-radius: var(--baha-radius, 8px);
    background: #f8fafc;
}

.baha-upload-input {
    min-height: 44px;
    width: 100%;
    color: #334155;
}

.baha-upload-dropzone-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.baha-upload-dropzone-meta {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.baha-upsell-container {
    display: grid;
    gap: 10px;
}

.baha-upsell-header {
    display: grid;
    gap: 3px;
}

.baha-upsell-header-title {
    margin: 0;
}

.baha-upsell-header-subtitle {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.baha-upsell-grid,
.baha-upsell-offers-grid {
    display: grid;
    gap: 10px;
}

.baha-upsell-card,
.baha-upsell-offer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 56px;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: var(--baha-radius, 8px);
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.baha-upsell-card:has(input:checked),
.baha-upsell-card.is-selected,
.baha-upsell-offer.is-selected {
    border-color: var(--baha-primary-color, #2b6cb0);
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.14);
}

.baha-upsell-card:hover,
.baha-upsell-offer:hover {
    border-color: var(--baha-primary-color, #2b6cb0);
}

.baha-upsell-card:focus-within,
.baha-upsell-offer:focus-within {
    outline: 3px solid rgba(43, 108, 176, 0.28);
    outline-offset: 2px;
}

.baha-upsell-card input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--baha-primary-color, #2b6cb0);
}

.baha-upsell-card-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.baha-upsell-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.baha-upsell-description {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.baha-upsell-helper {
    color: var(--baha-primary-color, #2b6cb0);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.baha-upsell-badge {
    justify-self: end;
    border-radius: 999px;
    padding: 4px 8px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* Submit button */
.baha-checkout-submit {
    margin-top: 24px;
}

.baha-checkout-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: var(--baha-button-color, var(--baha-primary-color, #2b6cb0));
    color: var(--baha-button-text-color, #fff);
    border: none;
    border-radius: var(--baha-radius, 8px);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.3px;
}

.baha-checkout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.35);
}

.baha-checkout-btn:active {
    transform: translateY(0);
}

.baha-checkout-btn:disabled,
.baha-checkout-btn.is-loading {
    opacity: 0.75;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

/* Notices */
.baha-checkout-notice {
    padding: 14px 18px;
    border-radius: var(--baha-radius, 8px);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.baha-checkout-notice--success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #c6f6d5;
}

.baha-checkout-notice--error {
    background: #fff5f5;
    color: #9b2c2c;
    border: 1px solid #fed7d7;
}

/* Thank You */
.baha-checkout-thankyou {
    text-align: center;
    padding: 40px 20px;
}

.baha-digital-thankyou {
    display: grid;
    max-width: 640px;
    gap: 14px;
    margin: 0 auto;
    border: 1px solid var(--baha-border-color, #e2e8f0);
    border-radius: 16px;
    background: var(--baha-form-background, #ffffff);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    color: var(--baha-text-color, #1f2937);
}

.baha-thankyou-mark {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto;
    place-items: center;
    border-radius: 999px;
    background: var(--baha-primary-color, #10b981);
    color: #ffffff;
    font-size: 34px;
    font-weight: 900;
}

.baha-checkout-thankyou h3 {
    margin: 0;
    color: var(--baha-text-color, #1f2937);
    font-size: 26px;
    line-height: 1.25;
}

.baha-checkout-thankyou p {
    max-width: 460px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.6;
    color: #4a5568;
}

.baha-thankyou-summary {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    border: 1px solid var(--baha-border-color, #e2e8f0);
    border-radius: 12px;
    background: #ffffff;
    padding: 15px;
}

.baha-thankyou-summary span {
    color: #718096;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.baha-thankyou-summary strong {
    color: var(--baha-text-color, #1f2937);
}

.baha-whatsapp-cta {
    margin-top: 18px;
}

.baha-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--baha-radius, 8px);
    background: #128c7e;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.baha-whatsapp-btn:hover {
    background: #0f766e;
    color: #fff;
}

/* Responsive */
@media (max-width: 480px) {
    .baha-checkout-form-wrap {
        max-width: none;
    }

    .baha-checkout-form {
        padding: 18px;
        border-radius: 8px;
    }

    .baha-upsell-card,
    .baha-upsell-offer {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .baha-upsell-badge {
        grid-column: 2;
        justify-self: start;
        white-space: normal;
    }

    .baha-checkout-row {
        flex-direction: column;
        gap: 0;
    }

    .baha-checkout-row--product {
        gap: 0;
    }

    .baha-checkout-product-card {
        align-items: flex-start;
        padding: 12px;
    }

    .baha-checkout-product-image {
        width: 72px;
        height: 72px;
    }

    .baha-variant-options {
        grid-template-columns: 1fr;
    }

    .baha-shipping-card,
    .baha-variant-pill,
    .baha-quantity-btn,
    .baha-checkout-btn,
    .baha-whatsapp-btn {
        min-height: 48px;
    }

    .baha-upsell-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .baha-upsell-badge {
        grid-column: 2;
        justify-self: start;
        white-space: normal;
    }

    .baha-price-summary-row {
        align-items: flex-start;
    }

    .baha-checkout-title {
        font-size: 18px;
    }
}
/* Automatic WooCommerce placements added by the bridge. */
.baha-ecom-product-page-checkout {
    clear: both;
    width: 100%;
    margin: 24px 0 0;
}

.baha-ecom-store-checkout {
    width: 100%;
    margin: 0 auto;
}
