/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 优化文本渲染 */
    text-rendering: optimizeLegibility;
    /* 防止iOS横屏字体放大 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html {
    height: 100%;
    /* 优化滚动性能 */
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    padding-bottom: 20px;
    /* 优化移动端滚动 */
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

/* 0. 顶部导航栏样式 */
.header {
    width: 100%;
    height: 60px;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    width: 80px;
    height: 40px;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
}

.lang-btn {
    padding: 8px 16px;
    background-color: #ff6b00;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 60px;
}

.lang-btn:active {
    background-color: #e55a00;
    transform: scale(0.95);
}

/* 1. 轮播组件样式 */
.carousel-container {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background-color: #eee;
    border-radius: 16px 16px 16px 16px;
    /* 优化GPU渲染 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.carousel-wrapper {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
    /* 启用GPU硬件加速 */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 防止内容溢出 */
    overflow: hidden;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #f0f0f0;
    /* 图片加载优化 */
    image-rendering: -webkit-optimize-contrast;
    /* 优化图片渲染 */
    content-visibility: auto;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transition: background-color 0.3s;
}

.carousel-indicator.active {
    background-color: #fff;
}

/* 2. 位置标签样式 */
.location-label {
    text-align: center;
    padding: 10px 0;
    font-size: 16px;
    color: #666;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

/* 3. 地图展示区域样式 */
.map-container {
    width: 100%;
    height: 300px;
    position: relative;
    background-color: #fff;
}

.map-box {
    width: 100%;
    height: 100%;
}

/* 隐藏高德地图默认控件 */
/*.map-box .amap-logo,*/
.map-box .amap-copyright,
.map-box .amap-scale-control,
.map-box .amap-toolbar,
.map-box .amap-ui-control-zoom,
.map-box .amap-zoom {
    display: none !important;
}

/* 缩小地图字体大小 */
.map-box .amap-marker-label,
.map-box .amap-info-content,
.map-box .amap-mcode,
.map-box .amap-geo,
.map-box span {
    font-size: 6px !important;
}

.location-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    color: #999;
}

.location-error p {
    margin: 5px 0;
}

.location-error .hint {
    font-size: 12px;
    color: #bbb;
}

/* 4. 位置搜索区域样式 */
.search-container {
    display: flex;
    padding: 10px;
    background-color: #fff;
    gap: 10px;
}

.search-input {
    flex: 4;
    height: 40px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: #ff6b00;
}

.search-btn {
    flex: 1;
    height: 40px;
    background-color: #ff6b00;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:active {
    background-color: #e55a00;
}

/* 5. 店铺卡片列表样式 */
.store-list {
    padding: 10px;
    background-color: #f5f5f5;
}

.store-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.store-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.store-phone, .store-address, .store-whatsapp {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.store-phone::before {
    content: "📞";
    margin-right: 5px;
}

.store-whatsapp::before {
    content: "💬";
    margin-right: 5px;
}

.store-address::before {
    content: "📍";
    margin-right: 5px;
}

/* 6. 到店优惠卡样式 */
.coupon-card {
    margin: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe4c4 100%);
    border: 2px solid #ffcc80;
    border-radius: 12px;
}

.coupon-title {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b00;
    margin-bottom: 12px;
    text-align: center;
}

.coupon-content {
    font-size: 14px;
    color: #666;
}

.coupon-item {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
}

.coupon-label {
    color: #999;
    min-width: 80px;
}

.coupon-value {
    color: #333;
    flex: 1;
}

/* 7. 加入咨询模块样式 */
.consult-module {
    padding: 10px;
    background-color: #fff;
}

.consult-btn {
    width: 100%;
    height: 48px;
    background-color: #ff6b00;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.consult-btn:active {
    background-color: #e55a00;
}

/* 8. 官方说明模块样式 */
.footer {
    padding: 20px 10px;
    text-align: center;
    font-size: 12px;
    color: #dfd5d5;
    line-height: 1.8;
    background-color: #1b1a1a;
    margin-top: 10px;
}

/* 9. 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* 启用GPU硬件加速 */
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* 防止滚动穿透 */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal {
    position: relative;
    width: 90%;
    max-width: 420px;
    max-height: 75vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.8) translateY(30px) translateZ(0);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* 启用GPU硬件加速 */
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0) translateZ(0);
    -webkit-transform: scale(1) translateY(0) translateZ(0);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.modal-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
    z-index: 1;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

.modal-body {
    padding: 20px 24px;
    background: #fff;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.store-name-highlight {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    line-height: 1.3;
}

.modal-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.modal-item-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.modal-item-icon.phone-icon {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A52 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.modal-item-icon.whatsapp-icon {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.modal-item-icon.address-icon {
    background: linear-gradient(135deg, #FFA726 0%, #FB8C00 100%);
    box-shadow: 0 4px 12px rgba(255, 167, 38, 0.3);
}

.modal-item-icon.time-icon {
    background: linear-gradient(135deg, #26C6DA 0%, #00ACC1 100%);
    box-shadow: 0 4px 12px rgba(38, 198, 218, 0.3);
}

.modal-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-value {
    font-size: 15px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.modal-footer {
    padding: 16px 24px 20px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.navigate-btn {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #ebe70f 0%, #f58c04 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
    position: relative;
    overflow: hidden;
}

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

.navigate-btn:hover::before {
    left: 100%;
}

.navigate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(74, 144, 226, 0.5);
}

.navigate-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

/* 咨询表单样式 */
.consult-modal .form-group {
    margin-bottom: 15px;
}

.consult-modal label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.consult-modal input,
.consult-modal textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.consult-modal input:focus,
.consult-modal textarea:focus {
    border-color: #ff6b00;
}

.consult-modal textarea {
    height: 80px;
    resize: none;
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.loading::after {
    content: "";
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 懒加载图片占位 */
.lazy-image {
    background-color: #f0f0f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect fill='%23e0e0e0' width='100' height='100'/%3E%3Ctext x='50' y='50' font-size='12' text-anchor='middle' dy='.3em' fill='%23999'%3E加载中...%3C/text%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
}
