/**
 * 开心早餐 - 移动端样式
 * Mobile Styles
 */

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 16px;
    z-index: 100;
}

.shop-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-name {
    font-size: 18px;
    font-weight: 600;
}

.shop-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
}

.shop-status.open {
    background: var(--success-color);
}

.shop-status.closed {
    background: var(--text-muted);
}

.shop-announcement {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    display: flex;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 60px;
    overflow: hidden;
}

/* Category Sidebar */
.category-sidebar {
    width: 85px;
    background: #fff;
    overflow-y: auto;
    flex-shrink: 0;
}

.category-list {
    padding: 8px 0;
}

.category-item {
    padding: 14px 8px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.category-item.active {
    background: var(--bg-gray);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* Goods Container */
.goods-container {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-gray);
    padding: 8px;
}

.goods-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Goods Item */
.goods-item {
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    gap: 12px;
}

.goods-image {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.goods-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg-gray);
}

.goods-image .badge {
    position: absolute;
    top: 4px;
    left: 4px;
}

.goods-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.goods-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.goods-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.goods-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.goods-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.goods-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.goods-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
}

.qty-btn.plus {
    background: var(--primary-color);
    color: #fff;
}

.qty-btn.minus {
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-num {
    min-width: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}


/* Cart Bar */
.cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #2d2d2d;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
}

.cart-icon {
    position: relative;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-top: -20px;
    cursor: pointer;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger-color);
    color: #fff;
    font-size: 11px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.cart-info {
    flex: 1;
    padding-left: 16px;
}

.cart-total {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.cart-submit-btn {
    height: 44px;
    padding: 0 24px;
    background: var(--primary-color);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    border-radius: 22px;
    min-width: 100px;
}

.cart-submit-btn:disabled {
    background: #666;
    color: #999;
}

/* Cart Popup */
.cart-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.cart-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-popup {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.cart-popup-overlay.show .cart-popup {
    transform: translateY(0);
}

.cart-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.cart-popup-header h3 {
    font-size: 16px;
}

.cart-clear-btn {
    font-size: 13px;
    color: var(--text-muted);
}

.cart-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-popup-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.cart-popup-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.cart-popup-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Order Confirm Popup */
.order-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.order-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.order-confirm-popup {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    width: 280px;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.order-confirm-overlay.show .order-confirm-popup {
    transform: scale(1);
}

.order-confirm-icon {
    width: 60px;
    height: 60px;
    background: var(--success-color);
    color: #fff;
    font-size: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.order-confirm-popup h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.pickup-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pickup-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.order-amount {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.order-confirm-btn {
    width: 100%;
    height: 44px;
    background: var(--primary-color);
    color: #fff;
    font-size: 16px;
    border-radius: 22px;
}

/* Remark Popup */
.remark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.remark-overlay.show {
    opacity: 1;
    visibility: visible;
}

.remark-popup {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 300px;
}

.remark-popup h3 {
    font-size: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.remark-input {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    margin-bottom: 16px;
}

.remark-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.remark-actions {
    display: flex;
    gap: 12px;
}

.remark-cancel-btn,
.remark-confirm-btn {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    font-size: 15px;
}

.remark-cancel-btn {
    background: var(--bg-gray);
    color: var(--text-secondary);
}

.remark-confirm-btn {
    background: var(--primary-color);
    color: #fff;
}


/* Order History Button */
.order-history-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
}

/* Order History Popup */
.order-history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.order-history-overlay.show {
    opacity: 1;
    visibility: visible;
}

.order-history-popup {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s;
}

.order-history-overlay.show .order-history-popup {
    transform: translateX(0);
}

.order-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.order-history-header h3 {
    font-size: 16px;
}

.order-history-close {
    font-size: 24px;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
}

.order-history-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.order-history-item {
    background: var(--bg-gray);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
}

.order-history-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.order-no {
    font-size: 12px;
    color: var(--text-muted);
}

.order-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-gray);
}

.order-status.waiting,
.order-status.making {
    background: var(--warning-color);
    color: #fff;
}

.order-status.ready {
    background: var(--success-color);
    color: #fff;
}

.order-status.done {
    background: var(--text-muted);
    color: #fff;
}

.order-history-middle {
    margin-bottom: 8px;
}

.order-history-middle .pickup-no strong {
    font-size: 18px;
    color: var(--primary-color);
}

.order-history-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.order-history-bottom .order-amount {
    color: var(--primary-color);
    font-weight: 500;
}

/* Order Detail Popup */
.order-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 201;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.order-detail-overlay.show {
    opacity: 1;
    visibility: visible;
}

.order-detail-popup {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.order-detail-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.order-detail-back {
    font-size: 20px;
    margin-right: 12px;
}

.order-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.order-detail-info {
    background: var(--bg-gray);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.detail-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.pickup-highlight {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.order-detail-items {
    margin-bottom: 16px;
}

.order-detail-items h4 {
    font-size: 14px;
    margin-bottom: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item .item-name {
    flex: 1;
}

.detail-item .item-qty {
    color: var(--text-muted);
    margin-right: 16px;
}

.detail-item .item-price {
    color: var(--primary-color);
}

.order-detail-total {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
}

.order-detail-total span:last-child {
    color: var(--primary-color);
}
