/* ==========================================================================
   KÜEYE STOREFRONT - GỬI ĐƠN ĐO MẮT (PRESCRIPTION FORM)
   ========================================================================== */

.prescription-container {
    max-width: 980px;
    margin: 24px auto 60px;
    padding: 0 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    box-sizing: border-box;
}

/* Header giới thiệu trang */
.rx-page-header {
    text-align: center;
    margin: 12px 0 32px;
}

.rx-page-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
    line-height: 1.3;
    text-transform: uppercase;
}

.rx-page-subtitle {
    font-size: 14.5px;
    color: #64748b;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
}

.prescription-form {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-size: 14.5px;
    color: #1e293b;
    box-sizing: border-box;
}

/* Từng khối Section dạng Card sang trọng, có đổ bóng nhẹ */
.prescription-form section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px 34px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.03), 0 1px 3px rgba(15, 23, 42, 0.02);
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

/* Tiêu đề Section chuẩn quang học */
.prescription-form h1,
.prescription-form h2 {
    font-size: 16.5px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.4px;
    margin: 0 0 22px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

/* Layout 3 cột thông tin */
.three-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 18px;
}

/* Nhãn và ô input */
.prescription-form label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 18px;
}

.prescription-form em {
    color: #ef4444;
    font-style: normal;
    margin-left: 3px;
    font-weight: 700;
}

.prescription-form input:not([type=checkbox]):not([type=radio]):not([type=file]),
.prescription-form select,
.prescription-form textarea {
    width: 100%;
    font-size: 14.5px;
    color: #0f172a;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    box-sizing: border-box;
    margin-top: 7px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.prescription-form input:not([type=checkbox]):not([type=radio]):not([type=file]):focus,
.prescription-form select:focus,
.prescription-form textarea:focus {
    border-color: #ba3815;
    box-shadow: 0 0 0 3px rgba(186, 56, 21, 0.12);
    outline: none;
}

.prescription-form input::placeholder,
.prescription-form textarea::placeholder {
    color: #94a3b8;
    font-size: 14px;
}

/* Fieldset & Legend */
.prescription-form fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.prescription-form legend {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

/* Radio Tình trạng mắt dạng Pill Badges */
.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.radio-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0;
    transition: all 0.2s ease;
    user-select: none;
}

.radio-row label:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.radio-row label:has(input:checked) {
    background: #fff7ed;
    border-color: #ba3815;
    color: #ba3815;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(186, 56, 21, 0.08);
}

.radio-row input[type=radio] {
    accent-color: #ba3815;
    margin: 0;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Segmented Tabs Kính cận / Kính loạn */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title h2 {
    margin-bottom: 0;
}

.rx-tabs {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 9999px;
    gap: 4px;
}

.rx-tabs label {
    margin: 0;
    cursor: pointer;
}

.rx-tabs input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.rx-tabs span {
    display: inline-block;
    padding: 7px 18px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
    border: none;
}

.rx-tabs label:hover span {
    color: #0f172a;
}

.rx-tabs input:checked+span {
    background: #ffffff;
    color: #ba3815;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Bảng thông số đo mắt rx-table */
.table-scroll {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.rx-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 580px;
    table-layout: fixed;
    font-size: 14px;
}

.rx-table thead {
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
}

.rx-table th,
.rx-table td {
    position: relative;
    padding: 12px 10px;
    border: 1px solid #f1f5f9;
    text-align: center;
}

.rx-table thead th {
    font-size: 12.5px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rx-table tbody th {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    text-align: left;
    padding-left: 16px;
    background: #fafafa;
}

.rx-table input {
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 8px 6px !important;
    font-size: 14px !important;
    text-align: center !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    background: #ffffff !important;
    margin-top: 0 !important;
}

.rx-table input:focus {
    border-color: #ba3815 !important;
    box-shadow: 0 0 0 3px rgba(186, 56, 21, 0.12) !important;
}

.rx-table input:disabled {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
}

/* Ghi chú PD */
.rx-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: #166534;
    font-size: 13.5px;
    font-style: normal;
    line-height: 1.5;
}

/* Mục đích sử dụng kính & Ghi chú */
.prescription-form .check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13.5px;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    margin-bottom: 8px;
}

.prescription-form .check-label:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.prescription-form .check-label:has(input:checked) {
    background: #fff7ed;
    border-color: #ba3815;
    color: #ba3815;
    font-weight: 600;
}

.prescription-form .check-label input {
    accent-color: #ba3815;
    margin: 0;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.small-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    margin-top: 16px;
}

.prescription-form textarea {
    height: 105px;
    resize: vertical;
    line-height: 1.5;
}

/* Upload zone kéo thả ảnh toa kính */
.upload-zone {
    margin-top: 10px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    min-height: 140px;
    padding: 20px 16px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-zone:hover {
    border-color: #ba3815;
    background: #fffbf9;
}

.upload-zone:focus-within {
    border-color: #ba3815;
    box-shadow: 0 0 0 3px rgba(186, 56, 21, 0.12);
}

.upload-zone input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 26px;
    color: #ba3815;
    line-height: 1;
}

.upload-zone strong {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.3px;
}

.upload-zone>span:last-of-type {
    font-size: 12px;
    color: #64748b;
    overflow-wrap: anywhere;
}

/* Xác nhận và Nút hoàn tất */
.consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #475569;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.consent:hover {
    background: #f1f5f9;
}

.consent input[type=checkbox] {
    margin-top: 3px;
    accent-color: #ba3815;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.confirmation .primary-button {
    display: block;
    width: 320px;
    max-width: 100%;
    margin: 28px auto 0;
    padding: 15px 28px;
    background: linear-gradient(135deg, #ba3815 0%, #d44922 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 14px rgba(186, 56, 21, 0.28);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.confirmation .primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(186, 56, 21, 0.38);
    background: linear-gradient(135deg, #a73010 0%, #c43f1a 100%);
}

.confirmation .primary-button:active {
    transform: translateY(0);
}

/* Thông báo lỗi */
.error-summary {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 24px;
    color: #991b1b;
    font-size: 14px;
}

.error-summary strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14.5px;
}

.error-summary ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.6;
}

.field-error {
    color: #dc2626;
    font-size: 12.5px;
    margin-top: 6px;
}

/* Modal thành công */
.success-modal {
    border: 0;
    border-radius: 20px;
    padding: 45px 36px;
    width: 520px;
    max-width: 90vw;
    text-align: center;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.success-modal p {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
    margin: 0;
}

.success-modal p span {
    display: block;
    font-size: 14.5px;
    font-weight: 500;
    color: #64748b;
    margin-top: 8px;
}

.success-check {
    width: 72px;
    height: 72px;
    background: #10b981;
    color: white;
    font-size: 40px;
    line-height: 72px;
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.25);
}

.dialog-close {
    position: absolute;
    right: 16px;
    top: 14px;
    background: none;
    border: 0;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.dialog-close:hover {
    color: #0f172a;
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   Tối ưu toàn diện màn hình điện thoại & tránh che khuất nút bởi widget nổi
   ========================================================================== */

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

    .three-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .prescription-form section {
        padding: 24px 22px;
    }

    .rx-page-title {
        font-size: 23px;
    }
}

@media (max-width: 767px) {
    .prescription-container {
        padding: 0 12px;
        margin: 16px auto 100px !important;
        /* Khoảng trống an toàn chống che khuất bởi nút Zalo/FB */
    }

    .rx-page-header {
        margin: 8px 0 20px;
    }

    .rx-page-title {
        font-size: 20px;
        line-height: 1.35;
        margin-bottom: 6px;
    }

    .rx-page-subtitle {
        font-size: 13.5px;
        line-height: 1.5;
        padding: 0 8px;
    }

    .prescription-form section {
        padding: 18px 14px;
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .prescription-form h1,
    .prescription-form h2 {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .prescription-form label {
        font-size: 13px;
        margin-bottom: 14px;
    }

    /* Font 16px trên mobile ngăn chặn hiện tượng tự động zoom màn hình trên iOS */
    .prescription-form input:not([type=checkbox]):not([type=radio]):not([type=file]),
    .prescription-form select,
    .prescription-form textarea {
        font-size: 16px !important;
        padding: 11px 12px;
        border-radius: 8px;
    }

    /* Tình trạng mắt: dạng lưới 2 cột gọn gàng trên điện thoại */
    .radio-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .radio-row label {
        padding: 9px 10px;
        font-size: 13px;
        justify-content: flex-start;
        border-radius: 8px;
    }

    .radio-row label:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    /* Nút chuyển tab Kính cận / Kính loạn full width */
    .section-title {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 14px;
    }

    .rx-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 3px;
        box-sizing: border-box;
    }

    .rx-tabs span {
        width: 100%;
        text-align: center;
        padding: 8px 10px;
        font-size: 12.5px;
        box-sizing: border-box;
    }

    /* Bảng thông số khúc xạ: hỗ trợ vuốt mượt mà trên mobile */
    .table-scroll {
        border-radius: 8px;
        margin: 0;
    }

    .rx-table {
        min-width: 520px;
        font-size: 13px;
    }

    .rx-table th,
    .rx-table td {
        padding: 8px 4px;
    }

    .rx-table thead th {
        font-size: 11.5px;
        padding: 10px 4px;
    }

    .rx-table tbody th {
        font-size: 12px;
        padding: 8px 8px;
        white-space: nowrap;
    }

    .rx-table input {
        font-size: 15px !important;
        padding: 7px 4px !important;
        border-radius: 6px !important;
    }

    .rx-note {
        font-size: 12.5px;
        padding: 10px 12px;
        border-radius: 8px;
        margin-top: 12px;
        line-height: 1.45;
    }

    .prescription-form .check-label {
        padding: 8px 10px;
        font-size: 13px;
        border-radius: 8px;
    }

    .small-label {
        font-size: 13px;
        margin-top: 12px;
    }

    .prescription-form textarea {
        height: 90px;
    }

    .upload-zone {
        min-height: 125px;
        padding: 16px 12px;
        border-radius: 10px;
    }

    .upload-icon {
        font-size: 22px;
    }

    .upload-zone strong {
        font-size: 12.5px;
    }

    .consent {
        padding: 12px 14px;
        font-size: 12.5px;
        line-height: 1.5;
        border-radius: 10px;
    }

    .confirmation .primary-button {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 10px;
        margin-top: 20px;
    }

    .success-modal {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .success-modal p {
        font-size: 17px;
    }

    .success-check {
        width: 60px;
        height: 60px;
        font-size: 32px;
        line-height: 60px;
        margin-bottom: 18px;
    }
}

/* ==========================================================================
   SERVICE TYPE TABS (CẮT KÍNH / TƯ VẤN ĐO MẮT)
   ========================================================================== */
.rx-tab-text-short {
    display: none;
}

.rx-tab-text-full {
    display: inline;
}

.rx-service-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.rx-service-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 9999px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rx-service-tab-btn:hover {
    border-color: #cbd5e1;
    color: #0f172a;
    background: #f8fafc;
}

.rx-service-tab-btn.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.rx-consult-notice {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: #166534;
    line-height: 1.5;
}

/* ==========================================================================
   GỌNG KÍNH & TRÒNG KÍNH SELECTION CARD (THEO MOCKUP)
   ========================================================================== */
.prescription-form section.rx-selection-card,
.rx-selection-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 26px 30px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.03);
    overflow: visible !important;
    position: relative;
    z-index: 20;
}

.rx-picker-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.rx-picker-group {
    position: relative;
}

.rx-picker-label {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.rx-picker-label em {
    color: #ef4444;
    font-style: normal;
    margin-left: 3px;
    font-weight: 700;
}

/* Rounded Pill Trigger Input (Khớp Mockup Ảnh 2) */
.rx-custom-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 8px 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9999px;
    background: #ffffff;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
    user-select: none;
}

.rx-custom-select:hover {
    border-color: #cbd5e1;
    background: #fbfcfe;
}

.rx-custom-select.is-open {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.rx-select-display {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.rx-placeholder {
    color: #94a3b8;
    font-size: 14.5px;
    font-weight: 400;
}

.rx-selected-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.rx-preview-thumb {
    width: 44px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    object-fit: contain;
    background: #f8fafc;
    flex-shrink: 0;
}

.rx-preview-icon {
    width: 36px;
    height: 32px;
    border-radius: 6px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    flex-shrink: 0;
}

.rx-preview-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.rx-preview-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.rx-preview-subtitle {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.rx-select-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 10px;
}

.rx-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #e2e8f0;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.rx-clear-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
    transform: scale(1.1);
}

.rx-select-arrow {
    color: #64748b;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.rx-custom-select.is-open .rx-select-arrow {
    transform: rotate(180deg);
}

.rx-picker-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

/* Inline Options Card - Gọn gàng, cấu trúc rõ ràng */
.rx-inline-variants {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.rx-inline-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.rx-inline-variants > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.rx-pill-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.35;
    text-align: center;
}

.rx-pill-btn:hover {
    border-color: #0f172a;
    background: #f1f5f9;
}

.rx-pill-btn.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.rx-unselected-tag {
    color: #b45309;
    font-weight: 600;
    font-size: 11.5px;
    background: #fef3c7;
    padding: 1px 8px;
    border-radius: 9999px;
    display: inline-block;
    line-height: 1.4;
}

.rx-highlight-error {
    outline: 2px solid #ef4444 !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
    animation: rxShake 0.4s ease;
}

.rx-inline-error-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 8px 14px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    animation: rxDropdownFade 0.2s ease;
    margin-bottom: 4px;
}

@keyframes rxShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ==========================================================================
   DROPDOWN MENU LIST (Khớp Mockup Ảnh 1)
   ========================================================================== */
.rx-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 18px;
    box-shadow: 0 20px 45px -8px rgba(15, 23, 42, 0.22), 0 4px 16px rgba(15, 23, 42, 0.08);
    z-index: 9999;
    overflow: hidden;
    animation: rxDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rxDropdownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rx-dropdown-search {
    padding: 14px 18px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.rx-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.rx-search-icon {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    pointer-events: none;
    flex-shrink: 0;
    z-index: 2;
}

.prescription-form .rx-search-input-wrap input {
    width: 100% !important;
    height: 44px !important;
    padding: 10px 16px 10px 42px !important;
    border-radius: 9999px !important;
    border: 1.5px solid #cbd5e1 !important;
    background: #f8fafc !important;
    font-size: 14px !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    margin-bottom: 0 !important;
}

.prescription-form .rx-search-input-wrap input:focus {
    outline: none !important;
    border-color: #0f172a !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08) !important;
}

.rx-dropdown-list {
    max-height: 380px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 0;
}

.rx-dropdown-list::-webkit-scrollbar {
    width: 6px;
}
.rx-dropdown-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.rx-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dòng item trong danh sách (Khớp Mockup Ảnh 1) */
.rx-dropdown-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.rx-dropdown-item:last-child {
    border-bottom: none;
}

.rx-dropdown-item:hover {
    background-color: #f8fafc;
}

.rx-dropdown-item.is-selected {
    background-color: #f1f5f9;
}

.rx-item-thumb {
    width: 72px;
    height: 52px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin-right: 16px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.rx-item-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rx-icon-thumb {
    background: #f8fafc;
    color: #475569;
}

.rx-item-info {
    flex: 1;
    min-width: 0;
}

.rx-item-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 3px;
}

.rx-item-desc {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rx-item-price {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin-top: 2px;
}

.rx-item-radio {
    margin-left: 16px;
    flex-shrink: 0;
}

.rx-radio-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.rx-dropdown-item:hover .rx-radio-circle {
    border-color: #64748b;
}

.rx-dropdown-item.is-selected .rx-radio-circle {
    border-color: #0f172a;
    background: #0f172a;
}

.rx-radio-circle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    display: none;
}

.rx-dropdown-item.is-selected .rx-radio-circle::after {
    display: block;
}

.rx-dropdown-empty {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* ==========================================================================
   HỘP TẠM TÍNH CHI PHÍ THAM KHẢO
   ========================================================================== */
.rx-estimate-box {
    margin-top: 18px;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: rxDropdownFade 0.25s ease;
}

.rx-estimate-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rx-estimate-label {
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.rx-estimate-total {
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.rx-estimate-breakdown {
    font-size: 12.5px;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rx-estimate-note {
    font-size: 11.5px;
    color: #94a3b8;
    margin: 4px 0 0;
    line-height: 1.45;
}

@media (max-width: 767px) {
    /* Tabs dịch vụ trên Mobile */
    .rx-tab-text-full {
        display: none !important;
    }
    .rx-tab-text-short {
        display: inline !important;
    }
    .rx-service-tabs {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 20px !important;
    }
    .rx-service-tab-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 44px !important;
        padding: 8px 10px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
        gap: 6px !important;
    }
    .rx-service-tab-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Card Chọn Gọng & Tròng trên Mobile */
    .prescription-form section.rx-selection-card {
        padding: 16px 14px !important;
    }
    .rx-custom-select {
        min-height: 48px;
        padding: 6px 14px;
    }
    .rx-preview-thumb {
        width: 40px;
        height: 30px;
    }
    .rx-preview-title {
        font-size: 13.5px;
    }
    .rx-preview-subtitle {
        font-size: 11.5px;
    }
    .rx-clear-btn {
        width: 22px;
        height: 22px;
    }
    .rx-inline-variants {
        padding: 8px 12px;
    }
    .rx-pill-btn {
        padding: 5px 12px;
        font-size: 11.5px;
    }

    /* Tạm tính chi phí trên Mobile */
    .rx-estimate-box {
        padding: 12px 14px;
        margin-top: 14px;
    }
    .rx-estimate-total {
        font-size: 17px;
    }
}