/* Modern checkout UI - scoped to checkout.php. */

.checkout-page {
    --checkout-brand: var(--theme-primary);
    --checkout-brand-dark: var(--theme-primary-dark);
    --checkout-brand-soft: color-mix(in srgb, var(--theme-primary) 9%, var(--theme-surface));
    --checkout-ink: var(--theme-text);
    --checkout-muted: var(--theme-muted);
    --checkout-border: var(--theme-border);
    --checkout-surface: var(--theme-surface);
    --checkout-warm: var(--theme-background);
    --checkout-shadow: 0 14px 34px rgba(26,61,43,.07);
    color: var(--checkout-ink);
    padding-bottom: 38px;
}

.checkout-page .checkout-breadcrumb {
    margin-bottom: 14px;
}

.checkout-page .breadcrumb {
    align-items: center;
    gap: 2px;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    font-size: 12px;
}

.checkout-page .breadcrumb-item a {
    color: #718078;
    text-decoration: none;
}

.checkout-page .breadcrumb-item a:hover {
    color: var(--checkout-brand);
}

.checkout-page .breadcrumb-item.active {
    color: #394b41;
    font-weight: 700;
}

.checkout-page .checkout-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding: 23px 25px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(255,255,255,.16), transparent 28%),
        linear-gradient(135deg,var(--theme-primary-dark) 0%,var(--theme-primary) 100%);
    box-shadow: 0 16px 38px rgba(7,139,84,.16);
}

.checkout-page .checkout-hero-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,.14);
    font-size: 22px;
}

.checkout-page .checkout-hero-copy {
    min-width: 0;
    flex: 1;
}

.checkout-page .checkout-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .75px;
    text-transform: uppercase;
    opacity: .84;
}

.checkout-page .checkout-hero h1 {
    margin: 0 0 4px;
    font-size: 27px;
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: -.4px;
}

.checkout-page .checkout-hero p {
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 13px;
    line-height: 1.5;
}

.checkout-page .checkout-hero-steps {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}

.checkout-page .checkout-hero-steps > i {
    font-size: 7px;
    opacity: .6;
}

.checkout-page .checkout-hero-steps .is-done {
    color: rgba(255,255,255,.72);
}

.checkout-page .checkout-hero-steps .is-active {
    color: #fff;
}

.checkout-page .checkout-layout {
    align-items: flex-start;
}

.checkout-page .checkout-main-card,
.checkout-page .checkout-summary-card {
    overflow: hidden;
    border: 1px solid var(--checkout-border);
    border-radius: 19px;
    background: var(--checkout-surface);
    box-shadow: var(--checkout-shadow);
}

.checkout-page .checkout-main-card > .card-header,
.checkout-page .checkout-summary-card > .card-header {
    padding: 17px 19px;
    border-bottom: 1px solid #e7ede9;
    background: linear-gradient(180deg,#fff,#fbfcfb);
}

.checkout-page .checkout-main-card > .card-body {
    padding: 20px;
}

.checkout-page .checkout-summary-card > .card-body {
    padding: 17px;
}

.checkout-page .checkout-section-heading {
    display: flex;
    align-items: center;
    gap: 11px;
}

.checkout-page .checkout-section-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--checkout-brand);
    background: var(--checkout-brand-soft);
    font-size: 16px;
}

.checkout-page .checkout-section-icon.is-small {
    width: 37px;
    height: 37px;
    flex-basis: 37px;
    border-radius: 10px;
    font-size: 14px;
}

.checkout-page .checkout-section-heading span {
    display: block;
    color: var(--checkout-brand);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .55px;
    text-transform: uppercase;
}

.checkout-page .checkout-section-heading h4,
.checkout-page .checkout-section-heading h5 {
    margin: 2px 0 0;
    color: #2d4036;
    font-weight: 850;
}

.checkout-page .checkout-section-heading h4 {
    font-size: 18px;
}

.checkout-page .checkout-section-heading h5 {
    font-size: 15px;
}

/* Customer form */
.checkout-page #checkout-form > .row {
    margin-bottom: 15px !important;
}

.checkout-page #checkout-form .form-label {
    margin-bottom: 6px;
    color: #44544b;
    font-size: 11px;
    font-weight: 750;
}

.checkout-page #checkout-form .form-label .text-danger,
.checkout-page #checkout-form .text-danger {
    color: #c94d4d !important;
}

.checkout-page #checkout-form .form-control,
.checkout-page #checkout-form .form-select {
    min-height: 46px;
    border: 1px solid #dce5e0;
    border-radius: 11px;
    color: #293a31;
    background-color: #fff;
    box-shadow: none;
    font-size: 13px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.checkout-page #checkout-form .form-control::placeholder {
    color: #a2aba6;
}

.checkout-page #checkout-form .form-control:focus,
.checkout-page #checkout-form .form-select:focus {
    border-color: #6aba94;
    box-shadow: 0 0 0 3px rgba(7,139,84,.08);
}

.checkout-page #checkout-form .form-control.is-invalid,
.checkout-page #checkout-form .form-select.is-invalid {
    border-color: #d75d5d;
    box-shadow: 0 0 0 3px rgba(215,93,93,.07);
}

/* Address */
.checkout-page .checkout-address-card {
    margin-top: 4px;
    margin-bottom: 0 !important;
    border: 1px solid #dde7e1;
    border-radius: 15px;
    background: #fbfcfb;
    box-shadow: none;
}

.checkout-page .checkout-address-card > .card-header {
    padding: 13px 15px;
    border-bottom: 1px solid #e1e9e4;
    background: linear-gradient(180deg,#fbfefc,#f5faf7);
}

.checkout-page .checkout-address-card > .card-body {
    padding: 15px;
}

.checkout-page .checkout-address-card .row.mb-3:first-child .col-12 {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
}

.checkout-page .checkout-address-card .form-check-inline {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 9px 11px 9px 36px;
    border: 1px solid #dce6e0;
    border-radius: 11px;
    background: #fff;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.checkout-page .checkout-address-card .form-check-inline:has(.form-check-input:checked) {
    border-color: #72ba96;
    background: #f1faf5;
    box-shadow: 0 0 0 2px rgba(7,139,84,.05);
}

.checkout-page .checkout-address-card .form-check-input {
    position: absolute;
    left: 11px;
    top: 50%;
    margin: 0;
    transform: translateY(-50%);
    border-color: #aebbb4;
}

.checkout-page .checkout-address-card .form-check-input:checked {
    border-color: var(--checkout-brand);
    background-color: var(--checkout-brand);
}

.checkout-page .checkout-address-card .form-check-label {
    color: #405148;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
}

.checkout-page #custom-address-form,
.checkout-page #saved-address-form {
    margin-top: 3px;
    padding-top: 4px;
}

.checkout-page #saved-address-form .btn {
    min-height: 38px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
}

.checkout-page #saved-address-form .btn-outline-primary {
    color: var(--checkout-brand);
    border-color: #9acbb1;
}

.checkout-page #saved-address-form .btn-outline-primary:hover {
    color: #fff;
    border-color: var(--checkout-brand);
    background: var(--checkout-brand);
}

/* Summary */
.checkout-page .checkout-summary-card {
    top: 86px !important;
}

.checkout-page .checkout-summary-header {
    background: linear-gradient(180deg,#fffdf8,#fbf9f3) !important;
}

.checkout-page #checkout-items {
    display: grid;
    gap: 8px;
    margin-bottom: 13px !important;
}

.checkout-page #checkout-items > .d-flex {
    gap: 10px;
    margin-bottom: 0 !important;
    padding: 10px;
    border: 1px solid #e7ece9;
    border-radius: 12px;
    background: #fbfcfb;
}

.checkout-page #checkout-items > .d-flex > .d-flex {
    min-width: 0;
    flex: 1;
    gap: 7px;
}

.checkout-page #checkout-items img {
    width: 48px !important;
    height: 48px !important;
    flex: 0 0 48px;
    margin-right: 0 !important;
    border: 1px solid #e4e9e6;
    border-radius: 10px !important;
    background: #fff;
}

.checkout-page #checkout-items h6 {
    max-width: 165px;
    color: #33453b;
    font-size: 10px !important;
    line-height: 1.35;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.checkout-page #checkout-items small {
    display: block;
    margin-top: 3px;
    color: #87938c !important;
    font-size: 8px;
    line-height: 1.4;
}

.checkout-page #checkout-items > .d-flex > .fw-bold {
    flex: 0 0 auto;
    color: #32443a;
    font-size: 10px;
    white-space: nowrap;
}

.checkout-page .checkout-summary-card hr {
    margin: 13px 0;
    border-color: #e7ece9;
    opacity: 1;
}

.checkout-page .checkout-price-row {
    align-items: center;
    margin-bottom: 8px !important;
    color: #5d6c64;
    font-size: 11px;
}

.checkout-page .checkout-price-row > span:last-child {
    color: #35473d;
    font-weight: 750;
}

.checkout-page .checkout-price-row #checkout-discount,
.checkout-page .checkout-price-row #checkout-reward-discount,
.checkout-page .checkout-price-row.is-wallet > span:last-child {
    color: var(--checkout-brand) !important;
}

.checkout-page .checkout-total-row {
    align-items: center;
    margin: 0;
    padding: 11px 0 2px;
}

.checkout-page .checkout-total-row > span:first-child {
    color: #25382e;
    font-size: 14px;
    font-weight: 850;
}

.checkout-page .checkout-total-row #checkout-total {
    color: var(--checkout-brand) !important;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.3px;
}

/* Wallet overrides old inline styles */
.checkout-page #reward-points-section.vtd-wallet-card {
    overflow: hidden;
    margin-top: 14px !important;
    margin-bottom: 13px !important;
    border: 1px solid #cfe5d9;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(7,139,84,.06);
}

.checkout-page #reward-points-section .card-header {
    padding: 10px 12px !important;
    color: #0b7047;
    border-bottom: 1px solid #d9e9e0;
    background: linear-gradient(135deg,#f2fbf6,#e9f7f0);
}

.checkout-page #reward-points-section .card-header h6 {
    color: #0b7047;
    font-size: 11px;
    font-weight: 850;
}

.checkout-page #reward-points-section .card-body {
    padding: 12px;
    background: #fff;
}

.checkout-page #reward-points-section .vtd-wallet-balance {
    padding: 10px 11px;
    border: 1px solid #e2ebe6;
    border-radius: 11px;
    background: #fbfdfc;
}

.checkout-page #reward-points-section .vtd-wallet-balance small {
    color: #7b8881;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.checkout-page #reward-points-section .vtd-wallet-balance strong {
    color: var(--checkout-brand);
    font-size: 15px;
}

.checkout-page #reward-points-section .vtd-wallet-balance > i {
    width: 35px;
    height: 35px;
    color: var(--checkout-brand);
    background: var(--checkout-brand-soft);
}

.checkout-page #reward-points-section .vtd-wallet-entry label {
    font-size: 9px;
    font-weight: 750;
}

.checkout-page #reward-points-section .vtd-wallet-entry .form-control,
.checkout-page #reward-points-section .vtd-wallet-entry .input-group-text,
.checkout-page #reward-points-section #reward-max-btn {
    min-height: 40px;
    border-color: #d9e4de;
    font-size: 10px;
}

.checkout-page #reward-points-section #reward-max-btn {
    color: var(--checkout-brand);
    font-weight: 750;
}

.checkout-page #reward-points-section #reward-max-btn:hover {
    color: #fff;
    border-color: var(--checkout-brand);
    background: var(--checkout-brand);
}

.checkout-page #reward-points-section .vtd-wallet-hint {
    padding: 7px 8px;
    border-radius: 8px;
    color: #6d7a73;
    background: #f5f8f6;
    font-size: 8px;
    line-height: 1.5;
}

.checkout-page #reward-points-section #apply-reward-btn {
    min-height: 39px;
    border-color: var(--checkout-brand);
    border-radius: 9px;
    background: var(--checkout-brand);
    font-size: 9px;
    font-weight: 800;
}

.checkout-page #reward-points-section #apply-reward-btn:hover {
    border-color: var(--checkout-brand-dark);
    background: var(--checkout-brand-dark);
}

.checkout-page #reward-points-section #clear-reward-btn {
    min-height: 39px;
    border-radius: 9px;
    font-size: 9px;
    font-weight: 700;
}

/* Terms + CTA */
.checkout-page .checkout-terms {
    margin-top: 14px !important;
    padding: 11px 11px 11px 34px;
    border: 1px solid #e3e9e6;
    border-radius: 11px;
    background: #fbfcfb;
}

.checkout-page .checkout-terms .form-check-input {
    margin-left: -23px;
    margin-top: 2px;
}

.checkout-page .checkout-terms .form-check-input:checked {
    border-color: var(--checkout-brand);
    background-color: var(--checkout-brand);
}

.checkout-page .checkout-terms .form-check-label {
    color: #647269;
    font-size: 9px;
    line-height: 1.55;
}

.checkout-page .checkout-terms a {
    color: var(--checkout-brand) !important;
    font-weight: 750;
}

.checkout-page .checkout-place-order {
    min-height: 49px;
    margin-top: 14px !important;
    border: 1px solid var(--checkout-brand);
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg,#078b54,#0aa263);
    font-size: 12px;
    font-weight: 850;
    box-shadow: 0 9px 20px rgba(7,139,84,.17);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.checkout-page .checkout-place-order:not(:disabled):hover {
    color: #fff;
    background: linear-gradient(135deg,#056f43,#088c56);
    box-shadow: 0 11px 24px rgba(7,139,84,.22);
    transform: translateY(-1px);
}

.checkout-page .checkout-place-order:disabled {
    border-color: #b8c7bf;
    color: #f6f7f6;
    background: #aebbb4;
    box-shadow: none;
}

/* Inline completed banner injected by checkout JS */
.checkout-page #order-success-inline {
    margin: 0 0 15px !important;
    padding: 11px 13px;
    border: 1px solid #cae4d6;
    border-radius: 11px;
    color: #256443;
    background: #eef9f3;
    font-size: 10px;
}

/* Loading modal */
#loading-modal .checkout-loading-modal {
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15,35,24,.20);
}

#loading-modal .checkout-loading-modal .modal-body {
    padding: 32px 24px !important;
    background: linear-gradient(145deg,#fff,#f6fbf8);
}

#loading-modal .checkout-loading-modal .spinner-border {
    color: #078b54 !important;
}

#loading-modal .checkout-loading-modal h5 {
    color: #304239;
    font-weight: 850;
}

#loading-modal .checkout-loading-modal p {
    color: #7b8881;
    font-size: 11px;
}

/* Success + QR modal */
#success-modal .checkout-success-dialog {
    width: calc(100vw - 28px);
    max-width: 560px;
}

#success-modal .checkout-success-modal {
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(15,35,24,.23);
}

#success-modal .checkout-success-header {
    padding: 16px 19px;
    border: 0;
    color: #fff;
    background:
        radial-gradient(circle at 86% 15%,rgba(255,255,255,.15),transparent 28%),
        linear-gradient(135deg,#057447,#10a265);
}

#success-modal .checkout-success-header .modal-title {
    color: #fff;
    font-size: 16px;
    font-weight: 850;
}

#success-modal .checkout-success-modal .modal-body {
    padding: 20px;
    background: #fff;
}

#success-modal .checkout-success-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin-left: auto;
    margin-right: auto;
    border-radius: 18px;
    color: #078b54;
    background: #eaf8f1;
    font-size: 28px;
}

#success-modal .checkout-success-modal .modal-body > h5 {
    color: #2f4137;
    font-size: 17px;
    font-weight: 850;
}

#success-modal #order-success-message {
    color: #7a8780;
    font-size: 10px;
}

#success-modal .alert-info {
    padding: 11px 13px;
    border: 1px solid #d7e7df;
    border-radius: 11px;
    color: #4c5f55;
    background: #f7fbf9;
    font-size: 10px;
    line-height: 1.7;
}

#success-modal #order-code,
#success-modal #order-final-total {
    color: #20392c;
    font-weight: 850;
}

#success-modal #payment-qr-container {
    margin-top: 13px !important;
}

#success-modal #payment-qr-container > .text-center {
    padding: 14px;
    border: 1px solid #dce8e1;
    border-radius: 14px;
    background: linear-gradient(145deg,#fbfefc,#f4faf7);
}

#success-modal #payment-qr-container img {
    max-width: 220px !important;
    padding: 6px;
    border: 1px solid #dce6e0 !important;
    border-radius: 13px !important;
    background: #fff;
    box-shadow: 0 8px 22px rgba(26,61,43,.08);
}

#success-modal #payment-qr-container .text-start {
    padding: 10px 11px;
    border-radius: 10px;
    color: #53635a;
    background: #fff;
    font-size: 9px;
    line-height: 1.65;
}

#success-modal #payment-qr-container .btn {
    min-height: 38px;
    border-radius: 9px;
    font-size: 9px;
    font-weight: 750;
}

#success-modal .modal-footer {
    padding: 12px 20px 18px;
    border: 0;
    background: #fff;
}

#success-modal .modal-footer .btn {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d5dfda;
    border-radius: 10px;
    color: #516158;
    background: #fff;
    font-size: 10px;
    font-weight: 750;
}

/* Terms modal */
#terms-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15,35,24,.20);
}

#terms-modal .modal-header {
    border-bottom: 1px solid #dde7e1;
    background: #f5faf7;
}

#terms-modal .modal-title {
    color: #31443a;
    font-size: 16px;
    font-weight: 850;
}

#terms-modal .modal-body {
    color: #5e6d65;
    font-size: 11px;
    line-height: 1.65;
}

#terms-modal .modal-body strong {
    color: #34463c;
}

#terms-modal .modal-footer {
    border-top: 1px solid #e7ece9;
}

/* Responsive */
@media (max-width: 991.98px) {
    .checkout-page .checkout-summary-card {
        position: static !important;
        top: auto !important;
    }

    .checkout-page .checkout-hero-steps {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .checkout-page {
        margin-top: 12px !important;
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 90px;
    }

    .checkout-page .checkout-breadcrumb {
        display: none;
    }

    .checkout-page .checkout-hero {
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 14px;
        padding: 17px 15px;
        border-radius: 17px;
    }

    .checkout-page .checkout-hero-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 13px;
        font-size: 18px;
    }

    .checkout-page .checkout-hero h1 {
        font-size: 21px;
    }

    .checkout-page .checkout-hero p {
        font-size: 10px;
    }

    .checkout-page .checkout-layout {
        --bs-gutter-y: 12px;
    }

    .checkout-page .checkout-main-card,
    .checkout-page .checkout-summary-card {
        border-radius: 16px;
    }

    .checkout-page .checkout-main-card > .card-header,
    .checkout-page .checkout-summary-card > .card-header {
        padding: 14px;
    }

    .checkout-page .checkout-main-card > .card-body,
    .checkout-page .checkout-summary-card > .card-body {
        padding: 14px;
    }

    .checkout-page .checkout-section-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 11px;
    }

    .checkout-page .checkout-section-heading h4 {
        font-size: 16px;
    }

    .checkout-page #checkout-form > .row {
        row-gap: 12px;
    }

    .checkout-page #checkout-form .form-control,
    .checkout-page #checkout-form .form-select {
        min-height: 45px;
        font-size: 13px;
    }

    .checkout-page .checkout-address-card .row.mb-3:first-child .col-12 {
        grid-template-columns: 1fr;
    }

    .checkout-page .checkout-address-card .form-check-inline {
        min-height: 43px;
    }

    .checkout-page #checkout-items > .d-flex {
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
    }

    .checkout-page #checkout-items h6 {
        max-width: none;
    }

    .checkout-page #checkout-items > .d-flex > .fw-bold {
        padding-top: 2px;
    }

    .checkout-page .checkout-total-row #checkout-total {
        font-size: 18px;
    }

    .checkout-page #reward-points-section .vtd-wallet-entry .input-group {
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
    }

    .checkout-page #reward-points-section .vtd-wallet-entry .form-control {
        border-radius: 9px 0 0 9px !important;
    }

    .checkout-page #reward-points-section .vtd-wallet-entry .input-group-text {
        border-radius: 0 9px 9px 0 !important;
    }

    .checkout-page #reward-points-section #reward-max-btn {
        grid-column: 1 / -1;
        margin-top: 7px;
        border-radius: 9px !important;
    }

    .checkout-page .checkout-place-order {
        min-height: 48px;
        font-size: 12px;
    }

    #success-modal .checkout-success-dialog {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        margin: 6px auto;
    }

    #success-modal .checkout-success-modal {
        border-radius: 16px;
    }

    #success-modal .checkout-success-modal .modal-body {
        padding: 15px;
    }

    #success-modal #payment-qr-container img {
        max-width: min(210px, 72vw) !important;
    }
}

@media (max-width: 380px) {
    .checkout-page #checkout-items > .d-flex {
        display: grid !important;
        grid-template-columns: minmax(0,1fr);
    }

    .checkout-page #checkout-items > .d-flex > .fw-bold {
        padding-left: 58px;
    }
}
