/* ============================================================
   迅达酷客 - SSL证书商城页样式 v2.0
   配套 main.css 「云脉 Indigo」设计系统
   覆盖：page-hero / 筛选器（含品牌图标尺寸约束）/ 产品网格 / FAQ / CTA
   ============================================================ */

/* ---------- 页面 Hero ---------- */
.page-hero {
    position: relative;
    padding: 72px 0 64px;
    background: var(--gradient-hero);
    color: #fff;
    text-align: center;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 480px 320px at 12% -10%, rgba(255, 255, 255, 0.14), transparent 60%),
        radial-gradient(ellipse 520px 360px at 88% 110%, rgba(167, 139, 250, 0.22), transparent 60%);
    pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    backdrop-filter: blur(6px);
}
.hero-badge i { font-size: 13px; }

.page-hero h1 {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}
.page-hero > .container > p {
    font-size: 16px;
    opacity: 0.88;
    max-width: 560px;
    margin: 0 auto;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 36px;
    flex-wrap: wrap;
}
.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.92;
}
.hero-feature i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* ---------- 筛选器 ---------- */
.filters-section {
    margin-top: -32px;
    position: relative;
    z-index: 2;
    padding-bottom: var(--space-lg);
}
.filters-section .container {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 20px 28px;
}

.filter-group {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-light);
}
.filter-group:last-child { border-bottom: none; }

.filter-label {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding-top: 9px;
    min-width: 60px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.filter-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-50);
}
.filter-btn.active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ★ 品牌筛选按钮：固定高度，图标严格限尺寸，防止篡位 */
.brand-filter-btn {
    height: 40px;
    padding: 6px 14px;
    border-radius: var(--radius-md);
}
.brand-filter-btn img {
    /* 统一高度：各厂商 logo 宽高比不同，高度一致视觉才整齐 */
    height: 16px;
    width: auto;
    max-width: 96px;
    object-fit: contain;
    display: block;
    transition: filter var(--transition);
}
.brand-filter-btn:hover img { filter: none; }
.brand-filter-btn.active img {
    /* 激活态白底徽章，保证彩色logo可读 */
    filter: none;
}
.brand-filter-btn span { font-size: 13px; }

/* ---------- 产品区标题 / 搜索 ---------- */
.products-section { padding: var(--space-xl) 0 var(--space-3xl); }

.products-section .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    text-align: left;
    margin-bottom: var(--space-lg);
}

.product-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    transition: all var(--transition);
}
.product-count.highlight {
    color: var(--primary);
    border-color: var(--primary-200);
    background: var(--primary-50);
}

.search-box { position: relative; min-width: 240px; }
.search-input-wrapper { position: relative; display: flex; align-items: center; }
.search-input {
    width: 100%;
    height: 38px;
    padding: 8px 34px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition);
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}
.search-icon {
    position: absolute;
    left: 13px;
    color: var(--text-tertiary);
    font-size: 13px;
    pointer-events: none;
}
.search-clear {
    position: absolute;
    right: 12px;
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    display: none;
    transition: color var(--transition);
}
.search-clear:hover { color: var(--danger); }
.search-clear.show { display: block; }
.search-input-wrapper.has-value .search-clear { display: block; }

/* ---------- 产品网格 ---------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

@keyframes productCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 24px;
    transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: productCardIn 0.4s ease both;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}
.product-card:hover::before { transform: scaleX(1); }

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 10px;
}

.product-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* ★ 品牌 Logo 容器：固定尺寸，图标不篡位 */
.product-brand-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 38px;
    min-width: 52px;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}
.product-brand-logo-wrapper img,
.product-brand img {
    /* 统一高度，宽度自适应（容器 52x38，上限 42px 宽） */
    height: 22px;
    width: auto;
    max-width: 42px;
    object-fit: contain;
    display: block;
}
/* 无 logo 时的品牌首字母占位 */
.brand-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-50);
    border-radius: calc(var(--radius-sm) - 2px);
    user-select: none;
}

.product-brand-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.35;
    transition: color var(--transition);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.product-card:hover .product-brand-name { color: var(--primary); }

.product-type {
    background: var(--primary-50);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.product-price { margin-bottom: 14px; }
.product-price .price {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.product-price .period {
    color: var(--text-tertiary);
    font-size: 12px;
    margin-left: 4px;
    font-weight: 400;
}

.product-scope {
    background: var(--bg-muted);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    display: inline-block;
    font-weight: 500;
    align-self: flex-start;
}

.product-features { list-style: none; margin-bottom: 16px; flex-grow: 1; }
.product-features li {
    padding: 5px 0;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.product-features i {
    color: var(--success);
    margin-right: 8px;
    font-size: 12px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.product-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.product-detail-btn {
    padding: 7px 14px;
    font-size: 13px;
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    font-weight: 500;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.product-detail-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}
.product-detail-btn i { font-size: 11px; }

.product-buy-btn {
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
}
.product-buy-btn i { font-size: 11px; }

/* 空状态 */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}
.no-products i { font-size: 56px; margin-bottom: 16px; opacity: 0.35; }
.no-products p { font-weight: 500; margin-bottom: 12px; color: var(--text-secondary); }
.no-products .help-text { font-size: 13px; color: var(--text-tertiary); }

/* 加载状态 */
.products-loading { text-align: center; padding: 40px 20px; display: none; }
.products-loading.active { display: block; }
.products-grid.loading { opacity: 0.5; pointer-events: none; }

/* ---------- FAQ ---------- */
.faq-section { padding: var(--space-3xl) 0; background: var(--bg-card); }
.faq-title { text-align: center; margin-bottom: var(--space-2xl); }
.faq-title h2 { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; letter-spacing: -0.02em; }
.faq-title p { font-size: 15px; color: var(--text-secondary); }

.faq-list {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.faq-item {
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    border: 1px solid var(--border-light);
    transition: all var(--transition);
}
.faq-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-200);
}
.faq-question {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.faq-question i { color: var(--primary); font-size: 16px; flex-shrink: 0; }
.faq-answer {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 26px;
}

/* ---------- CTA ---------- */
.cta-section {
    padding: var(--space-3xl) 0;
    background: var(--gradient-hero);
    color: var(--text-inverse);
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 600px 300px at 50% -20%, rgba(255, 255, 255, 0.12), transparent 60%);
    pointer-events: none;
}
.cta-content { position: relative; z-index: 1; text-align: center; max-width: 700px; margin: 0 auto; }
.cta-content h2 { font-size: 32px; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.02em; }
.cta-content p { font-size: 16px; margin-bottom: 32px; opacity: 0.9; line-height: 1.6; }
.cta-buttons { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.cta-btn {
    padding: 13px 34px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    display: inline-block;
    transition: all var(--transition);
}
.cta-btn-primary { background: var(--text-inverse); color: var(--primary); box-shadow: var(--shadow-md); }
.cta-btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cta-btn-outline { background: transparent; color: var(--text-inverse); border: 1.5px solid rgba(255, 255, 255, 0.55); }
.cta-btn-outline:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--text-inverse); }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .page-hero { padding: 52px 0 48px; }
    .page-hero h1 { font-size: 26px; }
    .hero-features { gap: 18px; margin-top: 26px; }
    .filters-section { margin-top: -24px; }
    .filters-section .container { padding: 14px 16px; }
    .filter-group { flex-direction: column; gap: 8px; }
    .filter-label { padding-top: 0; }
    .brand-filter-btn { height: 36px; padding: 5px 10px; }
    .brand-filter-btn img { height: 14px; max-width: 72px; }
    .products-section .section-title { flex-direction: column; align-items: stretch; }
    .search-box { width: 100%; min-width: auto; }
    .faq-list { grid-template-columns: 1fr; }
    .cta-content h2 { font-size: 24px; }
    .cta-buttons { flex-direction: column; align-items: stretch; padding: 0 20px; }
    .cta-btn { text-align: center; }
    .products-grid { grid-template-columns: 1fr; }
}
