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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 2rem;
    background-color: #f9fafb;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1 rgba(0, 0, 0, 0.1);
}

/* 标题 */
.title-text {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: #2563eb;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* 省市县选择器 */
.selectors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.custom-select {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.custom-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* ====================== */
/* 店铺工具栏：搜索+下拉+按钮 */
/* ====================== */
.shop-toolbar {
    display: flex;
    flex-wrap: wrap; /* 手机端自动换行 */
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    align-items: center;
}
/* 搜索框样式 */
.search-input {
    flex: 2; /* 占比2份 */
    min-width: 180px;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}
.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
/* 店铺下拉框 */
.shop-select {
    flex: 2;
    min-width: 180px;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background: #fff;
}
/* 进入店铺按钮 */
.enter-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
}
.enter-btn:hover {
    background: #1d4ed8;
}

/* 店铺详情展示框 */
.shop-info-box {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    background: #fefefe;
}
.shop-info-box h3 {
    font-size: 1.1rem;
    color: #2563eb;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* ====================== */
/* 🔥 核心修改：横向滚动容器 */
/* ====================== */
.shop-images-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    /* 关键属性 */
    overflow-x: auto;           /* 启用水平滚动 */
    scroll-behavior: smooth;    /* 平滑滚动 */
    scroll-snap-type: x proximity; /* 滚动吸附效果 */
    -webkit-overflow-scrolling: touch; /* iOS流畅滚动 */
    padding-bottom: 5px;        /* 预留滚动条空间 */
}

/* 隐藏滚动条（美观） */
.shop-images-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}
.shop-images-container {
    -ms-overflow-style: none;  /* IE, Edge */
    scrollbar-width: none;     /* Firefox */
}

/* 店铺图片样式 */
.shop-carousel-item {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    cursor: zoom-in;
    flex-shrink: 0; /* 禁止缩小，保持固定尺寸 */
    scroll-snap-align: start; /* 滚动对齐到起始位置 */
    display: none;
}

/* 店铺详情文本域 */
#shopInfoText {
    width: 100%;
    height: 280px;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    resize: none;
    font-size: 0.95rem;
    line-height: 1.6;
    background: #f9fafb;
}

/* 图片弹窗 */
.img-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}
.modal-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

/* 🔥 移动端适配：同时显示3张，第4张可滑动 */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    body { padding: 1rem 0.5rem; }
    
    /* 计算每张图片宽度：(屏幕宽度-20px边距-30px间距)/3 */
    .shop-carousel-item {
        width: calc((100vw - 40px - 30px)/3);
        max-width: 100px;
        height: auto;
        aspect-ratio: 1/1; /* 保持正方形 */
    }
}

/* PC端：同时显示4张，无需滑动 */
@media (min-width: 769px) {
    .shop-images-container {
        overflow-x: hidden; /* 禁用滚动 */
        flex-wrap: nowrap;  /* 强制不换行 */
    }
}