/* ========== 商城首页专用样式 ========== */

/* 下拉刷新旋转动画 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 骨架屏 */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: 12px; }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-card { display: flex; gap: 14px; margin-bottom: 14px; padding: 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.skel-img { width: 100px; height: 100px; }
.skel-text { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.skel-line { height: 16px; border-radius: 8px; }
.skel-line.short { width: 60%; }
.skel-line.long { width: 90%; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 999; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal-content { background: white; border-radius: 20px; padding: 30px; max-width: 360px; width: 90%; text-align: center; animation: modalIn 0.3s ease; }
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-content h3 { margin-bottom: 15px; }
.modal-content .info-line { display: flex; justify-content: space-between; margin: 10px 0; font-size: 15px; }
.modal-content .info-line .label { color: #777; }
.modal-content .info-line .value { font-weight: bold; }
.modal-buttons { display: flex; gap: 10px; margin-top: 20px; }
.modal-buttons button { flex: 1; padding: 12px; border: none; border-radius: 30px; font-size: 16px; font-weight: bold; cursor: pointer; }
.btn-confirm { background: linear-gradient(135deg, #ff6b35, #f7931e); color: white; }
.btn-cancel { background: #eee; color: #333; }

/* 幻灯片 */
.slideshow {
    width: 100%;
    height: auto;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    margin: 0;
    background: linear-gradient(to right, #00d084, #00c853);
}
.slideshow .slides-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}
.slideshow .slides-track .slide-item {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 0;
}
.slideshow .slides-track a, .slideshow .slides-track img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.slideshow .slides-track img {
    border-radius: 0;
}
.slide-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.slide-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
}
.slide-dots span.active {
    background: #fff;
}

/* 双大图模块 */
.big-ads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 15px 15px;
}
.big-ads .big-item {
    border-radius: 12px;
    overflow: hidden;
    height: 100px;
    position: relative;
}
.big-ads .big-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 小图标卡片 */
.icon-cards {
    display: grid;
    gap: 10px;
    padding: 0 15px 15px;
}
.icon-cards a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    padding: 15px 0px 0px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-decoration: none;
    transition: all 0.2s;
}
.icon-cards a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.icon-cards .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    color: #fff;
    font-size: 20px;
    overflow: hidden;
    background-color: #409eff;
}
.icon-cards .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}
.icon-cards .card-icon span {
    font-size: 20px;
}
.icon-cards .card-text {
    font-size: 12px;
    color: #333;
    text-align: center;
    line-height: 1.2;
}

/* 分类标签栏 */
.cat-tabs {
    display: flex;
    align-items: center;
    border-top: 1px solid #eee;
    padding: 10px 0;
    margin: 0 15px;
    gap: 0;
    /* 吸顶效果 */
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.cat-tabs-left {
    display: flex;
    flex: 1;
}
.cat-tabs a {
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    position: relative;
    font-weight: 500;
    padding: 5px 0;
}
.cat-tabs a.active {
    color: #00c853;
    font-weight: bold;
}
.cat-tabs a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background-color: #00c853;
    border-radius: 1px;
}

/* 筛选按钮 */
.cat-tabs .filter-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    font-size: 13px;
    color: #888;
    background: #f5f5f5;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    user-select: none;
    transition: all 0.2s;
}
.cat-tabs .filter-btn:hover {
    color: #555;
    background: #e8e8e8;
}
.cat-tabs .filter-btn.has-filter {
    color: #1a73e8;
    background: #e8f0fe;
    font-weight: 600;
}

/* ========== 类目筛选面板 ========== */

/* 遮罩层 */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 998;
}
.filter-overlay.active {
    display: block;
}

/* 底部面板 */
.filter-panel {
    display: none;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 999;
    max-height: 60vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    animation: filterSlideUp 0.25s ease;
}
.filter-panel.active {
    display: block;
}

@keyframes filterSlideUp {
    from { transform: translateX(-50%) translateY(100%); }
    to { transform: translateX(-50%) translateY(0); }
}

/* 拖拽条 */
.filter-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 3;
    border-radius: 20px 20px 0 0;
}
.filter-handle span {
    width: 40px;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
}

/* 面板头部 */
.filter-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 24px 16px;
    position: sticky;
    top: 28px;
    background: #fff;
    z-index: 2;
    border-radius: 20px 20px 0 0;
}
.filter-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 auto;
}
.filter-close {
    position: absolute;
    right: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-close:hover {
    background: #e8e8e8;
    color: #555;
}

/* 面板内容 */
.filter-body {
    padding: 0 24px 20px;
}

/* 全部选项 */
.filter-all {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8faff;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #1a73e8;
    margin-bottom: 16px;
    transition: background 0.2s;
}
.filter-all:hover {
    background: #eef3ff;
}
.filter-all .check-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    flex-shrink: 0;
}

/* 类目分组 */
.filter-group {
    margin-bottom: 14px;
}
.filter-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    padding: 0 4px;
}
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-tag {
    padding: 8px 16px;
    font-size: 13px;
    color: #555;
    background: #f5f5f5;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.filter-tag:hover {
    background: #e8f0fe;
    color: #1a73e8;
}
.filter-tag.active {
    background: #1a73e8;
    color: #fff;
    font-weight: 600;
}

/* 角标右上角 */
.goods-badge { position: absolute; top: 6px; right: 6px; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; z-index: 2; }

/* 样式A：卡片双列 */
.card-style { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 15px; }
.card-style .goods-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.card-style .goods-card .thumb-wrap { width: 100%; height: 0; padding-bottom: 100%; position: relative; overflow: hidden; border-radius: 12px; }
.card-style .goods-card .thumb-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.card-style .goods-card .info { padding: 12px; }
.card-style .goods-card .info .title { font-size: 14px; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-style .goods-card .info .integral { font-size: 18px; font-weight: 800; color: var(--primary); }
.card-style .goods-card .info .integral small { font-size: 11px; font-weight: 500; }
.card-style .goods-card .info .meta { font-size: 11px; color: #999; margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
.card-style .goods-card .info .meta span { background: #f5f5f5; padding: 2px 6px; border-radius: 8px; }
.card-style .goods-card .info .btn-row { margin-top: 10px; }
.card-style .goods-card .info .btn-row button { width: 100%; padding: 8px; border-radius: 50px; border: none; font-weight: 700; cursor: pointer; font-size: 13px; }
.card-style .goods-card .info .btn-row .btn-enable { background: linear-gradient(135deg, #ff6b35, #f7931e); color: #fff; box-shadow: 0 4px 12px rgba(247,147,30,0.3); }
.card-style .goods-card .info .btn-row .btn-disabled { background: #e0e0e0; color: #999; cursor: not-allowed; }

/* 样式B：列表样式 */
.list-style .goods-item { display: flex; gap: 14px; padding: 16px; background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); margin: 0 15px 12px; }
.list-style .goods-item .thumb-wrap { width: 100px; height: 100px; border-radius: 14px; overflow: hidden; background: #f5f5f5; flex-shrink: 0; position: relative; }
.list-style .goods-item .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.list-style .goods-item .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-style .goods-item .info .title { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-style .goods-item .info .desc { font-size: 13px; color: #888; line-height: 1.3; margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-style .goods-item .info .bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.list-style .goods-item .info .bottom-row .integral { font-size: 20px; font-weight: 800; color: var(--primary); line-height: 1; }
.list-style .goods-item .info .bottom-row .integral small { font-size: 12px; font-weight: 500; }
.list-style .goods-item .info .bottom-row .tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.list-style .goods-item .info .bottom-row .tag.stock { background: #fce8e6; color: #d93025; }
.list-style .goods-item .info .bottom-row .tag.limit { background: #e6f4ea; color: #2d9249; }
.list-style .goods-item .info .bottom-row button { padding: 6px 18px; border-radius: 50px; border: none; font-weight: 700; cursor: pointer; font-size: 14px; white-space: nowrap; margin-left: auto; }
.list-style .goods-item .info .bottom-row .btn-enable { background: linear-gradient(135deg, #ff6b35, #f7931e); color: #fff; box-shadow: 0 4px 12px rgba(247,147,30,0.3); }
.list-style .goods-item .info .bottom-row .btn-disabled { background: #e0e0e0; color: #999; cursor: not-allowed; }

.loading-tip { text-align: center; padding: 20px; color: #999; opacity: 0; height: 1px; }
.loading-tip.show { opacity: 1; height: auto; }
.no-more { text-align: center; padding: 20px; color: #bbb; display: none; }
.no-more.show { display: block; }
