﻿/* 我的賬單 / 餐牌 / 開臺 — 現代簡約基底 */

body.mybill-page,
body.dishlist-page,
body.opentable-page,
body.member-auth-page {
    margin: 0;
    min-height: 100vh;
    background: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #1f2937;
    font-size: 15px;
    line-height: 1.5;
}

body.mybill-page .box {
    border-radius: 0 0 14px 14px;
    border-color: rgba(0, 0, 0, 0.08);
    margin-bottom: 4px;
}

.mybill-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 14px 8px;
    box-sizing: border-box;
}

.mybill-summary-wrap {
    background: #fff;
    border-radius: 14px;
    padding: 18px 18px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 4px;
}

table.mybill-summary-table {
    width: 100%;
    margin: 0;
    background: transparent !important;
    border-collapse: collapse;
}

table.mybill-summary-table tr {
    background: transparent !important;
}

table.mybill-summary-table tr:hover {
    background: transparent !important;
}

table.mybill-summary-table td {
    border: none !important;
    padding: 7px 0;
    vertical-align: top;
}

table.mybill-summary-table .tdr {
    width: 38%;
    color: #6b7280;
    font-size: 14px;
    text-align: right;
    padding-right: 14px;
    font-weight: normal;
}

table.mybill-summary-table .tdl {
    color: #111827;
    font-weight: 500;
    text-align: left;
}

table.mybill-summary-table tr:first-child .tdl h2,
table.mybill-summary-table tr:first-child .tdr h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.mybill-section-head {
    text-align: center;
    margin: 20px 0 16px;
    padding: 0 4px;
}

.mybill-section-title {
    font-size: 17px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
}

.mybill-status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid rgba(3, 105, 161, 0.12);
}

/* 菜品卡片列表 */
.mybill-dish-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.mybill-dish-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef0f4;
}

.mybill-dish-card__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mybill-dish-card__sn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mybill-dish-card__body {
    flex: 1;
    min-width: 0;
}

.mybill-dish-card__name {
    font-size: 19px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.45;
    word-break: break-word;
}

.mybill-dish-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mybill-dish-card__qty {
    font-size: 17px;
    color: #6b7280;
    font-weight: 500;
}

.mybill-dish-card__price {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
    letter-spacing: 0.02em;
}

.mybill-dish-card__req {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    font-size: 17px;
    color: #6b7280;
    line-height: 1.5;
    word-break: break-word;
}

.mybill-dish-card__req hr {
    display: none;
}

/* 按鈕基底（主頁底部與彈窗共用） */
.mybill-btn {
    appearance: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.12s, box-shadow 0.2s, border-color 0.2s, filter 0.2s;
    box-sizing: border-box;
    min-height: 44px;
    margin: 0;
}

.mybill-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.mybill-btn--sm {
    padding: 6px 12px;
    min-height: 34px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 600;
}

/* 底部操作區：對稱網格，小屏兩列 */
.mybill-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 640px;
    margin: 24px auto 0;
    padding: 0 14px 28px;
    box-sizing: border-box;
}

.mybill-actions .mybill-btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 132px;
    width: auto;
    min-height: 48px;
    padding: 13px 12px;
}

.mybill-actions .mybill-btn:empty {
    display: none;
}

@media (min-width: 520px) {
    .mybill-actions .mybill-btn {
        flex: 1 1 calc(25% - 8px);
        min-width: 0;
    }
}

.mybill-btn--secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mybill-btn--secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.mybill-btn--primary {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: 1px solid rgba(5, 150, 105, 0.5);
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.28);
}

.mybill-btn--primary:hover:not(:disabled) {
    filter: brightness(1.06);
}

.mybill-btn--primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mybill-btn--outline {
    background: #f9fafb;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.mybill-btn--outline:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* 彈窗 */
.mybill-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10060;
}

#billdetail-modal-container.mybill-modal {
    z-index: 10070;
}

.mybill-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.mybill-modal__box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 16px;
    padding: 20px 20px 18px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18), 0 0 1px rgba(15, 23, 42, 0.08);
    max-width: 96vw;
    width: 520px;
    box-sizing: border-box;
}

.mybill-modal__box--wide {
    width: 720px;
    max-height: 88vh;
    overflow: auto;
}

.mybill-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 14px;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.mybill-modal__summary {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 16px;
    line-height: 1.6;
    padding: 12px 14px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
    word-break: break-word;
}

.mybill-modal__section-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef0f4;
}

.mybill-modal__section-title:first-of-type {
    margin-top: 4px;
}

.mybill-modal__scroll {
    max-height: 60vh;
    overflow: auto;
    margin-bottom: 14px;
    border-radius: 12px;
    border: 1px solid #eef0f4;
    background: #fff;
}

.mybill-modal__scroll--dish {
    max-height: 42vh;
}

.mybill-modal__scroll--pay {
    max-height: 32vh;
}

.mybill-modal__footer {
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
}

/* 彈窗內表格：覆蓋 table3.css 深色行 */
body.mybill-page table.mybill-modal-table {
    width: 100%;
    margin: 0;
    background: #fff !important;
    border-collapse: collapse;
    border: none;
}

body.mybill-page table.mybill-modal-table thead tr {
    background: transparent !important;
}

body.mybill-page table.mybill-modal-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc !important;
    color: #374151 !important;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    padding: 11px 12px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
}

body.mybill-page table.mybill-modal-table tbody tr {
    background: #fff !important;
    color: #1f2937 !important;
}

body.mybill-page table.mybill-modal-table tbody tr:hover {
    background: #f9fafb !important;
}

body.mybill-page table.mybill-modal-table tbody td {
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    vertical-align: top;
    word-break: break-word;
}

body.mybill-page table.mybill-modal-table tbody tr:last-child td {
    border-bottom: none;
}

body.mybill-page table.mybill-modal-table--compact tbody td {
    font-size: 13px;
    padding: 8px 10px;
}

.mybill-modal-empty {
    text-align: center;
    color: #6b7280 !important;
    font-size: 14px;
}

/* ========== myorder / mybill：頂欄（與 dishlist 一致）與主內容寬度 ========== */
:is(body.myorder-page, body.mybill-page) #bannertop.box {
    max-width: 640px;
}

/* 頂欄與主內容間距（相對預設 mybill-content 上內邊距減半） */
body.myorder-page .mybill-content {
    padding-top: 1px;
}

/* mybill.view：頂欄與主內容間約 2px（由原 16px 上內邊距改為 2px） */
body.mybill-page .mybill-content {
    padding-top: 2px;
}

/* 頂欄與 dishlist_all 一致：品牌左、主按鈕右（dishlist.css 中 space-between） */
:is(body.myorder-page, body.mybill-page) #bannertop .bannertop__head {
    justify-content: space-between;
    align-items: center;
}

:is(body.myorder-page, body.mybill-page) #bannertop .bannertop__mybill,
:is(body.myorder-page, body.mybill-page) #bannertop .bannertop__to-menu {
    flex: 0 0 auto;
    width: auto;
}

/* mybill 當前頁「我 的 賬 單」強調 */
body.mybill-page #bannertop .bannertop__btn--here {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.45);
    cursor: default;
}

.myorder-badge {
    background: #fef3c7;
    color: #b45309;
    border-color: rgba(180, 83, 9, 0.2);
}

.mybill-dish-card--order .mybill-dish-card__row--order {
    align-items: flex-start;
}

.mybill-dish-card__orderline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-top: 6px;
}

.mybill-dish-card__unit {
    font-size: 15px;
    color: #6b7280;
    font-weight: 500;
}

.mybill-dish-card__del {
    flex-shrink: 0;
    min-width: 40px;
    padding: 8px 10px !important;
    line-height: 1;
}

.mybill-modal__box--confirm {
    width: min(92vw, 400px);
}

.mybill-modal__footer--split {
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.mybill-modal__footer--split .mybill-btn {
    flex: 1 1 auto;
    min-width: 120px;
}

#btnSubmit2 {
    font-size: 18px;
}

.myorder-ft-wrap {
    max-width: 640px;
    margin: 8px auto 0;
    padding: 0 14px;
    box-sizing: border-box;
}

.myorder-ft-inner {
    padding-bottom: 18px !important;
}

.myorder-cb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 15px;
    color: #374151;
    cursor: pointer;
}

.myorder-cb-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #059669;
}

.myorder-addr-input {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 0 14px;
    font-size: 15px;
    color: #111827;
    background: #fff;
    margin-bottom: 8px;
}

.myorder-addr-input::placeholder {
    color: #9ca3af;
}

.myorder-ft-hint {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* myorder：堂食 / 打包（覆蓋 dishlist.css 全局 section 浮動/滾動） */
body.myorder-page .myorder-dining-section {
    width: 100%;
    float: none;
    height: auto;
    max-height: none;
    overflow: visible;
    max-width: 640px;
    margin: 16px auto 0;
    padding: 0 14px;
    box-sizing: border-box;
}

body.myorder-page .myorder-dining-label {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

body.myorder-page .myorder-dining-options {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

body.myorder-page .myorder-dining-opt {
    flex: 1 1 0;
    min-width: 0;
    max-width: 144px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    position: relative;
    box-sizing: border-box;
}

body.myorder-page .myorder-dining-opt input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

body.myorder-page .myorder-dining-opt__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

body.myorder-page .myorder-dining-opt__icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

body.myorder-page .myorder-dining-opt__text {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

body.myorder-page .myorder-dining-opt.is-selected {
    border-color: #10b981;
    background: #ecfdf5;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

body.myorder-page .myorder-dining-opt.is-selected .myorder-dining-opt__text {
    color: #059669;
}

body.myorder-page .myorder-phone-wrap {
    margin: 12px auto 0;
    max-width: 300px;
}

body.myorder-page .myorder-phone-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

body.myorder-page .myorder-phone-input {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 0 14px;
    font-size: 15px;
    color: #111827;
    background: #fff;
}

body.myorder-page .myorder-phone-input::placeholder {
    color: #9ca3af;
}

body.myorder-page .myorder-phone-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
