body {
    background: #f9f9fa;
}

.checkout-title {
    font-weight: 500;
}

.checkout-box {
    background: #fff;
    border: 1px solid #f0f1f4;
    border-radius: 15px;
    box-shadow: 0px 0px 8px 0px #f3f3f3;

    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 30px;
}

.checkout-side-info {
    justify-self: center;
    max-width: 374px;
    width: 100%;
}

.checkout-bank-box {
    margin: 0 25px;
    background: #4e2a82;
    border-radius: 10px;
    color: #fff;
    text-align: right;
    font-size: 18px;
    padding: 0 10px 20px;
}

.checkout-bank-box img {
    max-width: 90%;
}

.checkout-bank-box p {
    margin-right: 20px;
}

.checkout-bank-box button {
    display: block;
    width: fit-content;
    margin: 0 auto;
    background-color: #ffac01;
    border: 0;
    border-radius: 5px;
    font-family: inherit;
    font-size: 16px;
    padding: 0 20px;
}

.checkout-bank-box button:hover {
    cursor: pointer;
    background-color: #d28c00;
}

.checkout-side-info .checkout-question {
    margin: 20px 25px;
    text-align: center;
    font-size: 18px;
}

.checkout-contact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.phone-numbers {
    max-width: 196px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.phone-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    height: 36px;
    padding: 0 12px;
    background: #fff8f6;
    border-radius: 72px;
    white-space: nowrap;
}

.phone-number i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    font-size: 13px;
    margin-right: 8px;
    border-radius: 50%;
    color: #fff;
    background: #1db954;
}

.line-qr {
    font-size: 14px;
    color: #4fba58;
    text-align: center;
}

.line-qr img {
    width: 157px;
    height: 157px;
    border-radius: 5px;
    box-shadow: 0px 4px 4px 0px #00000040;
    margin-bottom: 10px;
}

.contact-company {
    margin-bottom: 20px;
}
.contact-company strong {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 16px;
}
.contact-company p {
    margin: 0;
    color: #656565;
    font-size: 14px;
}
.contact-details {
    display: grid;
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.contact-details li {
    display: flex;
    gap: 25px;
    align-items: center;
}
.contact-details i {
    color: #000;
    font-size: 18px;
    text-align: center;
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.checkout-form .custom-select-trigger {
    height: 33px;
    min-height: 33px;
    padding: 0 10px;
    border: 0.8px solid #e4e4e4;
    color: #00000080;
    font-size: 14px;
}

.checkout-form .custom-select-trigger.has-value {
    color: #000;
}

.checkout-form .custom-select-trigger .trigger-chevron {
    color: #00000080;
}

.checkout-form .custom-select-options {
    border: 0.8px solid #e4e4e4;
}

.checkout-form .custom-select-option[data-value=""] {
    color: #00000080;
}

.checkout-date-picker,
.checkout-time-picker {
    position: relative;
    width: 100%;
}

.checkout-picker-trigger {
    width: 100%;
    min-height: 32px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #d9d8d4;
    border-radius: 3px;
    background: #fff;
    color: #82827f;
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.checkout-picker-trigger:has(+ input[data-picker-value]:not([value=""])) {
    color: #000;
}

.checkout-picker-trigger i {
    flex: 0 0 auto;
    color: #111;
    font-size: 18px;
}

.checkout-picker-trigger:hover,
.checkout-picker-trigger:focus-visible {
    border-color: #cc611c;
    outline: none;
}

.checkout-picker-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    box-sizing: border-box;
    z-index: 30;
    padding: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px #0002;
}

.checkout-picker-popover[hidden] {
    display: none;
}

.checkout-calendar {
    width: min(400px, calc(100vw - 40px));
}

@media (max-width: 600px) {
    /* มือถือ: popup กางลงมาจากปุ่มที่กดเหมือนเดสก์ท็อป (ไม่เอา bottom-sheet ติดขอบล่าง) */
    .checkout-picker-popover {
        position: absolute;
        top: calc(100% + 6px);
        bottom: auto;
        left: auto;
        right: 0;
        z-index: 200;
    }

    .checkout-calendar {
        width: min(320px, calc(100vw - 32px));
        max-height: calc(100dvh - 120px);
        overflow-y: auto;
        padding: 12px;
    }

    .checkout-time-popover {
        width: min(240px, calc(100vw - 32px));
        max-height: calc(100dvh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px;
    }

    .checkout-time-option {
        min-height: 36px;
        font-size: 14px;
    }

    .checkout-calendar-header {
        flex-wrap: nowrap;
        gap: 6px;
        padding-bottom: 8px;
    }

    .checkout-calendar-month-year {
        flex: 1 1 auto;
        min-width: 0;
        gap: 6px;
    }

    .checkout-calendar-month-year strong {
        white-space: nowrap;
    }

    .checkout-calendar-month-year select {
        min-height: 36px;
        font-size: 16px; /* กัน iOS auto-zoom */
    }

    .checkout-calendar-weekdays {
        font-size: 12px;
        padding-bottom: 10px;
    }

    .checkout-calendar-days {
        row-gap: 4px;
    }

    .checkout-calendar-day {
        width: 100%;
        max-width: 38px;
        height: 36px;
        min-height: 36px;
        font-size: 13px;
    }
}

.checkout-calendar-header {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px 10px;
}

.checkout-calendar-header strong {
    font-size: 14px;
    font-weight: 500;
}

.checkout-calendar-month-year {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.checkout-calendar-month-year select {
    min-height: 30px;
    padding: 3px 22px 3px 8px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.checkout-calendar-month-year select:hover,
.checkout-calendar-month-year select:focus-visible {
    border-color: #cc611c;
    outline: none;
}

.checkout-calendar-header button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #111;
    cursor: pointer;
}

.checkout-calendar-header button:hover:not(:disabled) {
    background: #fff1e9;
    color: #cc611c;
}

.checkout-calendar-header button:disabled {
    color: #bbb;
    cursor: default;
}

.checkout-calendar-weekdays,
.checkout-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: center;
}

.checkout-calendar-weekdays {
    padding-bottom: 14px;
    border-bottom: 0.6px solid #ddd;
    color: #000;
    font-size: 12px;
}

.checkout-calendar-days {
    row-gap: 6px;
    padding-top: 10px;
}

.checkout-calendar-day {
    width: 38px;
    height: 38px;
    justify-self: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #111;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.checkout-calendar-day:hover:not(:disabled) {
    background: #fff1e9;
}

.checkout-calendar-day.is-today {
    background: #f1f1f3;
}

.checkout-calendar-day.is-selected,
.checkout-calendar-day.is-selected:hover {
    background: #D8521E;
    color: #fff;
}

.checkout-calendar-day:disabled {
    color: #c7c7c7;
    cursor: default;
}

.checkout-time-popover {
    width: 176px;
    padding: 12px;
}

.checkout-time-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.checkout-time-column {
    max-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    scrollbar-width: none;
}

.checkout-time-option {
    min-height: 27px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #222;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.checkout-time-option:hover {
    background: #fff1e9;
}

.checkout-time-option.is-selected,
.checkout-time-option.is-selected:hover {
    background: #D8521E;
    color: #fff;
}

.checkout-picker-error {
    color: #d8521e;
}

.upload-zone {
    position: relative;
    min-height: 134px;
    border: 1px solid #e5e5e5;
}

.upload-zone input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-default {
    min-height: 134px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #888;
    font-size: 10px;
    cursor: pointer;
}

.upload-default[hidden] {
    display: none;
}

.upload-default i {
    color: #000;
    font-size: 23px;
}

.upload-default span {
    color: #656565;
    font-size: 14px;
}

.file-preview {
    position: relative;
    min-height: 134px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #555;
    font-size: 11px;
}

.file-preview[hidden] {
    display: none;
}

.file-preview img {
    max-width: 90px;
    max-height: 65px;
    object-fit: contain;
}

.file-preview img[hidden],
.file-preview .preview-file-icon[hidden] {
    display: none;
}

.preview-file-icon {
    color: #df4d22;
    font-size: 28px;
}

.preview-remove {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 3;
    border: 0;
    background: transparent;
    color: #000;
    cursor: pointer;
}

.upload-error {
    color: #e33b2b !important;
}

.submit-checkout-btn {
    background-color: #cc611c;
    color: #fff;
    font-family: inherit;
    font-size: 16px;

    width: 174px;
    padding: 4.5px 0;
    border: 0;
    border-radius: 20px;
    transition: background-color 0.3s;
}

.submit-checkout-btn:hover {
    cursor: pointer;
    background-color: #b85813;
}
.submit-checkout-btn:disabled {
    cursor: wait;
    opacity: 0.65;
}
.checkout-form-error {
    display: block;
    margin: 0 0 12px;
    color: #bd3e32;
    font-size: 13px;
}
.checkout-form-error[hidden] {
    display: none;
}

/* ===== Success modal — แจ้งชำระเงินสำเร็จ (เปิด/ปิดด้วย checkout.js ตามแพทเทิร์น contact-success-modal) ===== */
.checkout-success-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
}

.checkout-success-modal.is-open {
    display: flex;
}

.checkout-success-content {
    position: relative;
    width: min(100%, 500px);
    padding: 48px 25px 44px;
    box-sizing: border-box;
    border-radius: 20px;
    background: #fff;
    text-align: center;
}

.checkout-success-close {
    position: absolute;
    top: 14px;
    right: 20px;
    border: 0;
    background: transparent;
    color: #979797;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
}

.checkout-success-icon {
    display: grid;
    width: 80px;
    height: 80px;
    margin: 0 auto 22px;
    place-items: center;
    border-radius: 50%;
    background: #20b65b;
    color: #fff;
    font-size: 60px;
}

.checkout-success-content h2 {
    margin: 0 0 16px;
    font-size: 32px;
    font-weight: 500;
    color: #1f2937;
}

.checkout-success-text {
    margin: 0 0 30px;
    font-size: 16px;
    line-height: 1.7;
}

.checkout-success-home {
    padding: 11px 56px;
    border: 0;
    border-radius: 999px;
    background: #d8521e;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    transition:
        background-color 0.3s,
        transform 0.3s ease;
}

.checkout-success-home:hover {
    background: #b85813;
    transform: scale(1.06);
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .checkout-title {
        font-weight: 600;
        font-size: 27px;
        margin-left: 20px;
    }

    .checkout-bank-box {
        margin: 0 10px;
    }

    .checkout-contact {
        flex-direction: column;
        gap: 20px;
    }

    .line-qr {
        font-size: 18px;
    }

    .line-qr img {
        width: 228px;
        height: 228px;
        box-shadow: none;
        border: 1px solid #d9d9d9;
        border-radius: 10px;
    }

    .contact-company strong {
        font-size: 17px;
    }

    .contact-company p {
        font-size: 16px;
    }

    .checkout-box {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .upload-zone {
        min-height: 125px;
    }
    .upload-default {
        min-height: 125px;
    }
    .file-preview {
        min-height: 125px;
    }

    .checkout-success-icon {
        width: 46px;
        height: 46px;
        font-size: 35px;
    }

    .checkout-success-content {
        padding: 38px 20px 32px;
    }

    .checkout-success-content h2 {
        margin: 0 0 10px;
        font-size: 20px;
    }

    .checkout-success-text {
        font-size: 15px;
    }

    .checkout-success-home {
        width: 100%;
    }

    .submit-checkout-btn {
        width: 100%;
    }
}
