.checkout-main {
    margin-top: 3.5rem;
}

.checkout-shell {
    max-width: 1126px;
    margin: 0 auto;
    padding: 0 0 60px;
}

.checkout-prescription {
    color: #111;
    font-size: 16px;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
}

.checkout-prescription__meta {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 44px;
}

.checkout-prescription__company p,
.checkout-prescription__date {
    margin: 0;
}

.checkout-prescription__company {
    display: grid;
    gap: 8px;
    color: #333;
}

.checkout-prescription__title {
    margin: 0 0 56px;
    text-align: center;
    font-size: 32px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: 0.02em;
    color: #00b298;
}

.checkout-prescription__patient {
    margin-bottom: 40px;
}

.checkout-prescription__patient-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 44px;
    row-gap: 20px;
}

.checkout-line-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.checkout-line-field--full {
    grid-column: 1 / -1;
}

.checkout-line-field>span:first-child {
    white-space: nowrap;
}

.checkout-line-field em {
    color: #c70909;
    font-style: normal;
}

.checkout-line-field__value,
.checkout-line-field__input {
    width: 100%;
    min-width: 0;
    border: 0;
    border-bottom: 1px dashed #b9b9b9;
    height: 34px;
    padding: 4px 0;
    font-size: 16px;
    line-height: 24px;
    color: #333;
    background: transparent;
}

.checkout-line-field__input:focus {
    outline: none;
    border-bottom-color: #00b298;
}

textarea.checkout-line-field__input,
.checkout-line-field__input--auto {
    resize: none;
    overflow: hidden;
    height: auto;
    min-height: 34px;
    line-height: 24px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: inherit;
}

.checkout-line-field:has(textarea.checkout-line-field__input) {
    align-items: flex-start;
}

.checkout-line-field:has(textarea.checkout-line-field__input) > span:first-child {
    padding-top: 4px;
}

.address-container {
    margin: 14px 0 10px;
}

.selected-address {
    border: 1px solid #ebf4f3;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.address-name {
    font-weight: 600;
}

.address-badge {
    margin-left: 8px;
    color: #00b298;
}

.address-phone,
.address-text {
    color: #555;
    font-size: 14px;
}

.address-actions {
    display: flex;
    gap: 10px;
}

.address-edit-btn,
.address-delete-btn {
    border: 0;
    background: transparent;
    color: #777;
    cursor: pointer;
}

.address-delete-btn {
    color: #c70909;
}

.add-address-btn {
    border: 1px solid #ebf4f3;
    background: #fff;
    color: #00b298;
    min-height: 52px;
    border-radius: 4px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(217, 217, 217, 0.25);
    cursor: pointer;
}

.checkout-table-wrap {
    overflow-x: auto;
    margin-bottom: 36px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.checkout-table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
}

.checkout-table th,
.checkout-table td {
    border: 1px solid #b9b9b9;
    padding: 12px;
    text-align: center;
    color: #333;
    font-size: 16px;
    font-weight: 400;
}

.checkout-table th {
    height: 76px;
    font-weight: 500;
}

.checkout-table td:nth-child(2) {
    text-align: left;
    padding-left: 22px;
}

.checkout-item-qty {
    width: 56px;
    height: 34px;
    border: 1px solid #b9b9b9;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 15px;
    line-height: 1;
    text-align: center;
    outline: none;
}

.checkout-item-qty-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.checkout-item-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #b9b9b9;
    border-radius: 4px;
    background: #f5f5f5;
    color: #333;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.checkout-item-qty-btn:hover {
    background: #e9f7f3;
    border-color: #00b298;
    color: #00b298;
}

.checkout-item-qty:focus {
    border-color: #00b298;
    box-shadow: 0 0 0 2px rgba(0, 178, 152, 0.15);
}

.checkout-item-qty::-webkit-outer-spin-button,
.checkout-item-qty::-webkit-inner-spin-button {
    margin: 0;
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.checkout-total-row__left {
    display: flex;
    align-items: center;
    gap: 48px;
}

.checkout-total-row__price,
.checkout-total-row__right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    font-size: 16px;
    line-height: 24px;
}

.checkout-total-row__price strong,
.checkout-total-row__right strong {
    color: #00b298;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.checkout-dose-field {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.checkout-dose-field input {
    width: 46px;
    height: 34px;
    border: 1px solid #909090;
    border-radius: 4px;
    text-align: center;
}

.checkout-action-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 70px;
}

.checkout-outline-btn {
    border: 1px solid #ebf4f3;
    background: #fff;
    color: #00b298;
    min-height: 60px;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
    border-radius: 0;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 4px rgba(217, 217, 217, 0.25);
    cursor: pointer;
}

.checkout-note-block {
    margin-bottom: 44px;
}

.checkout-note-line {
    height: 34px;
    border-bottom: 1px dashed #b9b9b9;
}

.payment-section {
    margin: 0;
    width: 100%;
    max-width: 420px;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.payment-option {
    border: 1px solid #ebf4f3;
    border-radius: 4px;
    padding: 10px 14px;
    background: #fff;
    cursor: pointer;
}

.payment-option input[type='radio'] {
    margin-right: 8px;
}

.payment-option.selected {
    border-color: #00b298;
}

.payment-text {
    font-weight: 600;
    color: #333;
}

.payment-desc {
    font-size: 14px;
    color: #666;
}

.payment-no {
    font-size: 14px;
    line-height: 14px;
    color: #909090;
    margin-bottom: 10px;
}

.checkout-delivery-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    z-index: 999;
}

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

.checkout-delivery-modal__dialog {
    width: 100%;
    max-width: 907px;
    background: #fff;
    border: 1px solid #ebf4f3;
}

.checkout-delivery-modal__header {
    height: 60px;
    padding: 18px 32px;
    border-bottom: 1px solid #ebf4f3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(217, 217, 217, 0.25);
}

.checkout-delivery-modal__header h3 {
    margin: 0;
    color: #00b298;
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0.02em;
}

.checkout-delivery-modal__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.checkout-delivery-modal__back,
.checkout-delivery-modal__close {
    border: 0;
    background: transparent;
    color: #111;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
}

.payment-section--modal {
    max-width: none;
    padding: 24px 24px 22px;
}

.payment-methods--modal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

.payment-option--modal {
    border: 1px solid #d9d9d9;
    border-radius: 5px;
    padding: 14px 18px;
    min-height: 84px;
}

.payment-option--modal input[type='radio'] {
    display: none;
}

.payment-option--modal .payment-text {
    font-size: 16px;
    line-height: 20px;
    font-weight: 500;
}

.payment-option--modal .payment-desc {
    margin-top: 4px;
    font-size: 14px;
    line-height: 18px;
}

.payment-option--modal.selected {
    border-color: #00b298;
}

.payment-detail-view__body {
    padding: 24px 52px 34px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: end;
}

.payment-detail-fields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.payment-detail-field {
    border: 1px solid #d9d9d9;
    border-radius: 5px;
    min-height: 66px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.payment-detail-field span {
    color: #9d9d9d;
    font-size: 14px;
    line-height: 14px;
}

.payment-detail-field input {
    border: 0;
    outline: none;
    color: #656565;
    font-size: 16px;
    line-height: 14px;
    padding: 0;
    background: transparent;
}

.payment-detail-field input::placeholder {
    color: #a0a0a0;
}

.payment-detail-view__actions {
    grid-column: 2;
    display: flex;
    justify-content: flex-end;
}

.payment-sales-points {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-height: 156px;
    overflow-y: auto;
}

.payment-sales-point-card {
    border: 1px solid #d9d9d9;
    border-radius: 5px;
    background: #fff;
    min-height: 66px;
    padding: 14px 18px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

.payment-sales-point-card.is-selected {
    border-color: #00b299;
    box-shadow: inset 0 0 0 1px #00b299;
}

.payment-sales-point-card__name {
    color: #909090;
    font-size: 14px;
    line-height: 14px;
}

.payment-sales-point-card__address {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    line-height: 14px;
}

.payment-sales-points__empty {
    grid-column: 1 / -1;
    margin: 0;
    color: #8c8c8c;
    font-size: 14px;
    line-height: 20px;
}

.payment-detail-save-btn {
    border: 1px solid #00b299;
    background: #00b299;
    color: #ebf4f3;
    min-width: 141px;
    min-height: 44px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.02em;
    cursor: pointer;
}

/* ===== Drug list modal — redesigned UI ===== */
.checkout-drug-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.checkout-drug-modal.is-open {
    display: flex;
    animation: drugModalFade 0.18s ease;
}

@keyframes drugModalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.checkout-drug-modal__dialog {
    width: 100%;
    max-width: 1180px;
    background: #fff;
    border: 0;
    border-radius: 14px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.checkout-drug-modal__header {
    height: auto;
    padding: 18px 28px;
    border-bottom: 1px solid #eef2f1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
    box-shadow: none;
    flex-shrink: 0;
}

.checkout-drug-modal__header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkout-drug-modal__header h3::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, #00b298, #4cc2b4);
    border-radius: 4px;
}

.checkout-drug-modal__body {
    padding: 20px 28px 0;
    overflow-y: auto;
    flex: 1 1 auto;
    background: #fbfdfd;
}

/* --- Selected items section --- */
.drug-modal-selected {
    border: 1px solid #e3edec;
    border-radius: 10px;
    margin-bottom: 18px;
    background: #fff;
    overflow: hidden;
}

.drug-modal-selected__header {
    align-items: center;
    background: linear-gradient(180deg, #f0faf8 0%, #e8f6f3 100%);
    border-bottom: 1px solid #d8eae6;
    display: flex;
    justify-content: space-between;
    padding: 12px 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.drug-modal-selected__header h4 {
    color: #00845f;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drug-modal-selected__header h4::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00b298;
    box-shadow: 0 0 0 3px rgba(0, 178, 152, 0.18);
}

.drug-modal-selected__header p {
    color: #555;
    font-size: 13px;
    margin: 0;
    background: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #d8eae6;
}

.drug-modal-selected__header p span {
    color: #00b298;
    font-weight: 700;
}

.drug-modal-selected__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-height: 240px;
    overflow-y: auto;
}

.drug-modal-selected__table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
    width: 100%;
}

.drug-modal-selected__table thead th {
    position: sticky;
    top: 0;
    background: #fafdfd;
    color: #5a6b6a;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e3edec;
    z-index: 1;
}

.drug-modal-selected__table tbody td {
    color: #1f2937;
    font-size: 14px;
    line-height: 20px;
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f5f4;
    vertical-align: middle;
}

.drug-modal-selected__table tbody tr:last-child td {
    border-bottom: 0;
}

.drug-modal-selected__table tbody tr:hover td {
    background: #f7fbfa;
}

.drug-modal-selected__empty td {
    color: #94a3b8;
    font-style: italic;
    text-align: center !important;
    padding: 22px 12px !important;
    background: #fafdfd;
}

.drug-selected-qty {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    background: #f3faf8;
    border: 1px solid #d8eae6;
    border-radius: 999px;
    padding: 2px;
}

.drug-selected-qty__btn {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 999px;
    color: #00b298;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    height: 26px;
    width: 26px;
    justify-content: center;
    transition: background 0.15s ease;
}

.drug-selected-qty__btn:hover {
    background: #00b298;
    color: #fff;
}

.drug-selected-qty span {
    min-width: 22px;
    text-align: center;
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.drug-selected-remove {
    align-items: center;
    background: #fff;
    border: 1px solid #fdd;
    border-radius: 8px;
    color: #d32f2f;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    height: 30px;
    width: 30px;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.drug-selected-remove:hover {
    background: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
}

/* --- Search filter --- */
.drug-modal-filters {
    margin-top: 0;
    display: block;
    position: sticky;
    top: 0;
    background: #fbfdfd;
    z-index: 2;
    padding: 6px 0 16px;
    margin-bottom: 4px;
}

.drug-modal-filter-input {
    border: 1px solid #d8eae6;
    border-radius: 999px;
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 8px 18px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.drug-modal-filter-input:focus-within {
    border-color: #00b298;
    box-shadow: 0 0 0 4px rgba(0, 178, 152, 0.12);
}

.drug-modal-filter-input i {
    color: #00b298;
    font-size: 16px;
    margin-right: 10px;
}

.drug-modal-filter-input input,
.drug-modal-filter-input select {
    width: 100%;
    border: 0;
    outline: none;
    color: #1f2937;
    font-size: 15px;
    background: transparent;
}

.drug-modal-filter-input input::placeholder {
    color: #94a3b8;
}

/* --- Catalog --- */
.drug-modal-catalog {
    margin-top: 0;
    border: 0;
    background: transparent;
}

.drug-modal-catalog__status {
    min-height: 20px;
    padding: 14px 12px;
    font-size: 13px;
    line-height: 20px;
    color: #6f7170;
    text-align: center;
}

.drug-modal-catalog__head {
    display: grid;
    grid-template-columns: minmax(200px, 1.6fr) minmax(120px, 1fr) minmax(220px, 2fr) minmax(120px, 1fr) 110px;
    background: #fff;
    border: 1px solid #e3edec;
    border-radius: 10px 10px 0 0;
    border-bottom: 0;
}

.drug-modal-catalog__head>div {
    border-right: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.2;
    color: #5a6b6a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.drug-modal-catalog__head>div:nth-child(4) {
    justify-content: flex-end;
    text-align: right;
}

.drug-modal-catalog__head>div:last-child {
    border-right: 0;
    color: #5a6b6a;
    justify-content: center;
    text-align: center;
}

.drug-modal-catalog__body {
    border: 1px solid #e3edec;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    background: #fff;
    overflow: hidden;
}

.drug-modal-catalog__row {
    display: grid;
    grid-template-columns: minmax(200px, 1.6fr) minmax(120px, 1fr) minmax(220px, 2fr) minmax(120px, 1fr) 110px;
    border-top: 1px solid #f0f5f4;
    background: #fff;
    transition: background-color 0.15s ease;
}

.drug-modal-catalog__row:first-child {
    border-top: 0;
}

.drug-modal-catalog__row:nth-child(even) {
    background: #fff;
}

.drug-modal-catalog__row:hover {
    background: #f7fbfa;
}

.drug-cell {
    border-right: 0;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-height: 76px;
    font-size: 14px;
    line-height: 1.4;
    color: #1f2937;
}

.drug-cell--name {
    font-weight: 600;
    color: #0f172a;
    font-size: 15px;
}

.drug-cell--processing {
    color: #5a6b6a;
}

.drug-cell--total {
    justify-content: flex-end;
    text-align: right;
    font-weight: 700;
    color: #00b298;
    font-size: 15px;
}

.drug-cell--add {
    justify-content: center;
}

.drug-cell:last-child {
    border-right: 0;
}

.drug-cell--packaging {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    align-items: center;
    justify-content: flex-start;
    align-content: center;
}

.drug-pack-item {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
    border: 1.5px solid #d8eae6;
    border-radius: 10px;
    background: #fff;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    width: auto;
    flex: 0 0 auto;
}

.drug-pack-item:hover {
    border-color: #00b298;
    background: #f3faf8;
}

.drug-pack-item:last-child {
    border-right: 1.5px solid #d8eae6;
}

.drug-pack-item.is-selected {
    background: #00b298;
    border-color: #00b298;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 178, 152, 0.22);
}

.drug-pack-item.is-selected:hover {
    background: #00a187;
}

.drug-pack-item__label {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
}

.drug-pack-item__price {
    margin-top: 2px;
    color: #8f9190;
    font-size: 12px;
}

.drug-pack-item.is-selected .drug-pack-item__price {
    color: rgba(255, 255, 255, 0.9);
}

.drug-cell--packaging-empty {
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
}

.drug-modal-add-btn {
    border: 0;
    background: linear-gradient(135deg, #00b298 0%, #00a187 100%);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 600;
    transition: transform 0.12s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 178, 152, 0.25);
    white-space: nowrap;
}

.drug-modal-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 178, 152, 0.3);
}

.drug-modal-add-btn:active {
    transform: translateY(0);
}

.drug-modal-add-btn::after {
    content: "Thêm";
}

.drug-modal-add-btn .fas,
.drug-modal-add-btn i {
    font-size: 13px;
    line-height: 1;
}

.drug-modal-add-btn .fa-plus-circle::before {
    content: "\f067";
}

.drug-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0;
    padding: 18px 28px;
    border-top: 1px solid #eef2f1;
    background: #fff;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
}

.drug-modal-actions .payment-detail-save-btn {
    min-width: 220px;
    border-radius: 999px;
    padding: 0 24px;
    background: linear-gradient(135deg, #00b298 0%, #00845f 100%);
    border: 0;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 178, 152, 0.28);
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.drug-modal-actions .payment-detail-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 178, 152, 0.32);
}

.checkout-bottom-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

#guestInquiryForm .checkout-bottom-actions {
    margin-top: 16px;
}

#guestInquiryBtn.checkout-export-btn {
    padding: 14px 44px;
}

#guestInquiryForm .checkout-prescription__patient-grid {
    margin-top: 8px;
}

#guestInquiryForm .checkout-line-field {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    column-gap: 14px;
}

#guestInquiryForm .checkout-line-field > span:first-child {
    white-space: normal;
}

#guestInquiryForm .checkout-line-field--full {
    grid-template-columns: 180px 1fr;
}

#guestInquiryForm textarea.checkout-line-field__input {
    height: auto;
    min-height: 120px;
    padding: 10px 0;
    resize: vertical;
    line-height: 1.6;
}

.checkout-print-btn,
.checkout-export-btn {
    min-height: 48px;
    border-radius: 4px;
    padding: 12px 40px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.checkout-print-btn i,
.checkout-export-btn i {
    font-size: 24px;
    line-height: 1;
}

.checkout-print-btn {
    border: 1px solid #00b298;
    background: #fff;
    color: #00b298;
}

.checkout-export-btn {
    border: 1px solid #00b298;
    background: #00b299;
    color: #fff;
}

/* SweetAlert2 custom styles */
.swal2-popup {
    font-family: inherit;
}

.swal2-form-container {
    text-align: left;
}

.swal2-form-group {
    margin-bottom: 15px;
}

.swal2-form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.swal2-form-input,
.swal2-form-select,
.swal2-form-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.swal2-form-textarea {
    min-height: 60px;
    resize: vertical;
}

.swal2-form-input:focus,
.swal2-form-select:focus,
.swal2-form-textarea:focus {
    border-color: #00b298;
    box-shadow: 0 0 0 0.2rem rgba(0, 178, 152, 0.2);
    outline: 0;
}

@media (max-width: 1200px) {
    .checkout-prescription__title {
        font-size: 30px;
    }

    .checkout-total-row__price strong,
    .checkout-total-row__right strong {
        font-size: 16px;
        line-height: 24px;
    }

    .checkout-outline-btn,
    .checkout-print-btn,
    .checkout-export-btn {
        font-size: 17px;
    }
}

@media (max-width: 992px) {
    .checkout-prescription__patient-grid {
        grid-template-columns: 1fr;
        row-gap: 14px;
    }

    .checkout-total-row,
    .checkout-total-row__left {
        flex-direction: column;
        align-items: flex-start;
    }

    .checkout-total-row__left {
        gap: 1.25rem;
    }

    .checkout-action-row {
        flex-direction: column;
    }

    .payment-methods--modal {
        grid-template-columns: 1fr;
    }

    .payment-detail-view__body {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 16px;
    }

    .payment-detail-view__actions {
        grid-column: auto;
    }

    .payment-detail-fields {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .payment-sales-points {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .payment-detail-save-btn {
        min-width: 141px;
        min-height: 44px;
        font-size: 16px;
        line-height: 24px;
    }

    .checkout-drug-modal__body {
        padding: 18px;
    }

    .checkout-drug-modal__header {
        height: auto;
        min-height: 52px;
    }

    .drug-modal-selected__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .checkout-table {
        min-width: 720px;
        border-collapse: separate;
        border-spacing: 0;
    }

    .checkout-table thead th:first-child,
    .checkout-table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #fff;
        box-shadow: 4px 0 12px -6px rgba(0, 0, 0, 0.14);
    }

    .checkout-table thead th:first-child {
        z-index: 3;
    }

    .drug-modal-selected__table {
        min-width: 560px;
        border-collapse: separate;
        border-spacing: 0;
    }

    .drug-modal-selected__table thead th:first-child,
    .drug-modal-selected__table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #fff;
        box-shadow: 4px 0 12px -6px rgba(0, 0, 0, 0.12);
    }

    .drug-modal-selected__table thead th:first-child {
        z-index: 3;
    }

    .drug-modal-selected__table tbody tr.drug-modal-selected__empty td {
        position: static;
        box-shadow: none;
    }

    .drug-modal-selected__table th:first-child,
    .drug-modal-selected__table td:first-child {
        text-align: left;
    }

    .drug-modal-filters {
        grid-template-columns: 1fr;
    }

    .drug-modal-catalog__head {
        display: none;
    }

    .drug-modal-catalog__body {
        display: flex;
        flex-direction: column;
        gap: 12px;
        border: 0;
        border-radius: 0;
        background: transparent;
        overflow: visible;
        padding: 4px 0 0;
    }

    .drug-modal-catalog__row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name name"
            "processing processing"
            "packaging packaging"
            "total add";
        gap: 8px 12px;
        border: 1px solid #e3edec;
        border-radius: 12px;
        padding: 18px 16px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }

    .drug-modal-catalog__row:first-child {
        border-top: 1px solid #e3edec;
    }

    .drug-modal-catalog__row:hover {
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 178, 152, 0.1);
        border-color: #c6e3dd;
    }

    .drug-modal-catalog__row:nth-child(even) {
        background: #fff;
    }

    .drug-cell {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: flex-start;
        text-align: left;
        border-right: 0;
        border-bottom: 0;
        min-height: 0;
        padding: 0;
        width: 100%;
        word-break: break-word;
        overflow-wrap: anywhere;
        gap: 4px 8px;
    }

    .drug-cell:last-child {
        border-bottom: 0;
    }

    .drug-cell--name {
        grid-area: name;
        background: transparent;
        padding: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        font-size: 15px;
        font-weight: 600;
        color: #0f172a;
        line-height: 1.3;
    }

    .drug-cell--processing {
        grid-area: processing;
        display: inline-flex;
        align-items: center;
        padding: 4px 12px;
        font-size: 12px;
        font-weight: 500;
        color: #00845f;
        background: #e8f6f3;
        border-radius: 999px;
        line-height: 1.4;
        width: fit-content;
        max-width: 100%;
    }

    .drug-modal-catalog__row[data-processing=""] .drug-cell--processing,
    .drug-modal-catalog__row[data-processing="-"] .drug-cell--processing,
    .drug-modal-catalog__row:not([data-processing]) .drug-cell--processing {
        display: none;
    }

    /* Collapse the processing grid row when chip is hidden */
    .drug-modal-catalog__row:has(.drug-cell--processing[style*="display: none"]),
    .drug-modal-catalog__row[data-processing=""],
    .drug-modal-catalog__row[data-processing="-"],
    .drug-modal-catalog__row:not([data-processing]) {
        grid-template-areas:
            "name name"
            "packaging packaging"
            "total add";
    }

    .drug-cell--total {
        grid-area: total;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        font-weight: 700;
        color: #00b298;
        font-size: 15px;
        padding: 0;
        flex-direction: row;
    }

    .drug-cell[data-drug-label]::before {
        display: none;
    }

    .drug-cell--total[data-drug-label]::before {
        display: inline;
        content: "Tổng:";
        font-size: 12px;
        font-weight: 500;
        color: #5a6b6a;
        text-transform: none;
        letter-spacing: 0;
        margin-right: 4px;
    }

    /* Show processing as small chip below name (only when there's a real value) */
    .drug-cell--name::after {
        display: none;
    }

    .drug-cell--packaging {
        grid-area: packaging;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
        gap: 8px;
        align-items: stretch;
        padding: 0;
    }

    .drug-cell--packaging[data-drug-label]::before {
        display: none;
    }

    .drug-cell--packaging .drug-pack-item {
        flex-direction: row;
        gap: 8px;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        min-height: 0;
        padding: 8px 12px;
        border: 1.5px solid #d8eae6;
        border-radius: 999px;
        justify-content: space-between;
        align-items: center;
        background: #f7fbfa;
    }

    .drug-cell--packaging .drug-pack-item:last-child {
        border-right: 1.5px solid #d8eae6;
    }

    .drug-cell--packaging .drug-pack-item.is-selected {
        border-color: #00b298;
        background: #00b298;
    }

    .drug-cell--packaging .drug-pack-item__label {
        font-size: 13px;
        font-weight: 600;
        flex-shrink: 0;
        text-align: left;
    }

    .drug-cell--packaging .drug-pack-item__price {
        margin-top: 0;
        font-size: 12px;
        flex-shrink: 1;
        min-width: 0;
        text-align: right;
    }

    .drug-cell--packaging-empty {
        grid-area: packaging;
        display: none;
    }

    .drug-cell--add {
        grid-area: add;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 0;
        padding: 0;
        background: transparent;
        border-top: 0;
        border-bottom: 0;
        align-self: center;
    }

    .drug-cell--add[data-drug-label]::before {
        display: none;
    }

    .drug-modal-add-btn {
        flex-shrink: 0;
        font-size: 13px;
        min-width: 0;
        min-height: 32px;
        padding: 6px 14px;
    }

}

@media (max-width: 768px) {
    .checkout-shell {
        padding-bottom: 40px;
    }

    .checkout-prescription__meta {
        flex-direction: column;
        margin-bottom: 28px;
    }

    .checkout-prescription__title {
        font-size: 26px;
        margin-bottom: 34px;
    }

    .checkout-total-row__price strong,
    .checkout-total-row__right strong {
        font-size: 16px;
        line-height: 24px;
    }

    .checkout-outline-btn,
    .checkout-print-btn,
    .checkout-export-btn {
        min-height: 50px;
        font-size: 16px;
        padding: 10px 20px;
        width: 100%;
        justify-content: center;
    }

    .checkout-bottom-actions {
        flex-direction: column;
    }

    .checkout-delivery-modal__header {
        padding: 14px 18px;
    }

    .payment-section--modal {
        padding: 16px;
    }

    .checkout-drug-modal {
        padding: 10px;
    }

    .checkout-drug-modal__dialog {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .checkout-drug-modal__body {
        padding: 12px;
    }

    .checkout-drug-modal__header {
        padding: 14px 18px;
    }

    .checkout-drug-modal__header h3 {
        font-size: 16px;
        line-height: 22px;
    }

    .checkout-table {
        min-width: 640px;
    }

    .drug-modal-selected__table {
        min-width: 500px;
    }

    .checkout-table th,
    .checkout-table td {
        font-size: 14px;
        padding: 10px 8px;
    }

    .drug-modal-selected__table th,
    .drug-modal-selected__table td {
        font-size: 13px;
        padding: 8px 8px;
    }

    .drug-modal-filter-input {
        min-height: 46px;
        padding: 8px 14px;
    }

    .drug-modal-filter-input input {
        font-size: 15px;
    }

    .swal2-popup {
        width: 95% !important;
        margin: 0 auto !important;
    }
}

@media (max-width: 576px) {
    .checkout-drug-modal {
        padding: 0;
        align-items: stretch;
    }

    .checkout-drug-modal__dialog {
        width: 100%;
        max-width: none;
        max-height: 100dvh;
        max-height: 100vh;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .checkout-drug-modal__header {
        padding: 12px 16px;
    }

    .checkout-drug-modal__body {
        padding: 12px 12px 16px;
    }

    .drug-modal-actions {
        justify-content: stretch;
    }

    .drug-modal-actions .payment-detail-save-btn {
        width: 100%;
        justify-content: center;
    }

    .drug-cell--packaging {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr));
        gap: 6px;
    }

    .drug-cell--packaging .drug-pack-item {
        min-height: 44px;
        padding: 8px 10px;
    }

    .drug-cell--packaging .drug-pack-item__label {
        font-size: 13px;
    }

    .drug-cell--packaging .drug-pack-item__price {
        font-size: 11px;
    }

    .checkout-table {
        min-width: 580px;
    }

    .drug-modal-selected__table {
        min-width: 440px;
    }
}

@media print {
    @page {
        size: A4;
        margin: 15mm 12mm;
    }

    body * {
        visibility: hidden !important;
    }

    .checkout-main,
    .checkout-main * {
        visibility: visible !important;
    }

    .checkout-main {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 16px 18px;
        background: #fff;
    }

    .add-address-btn,
    .checkout-action-row,
    .payment-section,
    .checkout-bottom-actions {
        display: none !important;
    }

    .checkout-shell {
        max-width: 100%;
        padding: 0 8px;
    }

    .checkout-prescription {
        border: 0;
        box-shadow: none;
        padding: 8px 10px;
    }

    .checkout-table-wrap {
        overflow: visible !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .checkout-table {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .checkout-table th,
    .checkout-table td {
        font-size: 12px !important;
        line-height: 1.35 !important;
        padding: 6px 4px !important;
        word-break: break-word !important;
    }

    .checkout-table th:nth-child(1),
    .checkout-table td:nth-child(1) {
        width: 6% !important;
    }

    .checkout-table th:nth-child(2),
    .checkout-table td:nth-child(2) {
        width: 32% !important;
        text-align: left !important;
        padding-left: 8px !important;
    }

    .checkout-table th:nth-child(3),
    .checkout-table td:nth-child(3) {
        width: 12% !important;
    }

    .checkout-table th:nth-child(4),
    .checkout-table td:nth-child(4) {
        width: 10% !important;
    }

    .checkout-table th:nth-child(5),
    .checkout-table td:nth-child(5) {
        width: 14% !important;
    }

    .checkout-table th:nth-child(6),
    .checkout-table td:nth-child(6) {
        width: 10% !important;
    }

    .checkout-table th:nth-child(7),
    .checkout-table td:nth-child(7) {
        width: 16% !important;
    }

    .checkout-table thead,
    .checkout-table tbody,
    .checkout-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}