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

/* 通用样式 */
button {
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* 统一主题色变量 */
:root {
    --primary-color: #e74c3c;
    --primary-dark: #c0392b;
    --secondary-color: #f8f9fa;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #ddd;
    --success-color: #4CAF50;
}

/* 图片懒加载过渡效果 */
.vegetable-image {
    transition: opacity 0.3s ease-in-out;
}

.vegetable-image.lazy {
    opacity: 0;
}

.vegetable-image.loaded {
    opacity: 1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
    background-color: #f8f9fa;
    padding-bottom: 75px; /* 为底部固定按钮留出空间 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* 容器样式 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 8px;
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #333;
    font-size: 19px;
    margin: 8px 0 12px;
    font-weight: 600;
    padding: 0 5px;
}

h2 {
    margin: 20px 0 15px 0;
    color: #333;
    font-size: 20px;
}

/* 搜索框样式 */
.search-container {
    text-align: center;
    margin-bottom: 12px;
    padding: 0 8px;
    position: relative;
    display: flex;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 搜索按钮样式 */
.search-btn {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-left: 8px;
}

.search-btn:hover {
    background-color: #d35400;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
}

.search-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.1);
}

/* 分类导航样式 */
.category-nav {
    display: flex;
    overflow-x: auto;
    margin: 20px 0;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-btn {
    white-space: nowrap;
    padding: 10px 18px;
    border-radius: 25px;
    background-color: var(--secondary-color);
    color: var(--text-secondary);
    font-size: 14px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.category-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.category-btn.active:hover {
    color: white;
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.search-container input {
    padding: 12px 16px;
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.15);
}

/* 蔬菜列表项样式 */
.vegetable-list {
    margin-top: 3px;
}

/* 热门推荐样式 */
.hot-products-section {
    margin: 20px 0;
    padding: 0 16px;
}

.hot-products-title {
    font-size: 19px;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.hot-products-title i {
    color: var(--primary-color);
    margin-right: 8px;
    font-size: 20px;
}

.hot-products-list {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0;
}

.hot-products-list::-webkit-scrollbar {
    display: none;
}

.hot-product-item {
    min-width: 160px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.hot-product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hot-product-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    transition: transform 0.3s ease;
}

.hot-product-item:hover .hot-product-image {
    transform: scale(1.05);
}

.hot-product-info {
    padding: 10px;
}

.hot-product-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hot-product-price {
    font-size: 17px;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.2);
    width: 100%;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.add-to-cart-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.hot-product-item {
    min-width: 160px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.hot-product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hot-product-image {
    width: 100%;
    height: 60px;
    object-fit: cover;
}

.hot-product-info {
    padding: 10px;
}

.hot-product-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vegetable-item {
     display: flex;
     align-items: center;
     padding: 12px;
     background-color: white;
    margin-bottom: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.vegetable-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.vegetable-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* 已加入购物车的商品背景色 */
.vegetable-item.in-cart {
   /* background-color: #f0f9ff;*/
    border: 1px solid #ff0000;
}

/* 蔬菜图片样式 */
.vegetable-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 12px;
    border: 2px solid var(--secondary-color);
    transition: transform 0.2s ease;
}

.vegetable-item:hover .vegetable-image {
    transform: scale(1.05);
}

/* 蔬菜信息样式 */
.vegetable-info {
    flex: 1;
    min-width: 0;
}

.vegetable-name {
    font-size: 17px;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.vegetable-price {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 700;
}

/* 快捷数量选择样式 */
.quick-quantity {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 220px;
    justify-content: flex-start;
}

.quick-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: 6px;
    font-weight: 500;
}

.quick-btn {
    padding: 5px 0px;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    min-width: 30px;
    text-align: center;
    position: relative;
}

.quick-btn:active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quick-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 一键加购按钮样式 */
.quick-add-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.quick-add-btn:active {
    background-color: var(--primary-dark);
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(231, 76, 60, 0.4);
}

.quick-add-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.quick-add-btn:active::after {
    transform: scale(1.5);
    opacity: 0.2;
}

/* 数量控制样式 */
.quantity-control {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-right: 15px;
}

.quantity-btn {
    width: 40px;
    height: 36px;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    color: var(--text-primary);
    position: relative;
}

.quantity-btn:active {
    background-color: var(--primary-color);
    color: white;
}

.quantity-btn:first-child {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.quantity-btn:last-child {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.quantity-btn:hover {
    background-color: white;
    color: var(--primary-color);
}

.quantity-input {
    width: 50px;
    height: 36px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    -moz-appearance: textfield;
    background-color: white;
    color: var(--text-primary);
}

/* 隐藏数字输入框的上下箭头 */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 底部固定按钮样式 */
.bottom-action {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    padding: 12px 16px;
    box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.1);
    display: block;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cart-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

/* 增强购物车图标显示 */
.cart-icon {
    position: relative;
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
    cursor: pointer;
}

.cart-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.cart-icon:active {
    transform: scale(0.95);
    background-color: var(--secondary-color);
}

.cart-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary-color);
    transition: color 0.2s ease;
}

.cart-icon:hover svg {
    color: var(--primary-dark);
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--primary-color);
    color: white;
    font-size: 13px;
    font-weight: bold;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.view-cart-btn {
    padding: 8px 16px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease;
}

.view-cart-btn:active {
    background-color: #e0e0e0;
}

.order-btn {
    flex: 2;
    padding: 14px 32px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
    min-width: 120px;
    text-align: center;
}

.order-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.order-btn:active {
    background-color: var(--primary-dark);
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.3);
}

/* 数量更新动画 */
.quantity-updated {
    animation: pulse 0.2s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background-color: #f9f9f9; }
    100% { transform: scale(1); }
}

/* 禁用文本选择，优化移动端体验 */
.quantity-control,
.order-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 平板端响应式设计 (768px以下) */
@media (max-width: 768px) {
    .bottom-action {
        display: block;
    }
    
    h1 {
        font-size: 18px;
        margin: 7px 0 10px;
    }
    
    .vegetable-image {
        width: 55px;
        height: 55px;
    }
    
    .vegetable-name {
        font-size: 15px;
    }
    
    .vegetable-price {
        font-size: 14px;
    }
}

/* 购物车弹窗样式 - 移动端优化 */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    transition: all 0.3s ease;
}

.cart-modal.show {
    display: block;
}

.cart-modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.cart-modal.show .cart-modal-content {
    transform: translateY(0);
}

/* 底部安全区域适配 */
@media (max-width: 768px) {
    .cart-modal-content {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
}

/* 增强的购物车样式 */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.cart-actions {
    position: absolute;
    right: 40px;
    display: flex;
    gap: 10px;
}

.cart-action-btn {
    background: none;
    color: #666;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.cart-action-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.select-all-container {
    margin-bottom: 10px;
}

.option-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.option-label input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

.cart-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.cart-item-image {
    width: 70px;
    height: 70px;
    margin-right: 15px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9f9f9;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-name {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 15px;
    color: #e74c3c;
    font-weight: bold;
}

.cart-item-slug {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin: 0 15px;
}

.cart-item-total {
    font-size: 16px;
    font-weight: bold;
    color: #e74c3c;
    min-width: 60px;
    text-align: right;
}

.cart-item-checkbox {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.cart-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-cart-btn {
    background: #f5f5f5;
    border: none;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 0;
    position: relative;
    overflow: hidden;
}

.close-cart-btn::before,
.close-cart-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #666;
    transition: background-color 0.3s ease;
}

.close-cart-btn::before {
    transform: rotate(45deg);
}

.close-cart-btn::after {
    transform: rotate(-45deg);
}

.close-cart-btn:hover {
    background: #ff4444;
    transform: scale(1.1);
}

.close-cart-btn:hover::before,
.close-cart-btn:hover::after {
    background-color: white;
}

.close-cart-btn:active {
    transform: scale(0.95);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 15px;
    color: #e74c3c;
    font-weight: bold;
}

.cart-quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-unit {
    color: #666;
    font-size: 14px;
    min-width: 20px;
    text-align: center;
}

.cart-quantity-btn {
    width: 32px;
    height: 32px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease;
}

.cart-quantity-btn:active {
    background-color: #e0e0e0;
}

/* 购物车数量单位样式 */
.cart-quantity-unit {
    margin: 0 8px;
    color: #666;
    font-size: 14px;
    line-height: 28px;
}

/* 购物车图标上的数量徽章样式 - 隐藏数量显示 */
.cart-count-badge {
    display: none;
}

.cart-quantity-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.cart-quantity-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.cart-quantity-input {
    width: 45px;
    height: 32px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    font-size: 15px;
    outline: none;
    -moz-appearance: textfield;
    background-color: white;
}

/* 购物车商品选中状态样式 */
.cart-item.selected {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
}

/* 全选按钮选中状态样式 */
.select-all-btn.selected {
    color: #e74c3c;
    font-weight: bold;
}

.cart-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.confirm-order-btn,
#final-submit-btn {
    width: 100%;
    padding: 13px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease;
}

.confirm-order-btn:active,
#final-submit-btn:active {
    background-color: #c0392b;
}

/* 订单信息表单样式 - 移动端优化 */
.order-info-form {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}

/* 订单弹窗底部操作区域 */
.order-modal-bottom {
    position: relative;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: white;
}

/* 订单提交按钮样式 - 移动端优化 */
.order-submit {
    width: 100%;
    padding: 18px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    position: relative;
    overflow: hidden;
}

.order-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.order-submit:hover::before {
    left: 100%;
}

.order-submit:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
    transform: translateY(-1px);
}

.order-submit:active {
    background-color: var(--primary-dark);
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* 订单总价显示 */
.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
    font-size: 17px;
}

.order-total-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.order-total-amount {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 20px;
}

/* 订单弹窗关闭按钮样式 */
.order-close {
    background: #f5f5f5;
    border: none;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 0;
    position: relative;
    overflow: hidden;
}

.order-close::before,
.order-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #666;
    transition: background-color 0.3s ease;
}

.order-close::before {
    transform: rotate(45deg);
}

.order-close::after {
    transform: rotate(-45deg);
}

.order-close:hover {
    background: #ff4444;
    transform: scale(1.1);
}

.order-close:hover::before,
.order-close:hover::after {
    background-color: white;
}

.order-close:active {
    transform: scale(0.95);
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background-color: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group textarea {
    height: 100px;
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    font-family: inherit;
    line-height: 1.5;
}

/* 禁用iOS默认的表单样式 */
input[type="text"],
input[type="tel"],
textarea {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.option-label:hover {
    border-color: var(--primary-color);
}

.option-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-label input[type="radio"] + span {
    position: relative;
    padding-left: 30px;
    display: block;
    width: 100%;
}

.option-label input[type="radio"] + span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background-color: white;
    transition: all 0.2s ease;
}

.option-label input[type="radio"]:checked + span::before {
    border-color: var(--primary-color);
    background-color: white;
}

.option-label input[type="radio"]:checked + span::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    transition: all 0.2s ease;
}

.option-label input[type="radio"]:checked + span {
    color: var(--primary-color);
}

.option-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background-color: rgba(231, 76, 60, 0.05);
}

/* 关闭订单弹窗按钮 */
.close-order-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.15s ease;
}

.close-order-btn:active {
    background-color: #f0f0f0;
}

/* 手机端响应式设计 (480px以下) - 优化首屏空间利用 */
@media (max-width: 480px) {
    body {
        padding-bottom: 70px;
    }
    
    .cart-quantity-control {
        gap: 3px;
    }
    
    .cart-unit {
        font-size: 12px;
        min-width: 16px;
    }
    
    .container {
        padding: 5px;
    }
    
    h1 {
        font-size: 17px;
        margin: 5px 0 8px;
    }
    
    .search-container {
        margin-bottom: 8px;
        padding: 0 5px;
    }
    
    .search-container input {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .vegetable-list {
        margin-top: 2px;
    }
    
    .vegetable-item {
        padding: 8px;
        margin-bottom: 5px;
    }
    
    .vegetable-image {
        width: 50px;
        height: 50px;
        margin-right: 8px;
    }
    
    .vegetable-name {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .vegetable-price {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .quantity-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .quantity-input {
        width: 45px;
        height: 30px;
        font-size: 15px;
    }
    
    /* 手机端快捷数量选择样式 */
    .quick-quantity {
        margin-top: 6px;
        gap: 4px;
    }
    
    .quick-label {
        font-size: 11px;
    }
    
    .quick-btn {
        padding: 2px 6px;
        font-size: 11px;
    }
    
    /* 手机端一键加购按钮样式 */
    .quick-add-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
        top: 8px;
        right: 8px;
    }
    
    /* 手机端订单表单样式 */
    .order-info-form {
        padding: 12px 15px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="tel"],
    .form-group textarea {
        padding: 9px;
        font-size: 14px;
    }
    
    .form-group textarea {
        height: 70px;
    }
    
    .option-label {
        font-size: 14px;
    }
    
    .bottom-action {
        padding: 8px 10px;
    }
    
    .cart-info {
        gap: 6px;
    }
    
    .cart-count {
        font-size: 13px;
    }
    
    .view-cart-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .order-btn {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .cart-modal-content {
        max-height: 60vh;
    }
    
    .cart-header {
        padding: 12px 15px;
    }
    
    .cart-header h3 {
        font-size: 17px;
    }
    
    .cart-items {
        padding: 12px 15px;
    }
    
    .cart-footer {
        padding: 12px 15px;
    }
    
    .confirm-order-btn {
        padding: 12px;
        font-size: 16px;
    }
    
    .order-btn {
        padding: 11px;
        font-size: 16px;
    }
}