/*!
 * ============================================================================
 *  happiness-store.css —— 幸福宝「我的店铺」页面样式
 * ----------------------------------------------------------------------------
 *  设计约定：
 *    1. 配色 / 圆角 / 阴影 / 容器宽度全部复用 happiness.css 的全局变量；
 *    2. 页面主容器 .store-page 与首页 .container 留白一致（1400px 居中，两侧 20px）；
 *    3. 类名与 happiness-store.js 动态生成的结构严格对应，请勿随意改名。
 * ============================================================================
 */

/* ============ 页面容器（左右留白 = 首页） ============ */
.store-page {
    max-width: var(--container);
    margin: 24px auto 56px;
    padding: 0 20px;
}

/* ============ 店铺头图 Banner ============ */
.store-header {
    position: relative;
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--gradient-topbar);
    box-shadow: var(--shadow-card);
}

.store-banner,
.store-banner-placeholder {
    width: 100%;
    height: 260px;
    display: block;
    object-fit: cover;
}

.store-banner-placeholder {
    background:
        radial-gradient(1100px 420px at 12% -20%, rgba(255, 255, 255, .28), transparent 60%),
        radial-gradient(900px 380px at 100% 120%, rgba(255, 255, 255, .18), transparent 55%),
        var(--gradient-topbar);
}

.store-info-container {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 26px 32px;
    background: linear-gradient(to top,
        rgba(15, 23, 42, .82) 0%,
        rgba(15, 23, 42, .46) 55%,
        rgba(15, 23, 42, 0) 100%);
}

.store-info {
    display: flex;
    align-items: flex-end;
    gap: 22px;
}

.store-logo {
    flex: 0 0 auto;
    width: 96px;
    height: 96px;
    border-radius: 22px;
    background: #fff;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, .92);
    outline: 4px solid rgba(255, 255, 255, .16);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .35);
}

.store-meta {
    flex: 1;
    min-width: 0;
    padding-bottom: 2px;
}

.store-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.store-name {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .28);
}

.store-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.follow-btn {
    background: rgba(255, 255, 255, .16);
    border: 1.5px solid rgba(255, 255, 255, .75);
    color: #fff;
    padding: 9px 26px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}

.follow-btn:hover {
    background: rgba(255, 255, 255, .28);
    transform: translateY(-1px);
}

.follow-btn.followed {
    background: #fff;
    border-color: #fff;
    color: #6d5bd0;
}

.setting-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-circle);
    background: rgba(15, 23, 42, .38);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background .25s ease, transform .25s ease;
}

.setting-btn:hover {
    background: rgba(15, 23, 42, .6);
    transform: rotate(30deg);
}

.store-stats {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .82);
    margin-top: 2px;
}

.stat-divider {
    width: 1px;
    height: 34px;
    background: rgba(255, 255, 255, .28);
}

.store-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.store-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ============ 店内 Tab 导航 ============ */
.store-nav {
    display: flex;
    gap: 4px;
    background: var(--bg-header);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background .25s ease;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color .25s ease;
}

.nav-item:hover {
    background: var(--primary-light);
}

.nav-item:hover .nav-text {
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
}

.nav-item.active .nav-text {
    color: var(--primary);
    font-weight: 700;
}

/* ============ 数据卡片（评分 / 商品 / 时长 / 订单） ============ */
.store-info-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.info-card {
    background: var(--bg-header);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.info-card-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.info-card.rating .info-card-icon   { background: rgba(102, 126, 234, .12); color: #667eea; }
.info-card.products .info-card-icon { background: rgba(79, 172, 254, .14);  color: #3b9eff; }
.info-card.duration .info-card-icon { background: rgba(16, 185, 129, .13);  color: #10b981; }
.info-card.orders .info-card-icon   { background: rgba(250, 112, 154, .13); color: #fa709a; }

.info-card-value {
    font-size: 27px;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    margin-bottom: 4px;
}

.info-card-label {
    font-size: 13.5px;
    color: var(--text-secondary);
}

/* ============ 分类横滑条 ============ */
.category-nav {
    display: flex;
    gap: 8px;
    background: var(--bg-header);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    overflow-x: auto;
    box-shadow: var(--shadow-soft);
    scrollbar-width: thin;
}

.category-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 84px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .25s ease, transform .25s ease;
}

.category-item:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.category-item.active {
    background: var(--primary-light);
}

.category-icon-wrapper {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-topbar);
    box-shadow: 0 6px 14px rgba(102, 126, 234, .28);
}

.category-icon {
    color: #fff;
    font-size: 19px;
}

.category-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.category-item.active .category-name {
    color: var(--primary);
    font-weight: 700;
}

/* ============ 商品区 ============ */
.product-section {
    background: var(--bg-header);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    position: relative;
    padding-left: 14px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--gradient);
}

.section-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13.5px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .25s ease;
}

.section-more:hover {
    color: var(--primary);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: transparent;
    box-shadow: var(--shadow-card);
}

.product-image-wrapper {
    position: relative;
}

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

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    box-shadow: 0 4px 10px rgba(255, 71, 87, .3);
}

.product-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-circle);
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background .25s ease, transform .25s ease;
}

.product-overlay:hover {
    background: rgba(15, 23, 42, .68);
    transform: scale(1.08);
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 18px;
}

.product-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-desc {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-section {
    margin-top: auto;
}

.progress-bar {
    height: 7px;
    margin-bottom: 7px;
    border-radius: 4px;
    overflow: hidden;
    background: #e8edf3;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--gradient);
    transition: width .5s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.sales {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.buy-btn {
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: var(--gradient);
    box-shadow: 0 4px 12px rgba(106, 17, 203, .25);
    transition: transform .25s ease, box-shadow .25s ease;
}

.buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

/* ============ 空状态 ============ */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 54px;
    color: var(--border-strong);
    margin-bottom: 14px;
}

.empty-text {
    font-size: 15px;
}

/* ============ 店铺设置弹窗 ============ */
.setting-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.setting-modal.show {
    display: flex;
}

.setting-popup {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow-pop);
    animation: hxStorePop .22s ease;
}

@keyframes hxStorePop {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.popup-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.popup-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.close-icon {
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .25s ease, transform .25s ease;
}

.close-icon:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.popup-content {
    padding: 24px;
}

.form-item {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 11px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    background: #fff;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.save-btn {
    width: 100%;
    margin-top: 4px;
    padding: 13px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: var(--gradient);
    box-shadow: 0 6px 16px rgba(106, 17, 203, .25);
    transition: transform .25s ease, box-shadow .25s ease;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ============ 响应式 ============ */
@media (max-width: 1200px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .store-info-cards { grid-template-columns: repeat(2, 1fr); }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .store-page { margin-top: 16px; padding: 0 12px; }

    .store-banner,
    .store-banner-placeholder { height: 200px; }

    .store-info-container { padding: 16px; }
    .store-info { gap: 14px; align-items: flex-end; }
    .store-logo { width: 64px; height: 64px; border-radius: 16px; }
    .store-name { font-size: 21px; }
    .store-header-row { margin-bottom: 10px; }
    .follow-btn { padding: 7px 18px; font-size: 13px; }

    .store-stats { gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
    .stat-divider { display: none; }

    .nav-item { padding: 11px 0; }
    .nav-text { font-size: 14px; }

    .product-section { padding: 16px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-image { height: 150px; }
}

@media (max-width: 560px) {
    .store-info-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .info-card { padding: 18px 12px; }
    .product-grid { grid-template-columns: 1fr; }
    .store-header-row { flex-wrap: wrap; }
}
