
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    padding-bottom: 80px;
}

/* 门店信息头部 */
.store-header {
    background: white;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.store-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.store-name {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #999;
}
.star-icon {
    flex-shrink: 0;
}
.arrow-icon {
    flex-shrink: 0;
}
.store-distance {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 15px;
    max-width: 750px;
    margin: 0 auto;
}

/* 商品卡片 */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}
.product-card:hover {
    transform: translateY(-2px);
    border-color: #1a1a1a;
}
.product-card.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}
.product-card.out-of-stock:hover {
    transform: none;
    border-color: #e0e0e0;
}

.product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f0f0;
}

.product-info {
    padding: 10px;
    text-align: left;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.product-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid;
}

.product-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.product-price {
    font-size: 18px;
    color: #1a1a1a;
    font-weight: bold;
}

/* 加载和空状态 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #262b29;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-store {
    text-align: center;
    padding: 80px 20px;
}
.empty-store-icon {
    font-size: 64px;
    margin-bottom: 20px;
}
.empty-store-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}
.btn-select-store {
    background: linear-gradient(135deg, #aab278 0%, #6d763a 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-select-store:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.error {
    text-align: center;
    padding: 60px 20px;
    color: #d32f2f;
}

/* 商品详情弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.active {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.modal-content {
    background: white;
    border-radius: 20px 20px 0 0;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    animation: slideUp 0.3s ease;
    -webkit-overflow-scrolling: touch;
}
.modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 18px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.modal-close:hover {
    background: rgba(255,255,255,1);
}
.modal-image-container {
    position: relative;
    width: 100%;
    background: #f5f5f5;
}
.modal-image {
    width: 100%;
    height: 300px;
    object-fit: contain;
    display: block;
}
.modal-body {
    padding: 20px;
}
.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.3;
}
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}
.modal-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid;
    white-space: nowrap;
}
.modal-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 15px;
}
.modal-detail-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}
.modal-disclaimer {
    font-size: 11px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 20px;
}
.modal-spec-section {
    margin-bottom: 20px;
}
.modal-spec-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
}
.modal-spec-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.modal-spec-option {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}
.modal-spec-option:hover {
    border-color: #999;
}
.modal-spec-option.selected {
    background: #6d763a;
    color: white;
    border-color: #6d763a;
}
.modal-spec-option.disabled {
    background: #f2f2f2;
    color: #bbb;
    border-color: #e8e8e8;
    cursor: not-allowed;
}
.modal-spec-option.disabled:hover {
    border-color: #e8e8e8;
}
.modal-footer {
    background: white;
    border-top: 1px solid #f0f0f0;
    padding: 15px 20px;
    margin: 20px;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.modal-price-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.modal-price {
    font-size: 24px;
    color: #1a1a1a;
    font-weight: bold;
}
.modal-quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}
.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #333;
}
.quantity-btn:hover {
    background: #f5f5f5;
}
.quantity-value {
    font-size: 15px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}
.btn-add-cart {
    flex: 1;
    max-width: 180px;
    padding: 12px 24px;
    background: #6d763a;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-add-cart:hover {
    background: #333;
}
.modal-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 购物车按钮 */
.cart-button {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #6d763a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 999;
    transition: all 0.3s ease;
}
.cart-button:hover {
    background: #333;
    transform: scale(1.1);
}
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* 购物车弹窗 */
.cart-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}
.cart-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.cart-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 12px;
}
.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}
.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}
.cart-item-specs {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}
.cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.cart-item-price {
    font-size: 16px;
    font-weight: bold;
    color: #1a1a1a;
}
.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cart-item-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}
.cart-item-qty-btn:hover {
    background: #f5f5f5;
}
.cart-item-qty {
    font-size: 14px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}
.cart-item-delete {
    color: #ff4444;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item-delete:hover {
    opacity: 0.7;
}
.cart-item-delete svg {
    width: 18px;
    height: 18px;
}
.cart-empty {
    text-align: center;
    padding: 80px 20px;
}
.cart-empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
}
.cart-empty-text {
    font-size: 16px;
    color: #999;
}
.cart-footer {
    background: white;
    border-top: 1px solid #f0f0f0;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.cart-total {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cart-total-price {
    font-size: 24px;
    color: #1a1a1a;
    font-weight: bold;
}
.btn-checkout {
    flex: 1;
    max-width: 180px;
    padding: 12px 24px;
    background: #6d763a;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-checkout:hover {
    background: #333;
}

/* 确认弹窗 */
.confirm-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}
.confirm-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}
.confirm-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.confirm-section {
    margin-bottom: 25px;
}
.confirm-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}
.confirm-store-info {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
}
.store-info-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.confirm-store-name {
    font-size: 16px;
    font-weight: 700;
    color: #ea0716;
    margin-bottom: 8px;
}
.confirm-store-address {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}
.confirm-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.confirm-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 8px;
}
.confirm-item-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}
.confirm-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.confirm-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}
.confirm-item-specs {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}
.confirm-item-quantity {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 600;
}
.confirm-item-price {
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-item-total-price {
    font-size: 18px;
    color: #1a1a1a;
    font-weight: bold;
}
.confirm-package-section {
    margin-bottom: 16px;
}
.confirm-package-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}
.confirm-package-options {
    display: flex;
    gap: 10px;
}
.confirm-package-btn {
    flex: 1;
    padding: 10px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}
.confirm-package-btn.selected {
    background: #6d763a;
    color: white;
    border-color: #6d763a;
}
.confirm-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff9e6;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 24px;
}
.confirm-total-price {
    font-size: 24px;
    color: #1a1a1a;
    font-weight: bold;
}
.confirm-footer {
    background: white;
    border-top: 1px solid #f0f0f0;
    padding: 15px 20px;
    display: flex;
    gap: 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.btn-cancel {
    flex: 1;
    padding: 12px 24px;
    background: white;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-cancel:hover {
    background: #f5f5f5;
    border-color: #999;
}
.btn-submit {
    flex: 1;
    padding: 12px 24px;
    background: #6d763a;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-submit:hover {
    background: #333;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .product-grid {
        gap: 10px;
        padding: 10px;
    }
    .product-image {
        width: 140px;
        height: 140px;
        margin: 0 auto;
    }
    .modal-image {
        height: 250px;
    }
}
