/* 喵团外卖样式 - Meituan Takeout */

/* 页面容器 */
.mt-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #f5f5f5;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: none;
}

.mt-screen.active {
    display: block;
}

/* 头部 */
.mt-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mt-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.mt-back-btn:hover {
    background: #e8e8e8;
}

.mt-header-title {
    flex: 1;
    text-align: center;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
}

/* 分类导航 */
.mt-categories {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 0;
    overflow-x: auto;
    white-space: nowrap;
    z-index: 99;
    border-bottom: 1px solid #eee;
    scrollbar-width: none;
}

.mt-categories::-webkit-scrollbar {
    display: none;
}

.mt-categories-wrapper {
    display: inline-flex;
    padding: 0 16px;
    gap: 12px;
}

.mt-category-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 20px;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.mt-category-item:hover {
    background: #e8e8e8;
}

.mt-category-item.active {
    background: #1a1a1a;
    color: #fff;
}

.mt-category-icon {
    font-size: 24px;
}

.mt-category-name {
    font-size: 13px;
    font-weight: 500;
}

/* 菜单内容 */
.mt-content {
    margin-top: 156px; /* 留出固定头部(56px)+分类栏(约94px,含图标文字与上下padding)的空间,并留余量 */
    padding: 0 16px 80px; /* 底部留白 80px，避免最后商品被购物车栏(60px)遮挡 */
}

.mt-menu-items {
    display: grid;
    gap: 12px;
}

.mt-menu-item {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.mt-menu-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.mt-item-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.mt-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mt-item-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #1a1a1a;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.mt-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mt-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.mt-item-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mt-item-sales {
    font-size: 12px;
    color: #999;
    margin-bottom: auto;
}

.mt-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.mt-item-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.mt-price-symbol {
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
}

.mt-price-value {
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 700;
}

.mt-original-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

.mt-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mt-btn-increase,
.mt-btn-decrease {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #1a1a1a;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.mt-btn-decrease {
    background: #f5f5f5;
    color: #666;
}

.mt-btn-increase:hover {
    transform: scale(1.1);
}

.mt-btn-decrease:hover {
    background: #e8e8e8;
}

.mt-item-count {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 20px;
    text-align: center;
}

/* 底部购物车栏 */
.mt-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.mt-cart-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1a1a1a;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-right: 12px;
}

.mt-cart-btn:hover {
    transform: scale(1.05);
}

.mt-cart-btn.has-items {
    animation: cart-bounce 0.5s ease;
}

@keyframes cart-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.mt-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff3b30;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.mt-cart-info {
    flex: 1;
}

.mt-cart-price {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.mt-cart-desc {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.mt-view-order-btn {
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    background: #1a1a1a;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mt-view-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 购物车弹窗 */
.mt-cart-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
}

.mt-cart-modal.active {
    display: block;
}

.mt-cart-modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
}

.mt-cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.mt-cart-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mt-cart-actions {
    display: flex;
    gap: 12px;
}

.mt-clear-cart-btn,
.mt-close-cart-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
}

.mt-clear-cart-btn:hover,
.mt-close-cart-btn:hover {
    color: #333;
}

.mt-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.mt-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 12px;
}

.mt-cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.mt-cart-item-info {
    flex: 1;
}

.mt-cart-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.mt-cart-item-price {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 600;
}

.mt-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mt-cart-btn-increase,
.mt-cart-btn-decrease {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #1a1a1a;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mt-cart-btn-decrease {
    background: #ddd;
    color: #666;
}

.mt-cart-item-count {
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.mt-empty-cart {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.mt-empty-cart-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.mt-empty-cart-text {
    font-size: 15px;
    color: #999;
}

.mt-cart-summary {
    padding: 16px;
    background: #f5f5f5;
    border-top: 1px solid #eee;
}

.mt-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.mt-summary-row:last-child {
    margin-bottom: 12px;
}

.mt-summary-total {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.mt-summary-total span:last-child {
    color: #1a1a1a;
}

.mt-checkout-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: #1a1a1a;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mt-checkout-btn:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

.mt-checkout-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 订单追踪弹窗 */
.mt-order-tracking-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mt-order-tracking-modal.active {
    display: flex;
}

.mt-order-tracking-content {
    background: #fff;
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.mt-tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mt-tracking-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.mt-close-tracking-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mt-order-header {
    text-align: center;
    padding: 24px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
}

.mt-order-status-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.mt-order-status-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.mt-order-eta {
    font-size: 14px;
    color: #999;
}

/* 订单进度条 */
.mt-order-progress {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 20px;
}

.mt-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.mt-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    position: relative;
    z-index: 2;
}

.mt-progress-step.active .mt-progress-dot {
    background: #1a1a1a;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15);
}

.mt-progress-label {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.mt-progress-step.active .mt-progress-label {
    color: #333;
    font-weight: 600;
}

.mt-progress-line {
    flex: 1;
    height: 2px;
    background: #ddd;
    margin: 0 -4px;
}

.mt-progress-line.active {
    background: #1a1a1a;
}

/* 订单详情 */
.mt-order-items {
    margin-bottom: 20px;
}

.mt-order-items-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.mt-order-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 8px;
}

.mt-order-item-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.mt-order-item-info {
    flex: 1;
}

.mt-order-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.mt-order-item-price {
    font-size: 13px;
    color: #666;
}

.mt-order-summary {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
}

.mt-order-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.mt-order-summary-row:last-child {
    margin-bottom: 0;
}

.mt-order-total {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    padding-top: 8px;
    border-top: 1px solid #ddd;
    margin-top: 8px;
}

.mt-order-total span:last-child {
    color: #1a1a1a;
}

/* 自定义生成按钮 */
.mt-custom-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.mt-custom-btn:hover {
    background: #e8e8e8;
    transform: rotate(90deg);
}

/* 自定义生成外卖弹窗 */
.mt-custom-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mt-custom-modal.active {
    display: flex;
}

.mt-custom-modal-content {
    background: #fff;
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
}

.mt-custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mt-custom-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.mt-close-custom-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.mt-close-custom-btn:hover {
    background: #e8e8e8;
}

.mt-custom-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mt-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mt-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.mt-form-group input,
.mt-form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #f5f5f5;
    font-size: 15px;
    color: #333;
    transition: all 0.3s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.mt-form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.mt-form-group input:focus,
.mt-form-group select:focus {
    outline: none;
    border-color: #1a1a1a;
    background: #fff;
}

.mt-form-group input::placeholder {
    color: #bbb;
}

.mt-form-ai-row {
    margin-top: 4px;
}

.mt-form-ai-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #1a1a1a;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mt-form-ai-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mt-form-ai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mt-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.mt-form-cancel-btn,
.mt-form-submit-btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mt-form-cancel-btn {
    background: #f5f5f5;
    color: #666;
}

.mt-form-cancel-btn:hover {
    background: #e8e8e8;
}

.mt-form-submit-btn {
    background: #1a1a1a;
    color: #fff;
}

.mt-form-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Toast 提示 */
.mt-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s;
    max-width: 80%;
    text-align: center;
}

.mt-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.mt-toast-success {
    background: rgba(52, 199, 89, 0.9);
}

.mt-toast-error {
    background: rgba(255, 59, 48, 0.9);
}

/* 支付面板 */
.mt-payment-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mt-payment-content {
    background: #fff;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    padding: 24px;
}

.mt-payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mt-payment-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.mt-payment-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.mt-payment-close:hover {
    background: #e8e8e8;
}

.mt-payment-amount {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin: 20px 0;
}

.mt-payment-info {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.mt-payment-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.mt-payment-row:last-child {
    margin-bottom: 0;
}

.mt-payment-insufficient {
    color: #ff3b30;
    font-weight: 600;
}

.mt-payment-warn {
    margin-top: 12px;
    padding: 8px 12px;
    background: #fff3cd;
    border-radius: 8px;
    font-size: 13px;
    color: #856404;
    text-align: center;
}

.mt-payment-recipient {
    margin-bottom: 24px;
}

.mt-payment-recipient-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.mt-payment-recipient-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #f5f5f5;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.mt-payment-recipient-select:focus {
    outline: none;
    border-color: #1a1a1a;
    background-color: #fff;
}

.mt-payment-actions {
    display: flex;
    gap: 12px;
}

.mt-payment-btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mt-payment-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.mt-payment-btn-cancel:hover {
    background: #e8e8e8;
}

.mt-payment-btn-confirm {
    background: #1a1a1a;
    color: #fff;
}

.mt-payment-btn-confirm:hover:not(.mt-payment-btn-disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mt-payment-btn-disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

.mt-toast-info {
    background: rgba(0, 122, 255, 0.9);
}

/* 响应式适配 */
@media (max-width: 375px) {
    .mt-item-image {
        width: 80px;
        height: 80px;
    }
    
    .mt-item-name {
        font-size: 15px;
    }
    
    .mt-price-value {
        font-size: 18px;
    }
}