/* ============================================
   BeforeBuying Homepage — Redesign 2025
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --bb-primary: #2563eb;
    --bb-primary-dark: #1d4ed8;
    --bb-accent: #f97316;
    --bb-accent-dark: #ea6500;
    --bb-text: #111827;
    --bb-muted: #6b7280;
    --bb-light: #f9fafb;
    --bb-border: #e5e7eb;
    --bb-white: #ffffff;
    --bb-radius: 12px;
    --bb-radius-sm: 8px;
    --bb-shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --bb-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --bb-shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --bb-transition: all 0.2s ease;
}

/* ---------- Container ---------- */
#bb-homepage .bb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Hero ---------- */
.bb-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    color: #fff;
    padding: 72px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.bb-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 60% 40%, rgba(37,99,235,0.18) 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, rgba(249,115,22,0.1) 0%, transparent 50%);
    pointer-events: none;
}
.bb-hero-inner {
    max-width: 760px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.bb-hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}
.bb-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
    color: #fff;
}
.bb-hero-accent {
    background: linear-gradient(90deg, #60a5fa, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.bb-hero-sub {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    margin: 0 0 32px;
    line-height: 1.6;
}

/* Stats */
.bb-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50px;
    padding: 14px 8px;
    margin: 0 auto 32px;
    width: fit-content;
    flex-wrap: wrap;
    gap: 0;
}
.bb-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}
.bb-hero-stat strong {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.bb-hero-stat span {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.bb-stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

/* Search */
.bb-hero-search {
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 20px;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.bb-search-icon {
    padding: 0 0 0 18px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.bb-hero-search input[type="text"] {
    flex: 1;
    padding: 16px 12px;
    border: none;
    font-size: 0.95rem;
    color: #111827;
    outline: none;
    background: transparent;
}
.bb-hero-search button {
    padding: 12px 24px;
    background: var(--bb-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    margin: 4px;
    border-radius: 40px;
    transition: var(--bb-transition);
}
.bb-hero-search button:hover { background: var(--bb-accent-dark); }

/* Tags */
.bb-hero-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}
.bb-tags-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}
.bb-hero-tags a {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    padding: 5px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.82rem;
    border: 1px solid rgba(255,255,255,0.18);
    transition: var(--bb-transition);
}
.bb-hero-tags a:hover {
    background: rgba(255,255,255,0.22);
    color: #fff;
}

/* ---------- Sections ---------- */
.bb-section { margin-bottom: 56px; }

.bb-section:first-child { margin-top: 48px; }

.bb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}
.bb-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--bb-text);
}
.bb-section-sub {
    font-size: 0.875rem;
    color: var(--bb-muted);
    margin: 0;
}
.bb-view-all {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--bb-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 4px;
    transition: var(--bb-transition);
}
.bb-view-all:hover { color: var(--bb-primary-dark); }
.bb-view-all svg { transition: transform 0.2s; }
.bb-view-all:hover svg { transform: translateX(2px); }

/* ---------- Budget Cards ---------- */
.bb-range-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.bb-range-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    background: var(--bb-white);
    border: 1.5px solid var(--bb-border);
    border-left: 4px solid var(--card-color, var(--bb-primary));
    border-radius: var(--bb-radius-sm);
    text-decoration: none;
    color: var(--bb-text);
    transition: var(--bb-transition);
    box-shadow: var(--bb-shadow-sm);
}
.bb-range-card:hover {
    border-color: var(--card-color, var(--bb-primary));
    border-left-color: var(--card-color, var(--bb-primary));
    box-shadow: var(--bb-shadow-hover);
    transform: translateY(-2px);
}
.bb-range-icon-wrap {
    width: 44px;
    height: 44px;
    background: var(--bb-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bb-range-icon { font-size: 1.4rem; }
.bb-range-content { flex: 1; min-width: 0; }
.bb-range-label { display: block; font-size: 0.92rem; font-weight: 700; color: var(--bb-text); }
.bb-range-desc { display: block; font-size: 0.75rem; color: var(--bb-muted); margin-top: 2px; }
.bb-range-arrow { color: var(--bb-muted); flex-shrink: 0; }
.bb-range-card:hover .bb-range-arrow { color: var(--card-color, var(--bb-primary)); }

/* ---------- Use Case Cards ---------- */
.bb-usecase-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.bb-usecase-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px;
    background: var(--bb-white);
    border: 1.5px solid var(--bb-border);
    border-radius: var(--bb-radius);
    text-decoration: none;
    color: var(--bb-text);
    transition: var(--bb-transition);
    box-shadow: var(--bb-shadow-sm);
    text-align: center;
}
.bb-usecase-card:hover {
    border-color: var(--bb-primary);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: var(--bb-shadow);
}
.bb-usecase-icon { font-size: 1.8rem; }
.bb-usecase-label { font-size: 0.85rem; font-weight: 700; color: var(--bb-text); }
.bb-usecase-desc { font-size: 0.72rem; color: var(--bb-muted); }

/* ---------- Spec Filter ---------- */
.bb-spec-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: var(--bb-white);
    border: 1.5px solid var(--bb-border);
    border-radius: var(--bb-radius);
    overflow: hidden;
    box-shadow: var(--bb-shadow-sm);
}
.bb-spec-group {
    padding: 20px 20px 24px;
    border-right: 1px solid var(--bb-border);
}
.bb-spec-group:last-child { border-right: none; }
.bb-spec-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bb-border);
}
.bb-spec-icon { font-size: 1rem; }
.bb-spec-group h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bb-text);
    margin: 0;
}
.bb-spec-links { display: flex; flex-direction: column; gap: 6px; }
.bb-spec-links a {
    color: var(--bb-primary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 4px 0;
    transition: var(--bb-transition);
}
.bb-spec-links a:hover {
    color: var(--bb-primary-dark);
    text-decoration: underline;
}

/* ---------- Product Cards ---------- */
.bb-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.bb-card {
    background: var(--bb-white);
    border: 1.5px solid var(--bb-border);
    border-radius: var(--bb-radius);
    overflow: hidden;
    transition: var(--bb-transition);
    box-shadow: var(--bb-shadow-sm);
    display: flex;
    flex-direction: column;
}
.bb-card:hover {
    box-shadow: var(--bb-shadow-hover);
    border-color: #d1d5db;
    transform: translateY(-3px);
}
.bb-card-img-link {
    display: block;
    background: var(--bb-light);
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}
.bb-card-img-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.3s ease;
}
.bb-card:hover .bb-card-img-link img { transform: scale(1.04); }
.bb-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    min-height: 140px;
}
.bb-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--bb-primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bb-new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #10b981;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bb-card-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}
.bb-card-brand {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bb-primary);
}
.bb-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    color: var(--bb-text);
}
.bb-card-title a { color: inherit; text-decoration: none; }
.bb-card-title a:hover { color: var(--bb-primary); }
.bb-rating {
    font-size: 0.78rem;
    color: var(--bb-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}
.bb-rating-star { color: #f59e0b; }
.bb-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--bb-border);
    gap: 8px;
}
.bb-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--bb-text);
}
.bb-btn-amazon {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bb-accent);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    transition: var(--bb-transition);
}
.bb-btn-amazon:hover { background: var(--bb-accent-dark); color: #fff; }

/* ---------- Brands ---------- */
.bb-brands-section { text-align: center; }
.bb-brands-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.bb-brand-chip {
    padding: 10px 28px;
    background: var(--bb-white);
    border: 2px solid var(--bb-border);
    border-radius: var(--bb-radius-sm);
    text-decoration: none;
    color: var(--bb-text);
    font-size: 0.95rem;
    font-weight: 700;
    transition: var(--bb-transition);
    box-shadow: var(--bb-shadow-sm);
}
.bb-brand-chip:hover {
    border-color: var(--bb-primary);
    color: var(--bb-primary);
    box-shadow: var(--bb-shadow);
}

/* ---------- Compare CTA ---------- */
.bb-compare-cta {
    background: linear-gradient(135deg, #eff6ff 0%, #fef3c7 100%);
    border: 1.5px solid #dbeafe;
    border-radius: 16px;
    padding: 48px 32px;
    margin-bottom: 56px;
    text-align: center;
}
.bb-compare-cta-icon { font-size: 2.5rem; margin-bottom: 12px; }
.bb-compare-cta h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 8px; color: var(--bb-text); }
.bb-compare-cta p { color: var(--bb-muted); margin: 0 0 28px; font-size: 0.95rem; }
.bb-compare-cta-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 860px;
    margin: 0 auto;
}
.bb-cmp-select {
    flex: 1;
    min-width: 240px;
    padding: 12px 14px;
    border: 1.5px solid var(--bb-border);
    border-radius: var(--bb-radius-sm);
    font-size: 0.9rem;
    background: #fff;
    color: var(--bb-text);
    outline: none;
    transition: var(--bb-transition);
}
.bb-cmp-select:focus { border-color: var(--bb-primary); }
.bb-vs-badge {
    background: var(--bb-primary);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
    flex-shrink: 0;
}
.bb-btn-compare {
    background: var(--bb-primary);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--bb-radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    transition: var(--bb-transition);
    box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.bb-btn-compare:hover {
    background: var(--bb-primary-dark);
    box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

/* ---------- SEO Content ---------- */
.bb-seo-content {
    border-top: 1px solid var(--bb-border);
    padding-top: 40px;
    margin-bottom: 48px;
}
.bb-seo-content h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 14px; }
.bb-seo-content p { font-size: 0.9rem; color: var(--bb-muted); line-height: 1.7; margin-bottom: 12px; }
.bb-seo-content a { color: var(--bb-primary); }
.bb-seo-content a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .bb-product-grid { grid-template-columns: repeat(3, 1fr); }
    .bb-usecase-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .bb-hero h1 { font-size: 2.2rem; }
    .bb-range-grid { grid-template-columns: repeat(2, 1fr); }
    .bb-spec-filter-grid { grid-template-columns: repeat(2, 1fr); }
    .bb-spec-group:nth-child(2) { border-right: none; }
    .bb-spec-group:nth-child(3) { border-top: 1px solid var(--bb-border); border-right: 1px solid var(--bb-border); }
    .bb-spec-group:nth-child(4) { border-top: 1px solid var(--bb-border); border-right: none; }
    .bb-product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .bb-hero { padding: 48px 16px 56px; }
    .bb-hero h1 { font-size: 1.75rem; }
    .bb-hero-stats { padding: 12px 4px; }
    .bb-hero-stat { padding: 0 12px; }
    .bb-hero-stat strong { font-size: 1rem; }
    .bb-hero-search { border-radius: 12px; }
    .bb-hero-search button { margin: 4px; border-radius: 8px; }
    .bb-range-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .bb-usecase-grid { grid-template-columns: repeat(2, 1fr); }
    .bb-spec-filter-grid { grid-template-columns: 1fr 1fr; }
    .bb-spec-group:nth-child(3) { border-right: 1px solid var(--bb-border); }
    .bb-product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .bb-compare-cta { padding: 32px 16px; }
    .bb-compare-cta-form { flex-direction: column; }
    .bb-cmp-select { min-width: unset; width: 100%; }
    .bb-btn-compare { width: 100%; }
    .bb-section-header { flex-direction: column; gap: 8px; }
}
