/* ============================================
   CATEGORY PAGES — Shared Styles
   Reused across tablets, laptops, earbuds,
   e-readers, and smartwatches pages.
   Smartphones has its own file for legacy reasons
   but shares the same design tokens.
   ============================================ */

/* BREADCRUMB */
.breadcrumb-bar {
    padding-top: 88px;
    background: var(--color-bg-alt);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.breadcrumb a {
    color: var(--color-text-light);
    transition: color var(--transition);
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb .current {
    color: var(--color-dark);
    font-weight: 600;
}

.breadcrumb svg {
    color: var(--color-text-light);
    opacity: 0.5;
    flex-shrink: 0;
}

/* PAGE HERO */
.page-hero {
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-primary-light) 60%, #dbeafe 100%);
    padding: 48px 0 64px;
}

.page-hero-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: center;
}

.page-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 20px;
    border: 1px solid rgba(0,113,227,0.15);
}

.page-hero-badge svg {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.page-hero h1 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.page-hero p {
    font-size: 1.1rem;
    color: var(--color-text-light);
    line-height: 1.7;
    max-width: 540px;
}

.page-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.hero-stat {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    transition: all var(--transition);
}

.hero-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.hero-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-weight: 500;
}

/* SCORE EXPLAINER */
.score-explainer {
    padding: 0;
    background: var(--color-bg);
}

.score-legend {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 20px 28px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    margin-top: -28px;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.score-legend h3 {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.legend-items {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: 500;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-excellent { background: #34c759; }
.legend-good { background: #0071e3; }
.legend-fair { background: #ff9500; }
.legend-poor { background: #ff3b30; }

/* FILTERS */
.filters-section {
    padding: 32px 0 16px;
    background: var(--color-bg);
    position: sticky;
    top: 72px;
    z-index: 50;
    border-bottom: 1px solid var(--color-border);
}

.filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 32px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
}

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

.chip {
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.chip:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.chip.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.sort-select {
    padding: 8px 36px 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: all var(--transition);
}

.sort-select:hover,
.sort-select:focus {
    border-color: var(--color-primary);
    outline: none;
}

.view-toggle {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.view-btn {
    padding: 8px 12px;
    background: var(--color-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    transition: all var(--transition);
}

.view-btn + .view-btn {
    border-left: 1px solid var(--color-border);
}

.view-btn.active {
    background: var(--color-primary);
    color: #fff;
}

.view-btn:hover:not(.active) {
    background: var(--color-bg-alt);
    color: var(--color-primary);
}

/* PRODUCT GRID */
.products-section {
    padding: 40px 0 80px;
    background: var(--color-bg);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    transition: all 0.4s ease;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
    gap: 16px;
}

/* PRODUCT CARD */
.product-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

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

.product-card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-card-badge.best-pick {
    background: var(--color-success);
    color: #fff;
}

.product-card-badge.editors-choice {
    background: var(--color-primary);
    color: #fff;
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-bg-alt);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 2px;
    line-height: 1.3;
}

.product-year {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

/* SCORE RING */
.product-score-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.score-ring {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.score-ring svg {
    width: 64px;
    height: 64px;
    transform: rotate(-90deg);
}

.score-circle {
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-dark);
}

.score-label {
    font-size: 0.9rem;
    font-weight: 600;
}

/* DETAIL BARS */
.product-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-label {
    font-size: 0.78rem;
    color: var(--color-text-light);
    width: 100px;
    flex-shrink: 0;
    font-weight: 500;
}

.detail-bar {
    flex: 1;
    height: 6px;
    background: #e8e8ed;
    border-radius: 3px;
    overflow: hidden;
}

.detail-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--color-primary);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* HIGHLIGHTS */
.product-highlights {
    list-style: none;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-highlights li {
    font-size: 0.82rem;
    color: var(--color-text-light);
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.product-highlights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary-light);
    border: 2px solid var(--color-primary);
}

/* LIST VIEW */
.products-grid.list-view .product-card {
    flex-direction: row;
    align-items: stretch;
}

.products-grid.list-view .product-image {
    width: 220px;
    aspect-ratio: 1 / 1;
    height: auto;
    flex-shrink: 0;
    padding: 16px;
}

.products-grid.list-view .product-info {
    padding: 24px 28px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto 1fr;
    gap: 0 28px;
    align-items: start;
}

.products-grid.list-view .product-brand { grid-column: 1; grid-row: 1; }
.products-grid.list-view .product-name { grid-column: 1; grid-row: 2; }
.products-grid.list-view .product-year { grid-column: 1; grid-row: 3; margin-bottom: 0; }
.products-grid.list-view .product-score-wrap { grid-column: 2; grid-row: 1 / 4; align-self: center; margin-bottom: 0; }
.products-grid.list-view .product-details { grid-column: 3; grid-row: 1 / 4; align-self: center; margin-bottom: 0; min-width: 260px; }
.products-grid.list-view .product-highlights { display: none; }
.products-grid.list-view .product-card-badge { top: 12px; left: 12px; }

/* RESULTS INFO */
.results-info {
    text-align: center;
    padding: 24px 0 0;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.results-info strong {
    font-weight: 700;
    color: var(--color-dark);
}

.product-card.hidden { display: none; }

/* COMPARISON TABLE */
.comparison-section {
    padding: 80px 0;
    background: var(--color-bg-alt);
}

.comparison-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--color-bg);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.925rem;
}

.comparison-table thead {
    background: var(--color-bg-dark);
    color: #fff;
}

.comparison-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.comparison-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table tbody tr { transition: background var(--transition); }
.comparison-table tbody tr:hover { background: var(--color-bg-alt); }

.brand-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.table-score { font-size: 1.3rem; font-weight: 800; }
.table-score.excellent { color: #34c759; }
.table-score.good { color: #0071e3; }
.table-score.fair { color: #ff9500; }
.table-score.poor { color: #ff3b30; }

.table-bar {
    width: 100px;
    height: 8px;
    background: #e8e8ed;
    border-radius: 4px;
    overflow: hidden;
}

.table-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.table-fill.excellent { background: #34c759; }
.table-fill.good { background: #0071e3; }
.table-fill.fair { background: #ff9500; }
.table-fill.poor { background: #ff3b30; }

.verdict-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.verdict-badge.excellent { background: #e8f9ed; color: #1a8a3a; }
.verdict-badge.good { background: var(--color-primary-light); color: var(--color-primary-dark); }
.verdict-badge.fair { background: #fff3e0; color: #c66900; }
.verdict-badge.poor { background: #ffeaea; color: #c62828; }

/* METHODOLOGY */
.methodology {
    padding: 80px 0;
    background: var(--color-bg);
}

.methodology-inner {
    max-width: 900px;
    margin: 0 auto;
}

.methodology-inner h2 {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    text-align: center;
    margin-bottom: 12px;
}

.methodology-inner > p {
    text-align: center;
    color: var(--color-text-light);
    font-size: 1.05rem;
    margin-bottom: 48px;
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.method-card {
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.method-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.method-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-primary);
    opacity: 0.3;
    margin-bottom: 8px;
    line-height: 1;
}

.method-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.method-card p { font-size: 0.92rem; color: var(--color-text-light); line-height: 1.7; }

/* PAGE CTA */
.page-cta {
    padding: 80px 0;
    background: var(--color-bg-alt);
}

.page-cta-inner {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0058b0 50%, #003d7a 100%);
    border-radius: var(--radius-xl);
    padding: 64px 56px;
    text-align: center;
    color: #fff;
}

.page-cta-inner h2 {
    color: #fff;
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    margin-bottom: 14px;
}

.page-cta-inner p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto 28px;
}

.page-cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .page-hero-inner { grid-template-columns: 1fr; gap: 32px; }
    .page-hero-stats { max-width: 480px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .products-grid.list-view .product-info { grid-template-columns: 1fr; gap: 4px; }
    .products-grid.list-view .product-score-wrap { grid-column: 1; grid-row: auto; }
    .products-grid.list-view .product-details { grid-column: 1; grid-row: auto; min-width: 0; }
}

@media (max-width: 768px) {
    .page-hero { padding: 32px 0 48px; }
    .page-hero-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .hero-stat { padding: 16px 10px; }
    .hero-stat-number { font-size: 1.5rem; }
    .score-legend { flex-direction: column; align-items: flex-start; gap: 12px; }
    .filters-section { position: static; }
    .filters-bar { gap: 20px; }
    .filter-chips { gap: 6px; }
    .chip { padding: 6px 14px; font-size: 0.8rem; }
    .products-grid { grid-template-columns: 1fr; }
    .products-grid.list-view .product-card { flex-direction: column; }
    .products-grid.list-view .product-image { width: 100%; aspect-ratio: 1 / 1; height: auto; }
    .products-grid.list-view .product-highlights { display: flex; }
    .method-grid { grid-template-columns: 1fr; }
    .comparison-table { font-size: 0.85rem; }
    .comparison-table th, .comparison-table td { padding: 12px 14px; }
    .page-cta-inner { padding: 44px 24px; }
}

@media (max-width: 480px) {
    .page-hero-stats { grid-template-columns: 1fr; max-width: 240px; }
    .view-toggle { display: none; }
    .page-cta-actions { flex-direction: column; align-items: center; }
    .page-cta-actions .btn { width: 100%; max-width: 280px; }
}
