/* =========================================================
   菜品预约系统 - 新版样式 v2
   适配：按日期卡片展示 + 午/晚餐切换 + 分类(大荤/小荤/时蔬/汤)
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.dish-app-container {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f8f6f0;
    color: #1e2b2f;
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dish-app-container h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-left: 6px solid #d4a373;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    color: #2d3e42;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ==== 日期选择器（已移除） ==== */

/* ==== 餐段切换 Tabs ==== */
.meal-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #f0ebe2;
    padding: 0.4rem;
    border-radius: 60px;
    border: 1px solid #e5ddd2;
    max-width: 340px;
}

.meal-tab {
    flex: 1;
    padding: 0.6rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 60px;
    font-size: 1rem;
    font-weight: 500;
    color: #5a4b3c;
    cursor: pointer;
    transition: all 0.2s;
}

.meal-tab:hover {
    background: #fcf9f5;
    color: #3d352b;
}

.meal-tab.active {
    background: #d4a373;
    color: white;
    box-shadow: 0 4px 12px rgba(212, 163, 115, 0.35);
}

/* ==== 周菜单卡片网格 ==== */
.week-menu-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.8rem;
    margin-bottom: 2.5rem;
}

.day-card {
    background: white;
    border-radius: 20px;
    padding: 1.2rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03), 0 4px 10px rgba(0,0,0,0.02);
    transition: 0.25s;
    border: 1px solid #edeae3;
    display: flex;
    flex-direction: column;
}

.day-card:hover {
    border-color: #d9c9b2;
    box-shadow: 0 12px 28px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.day-card.disabled-day {
    opacity: 0.55;
    filter: grayscale(0.25);
}

.day-card.disabled-day:hover {
    transform: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03), 0 4px 10px rgba(0,0,0,0.02);
}

/* ==== 日期卡片头部 ==== */
.day-title {
    font-weight: 600;
    font-size: 1.4rem;
    color: #4a3f36;
    padding-bottom: 0.7rem;
    border-bottom: 2px dotted #e5ddd2;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.day-weekday {
    font-size: 1.5rem;
    font-weight: 700;
    color: #b5875e;
}

.day-title .day-status {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.2rem 0.9rem;
    border-radius: 40px;
    color: white;
    font-weight: 500;
}

.day-title .day-status.bookable {
    background: #5a8c5a;
}

.day-title .day-status.disabled {
    background: #a09080;
}

/* ==== 餐段区块 ==== */
.meal-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==== 分类区块 ==== */
.category-block {
    border: 1px solid #f0ebe2;
    border-radius: 14px;
    padding: 0.7rem 0.8rem 0.5rem;
    background: #fcfaf6;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed #e5ddd2;
}

.category-name {
    font-weight: 600;
    color: #3d4e4a;
    font-size: 0.95rem;
}

.category-rule {
    font-size: 0.75rem;
    color: #b5875e;
    background: #fff6ec;
    padding: 0.1rem 0.6rem;
    border-radius: 30px;
}

.dish-list {
    list-style: none;
}

/* ==== 菜品条目 ==== */
.dish-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.1rem;
    border-bottom: 1px solid #f0ebe2;
    font-size: 0.9rem;
    gap: 0.5rem;
}

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

.dish-name {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.dish-thumb {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid #e0d6c8;
    background: #f0ebe2;
}

.dish-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dish-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dish-text .name {
    font-weight: 500;
    color: #2d3e42;
}

.dish-text .desc {
    font-size: 0.72rem;
    color: #9a8a78;
    margin-top: 1px;
}

/* 子分类标签（水产类 / 肉类） */
.sub-cat-tag {
    display: inline-block;
    font-size: 0.68rem;
    padding: 0.05rem 0.45rem;
    border-radius: 20px;
    background: #ede3d6;
    color: #7a5f3e;
    margin-right: 3px;
    vertical-align: middle;
}

/* ==== 单选按钮（二选一） ==== */
.dish-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.radio-select-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    padding: 0.25rem 0.7rem;
    border-radius: 30px;
    background: #fcf9f5;
    border: 1px solid #cfbfaa;
    transition: all 0.2s;
    font-size: 0.8rem;
    color: #3d352b;
}

.radio-select-btn:hover:not(.disabled) {
    background: #f0e7db;
    border-color: #b5875e;
}

.radio-select-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f3efe7;
}

.radio-select-btn input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #b5977a;
    position: relative;
    display: inline-block;
    background: white;
    flex-shrink: 0;
}

.radio-select-btn input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4a373;
}

.radio-select-btn input[type="radio"]:checked ~ .radio-label {
    color: #b5875e;
    font-weight: 600;
}

.radio-select-btn:has(input[type="radio"]:checked) {
    background: #fff6ec;
    border-color: #d4a373;
    box-shadow: 0 2px 6px rgba(212, 163, 115, 0.25);
}

/* ==== 多选：加减按钮 & 加入按钮 ==== */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #f5f0e9;
    padding: 0.1rem 0.3rem;
    border-radius: 30px;
    border: 1px solid #e5ddd2;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #3d352b;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.qty-btn:hover:not(:disabled) {
    background: #d4a373;
    color: white;
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qty-display {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d3e42;
}

.add-cart-btn {
    background: none;
    border: 1px solid #cfbfaa;
    border-radius: 30px;
    padding: 0.25rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #3d352b;
    cursor: pointer;
    transition: 0.15s;
    background: #fcf9f5;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 0.2rem;
}

.add-cart-btn:hover:not(:disabled) {
    background: #d4a373;
    border-color: #b5875e;
    color: white;
}

.add-cart-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.add-cart-btn.in-cart {
    background: #d4a373;
    border-color: #b5875e;
    color: white;
}

/* ==== 购物车区域 ==== */
.cart-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px 24px 0 0;
    padding: 1rem 1.8rem;
    box-shadow: 0 -6px 30px rgba(0,0,0,0.1);
    border-top: 1px solid #e8dfd2;
    border-left: 1px solid #e8dfd2;
    border-right: 1px solid #e8dfd2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 100;
    max-width: 1400px;
    margin: 0 auto;
}

body {
    padding-bottom: 120px;
}

.cart-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    flex: 2;
}

.cart-tag {
    background: #ede3d6;
    border-radius: 40px;
    padding: 0.25rem 1rem 0.25rem 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    position: relative;
}

.cart-tag .tag-name {
    color: #2d3e42;
    font-weight: 500;
}

.cart-tag .tag-qty {
    background: #d4a373;
    color: white;
    border-radius: 30px;
    padding: 0 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.cart-tag .remove-item {
    background: #d9c7ad;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    color: white;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.1rem;
    transition: 0.15s;
}

.cart-tag .remove-item:hover {
    background: #c46a6a;
    transform: scale(1.1);
}

.cart-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    border: none;
    background: #d4a373;
    padding: 0.55rem 1.4rem;
    border-radius: 60px;
    font-weight: 500;
    color: white;
    font-size: 0.92rem;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.02);
    border: 1px solid #c5915e;
}

.btn:hover:not(:disabled) {
    background: #c28f5a;
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-outline {
    background: transparent;
    color: #4f3f30;
    border: 1px solid #cbbaa6;
}

.btn-outline:hover:not(:disabled) {
    background: #f0e7db;
}

/* ==== 预约确认弹窗 ==== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.modal {
    background: white;
    max-width: 440px;
    width: 100%;
    padding: 2rem 1.8rem 1.5rem;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal h2 {
    font-weight: 500;
    font-size: 1.5rem;
    color: #2d3e42;
    text-align: center;
}

.booking-summary {
    background: #f5f0e9;
    padding: 0.9rem 1.2rem;
    border-radius: 20px;
    font-size: 0.92rem;
    color: #3d4e4a;
    line-height: 1.7;
}

.booking-summary .highlight {
    color: #b5875e;
    font-weight: 600;
}

.modal label {
    font-weight: 500;
    color: #3d4e4a;
    margin-bottom: -0.4rem;
    font-size: 0.92rem;
}

.modal input {
    padding: 0.75rem 1rem;
    border: 1px solid #d4cabc;
    border-radius: 60px;
    font-size: 0.95rem;
    width: 100%;
    outline: none;
    background: #fbf9f6;
}

.modal input:focus {
    border-color: #b5875e;
    background: white;
}

.modal-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    margin-top: 0.3rem;
}

.empty-cart-msg {
    color: #80705e;
    font-style: italic;
    font-weight: 300;
    padding: 0.2rem 0;
}

/* ==== Toast ==== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3e42;
    color: #f0ebe2;
    padding: 0.8rem 1.6rem;
    border-radius: 60px;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
    z-index: 10000;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

/* ==== 提示文字 ==== */
.info-note {
    text-align: center;
    font-size: 0.85rem;
    color: #7a6a58;
    margin-top: 1rem;
    border-top: 1px solid #e5ddd2;
    padding-top: 0.9rem;
    line-height: 1.7;
}

.info-note strong {
    color: #b5875e;
}

.empty-menu {
    text-align: center;
    padding: 3rem 1rem;
    color: #7a6a58;
    font-size: 1.1rem;
    background: white;
    border-radius: 20px;
    border: 1px dashed #d9c9b2;
}

/* ==== 移动端适配 ==== */
@media (max-width: 720px) {
    .dish-app-container {
        padding: 1rem 0.8rem;
    }

    .dish-app-container h1 {
        font-size: 1.4rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .dish-app-container .date-selector {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
        gap: 0.3rem;
    }

    .dish-app-container .date-selector input[type="date"] {
        font-size: 0.85rem;
        padding: 0.3rem 0.5rem;
    }

    .dish-app-container .date-selector .booking-hint {
        font-size: 0.72rem;
        padding: 0.2rem 0.6rem;
    }

    .meal-tabs {
        max-width: 100%;
    }

    .week-menu-wrapper {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .cart-section {
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem 1rem;
        border-radius: 24px 24px 0 0;
        gap: 0.8rem;
    }

    .cart-actions {
        justify-content: space-between;
    }

    .btn {
        padding: 0.5rem 1.1rem;
        font-size: 0.88rem;
    }

    .modal {
        padding: 1.5rem 1.2rem 1.2rem;
        border-radius: 24px;
    }
}
