.product-catalog {
    width: 100%;
}

.product-catalog__header,
.product-catalog__toolbar,
.product-toolbar__group,
.product-segmented-control,
.product-catalog__count {
    display: flex;
    align-items: center;
}

.product-catalog__header {
    justify-content: space-between;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.product-catalog__intro {
    min-width: 0;
}

.product-catalog__eyebrow {
    margin-bottom: var(--space-2);
    color: var(--color-primary-700);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: .14em;
}

.product-catalog h1 {
    max-width: 48rem;
    margin-bottom: var(--space-4);
    font-size: clamp(2.25rem, 5vw, 4rem);
    letter-spacing: -.045em;
}

.product-catalog__description {
    max-width: 46rem;
    margin-bottom: 0;
    color: var(--color-text-muted);
    font-size: var(--text-lg);
}

.product-catalog__count {
    flex: 0 0 auto;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.product-catalog__count strong {
    color: var(--color-navy-900);
    font-size: var(--text-lg);
}

.product-catalog__toolbar {
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-8);
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.product-toolbar__group {
    flex-wrap: wrap;
    gap: var(--space-3);
}

.product-toolbar__label {
    color: var(--color-navy-800);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}

.product-segmented-control {
    flex-wrap: wrap;
    gap: .2rem;
    padding: .2rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-muted);
}

.product-segmented-control__option {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--color-navy-800);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    white-space: nowrap;
}

.product-segmented-control__option:hover,
.product-segmented-control__option:focus-visible {
    border-color: var(--color-primary-600);
    color: var(--color-primary-700);
}

.product-segmented-control__option.is-active,
.product-segmented-control__option[aria-pressed="true"] {
    border-color: var(--color-primary-600);
    background: var(--color-primary-600);
    color: var(--color-surface);
}

.product-segmented-control__option.is-active:hover,
.product-segmented-control__option.is-active:focus-visible,
.product-segmented-control__option[aria-pressed="true"]:hover,
.product-segmented-control__option[aria-pressed="true"]:focus-visible {
    background: var(--color-primary-700);
    color: var(--color-surface);
}

.product-catalog__period-note {
    flex: 1 1 100%;
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

@media (min-width: 768px) {
    .product-catalog__toolbar > .product-toolbar__group--view {
        margin-left: auto;
    }
}

.product-list-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.product-list-table {
    width: 100%;
    min-width: 70rem;
    border-collapse: collapse;
}

.product-list-table th,
.product-list-table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

.product-list-table th {
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.product-list-table tbody tr {
    transition: background-color var(--transition-fast);
}

.product-list-table tbody tr:hover {
    background: rgba(219, 234, 254, .35);
}

.product-list-table tbody tr:last-child td {
    border-bottom: 0;
}

.product-sort-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: inherit;
    text-decoration: none;
}

.product-sort-link:hover,
.product-sort-link:focus-visible {
    color: var(--color-primary-700);
}

.product-sort-link span::before {
    color: var(--color-text-muted);
    content: "↕";
    font-size: var(--text-base);
}

.product-list-table th[aria-sort="ascending"] .product-sort-link span::before {
    color: var(--color-primary-700);
    content: "↑";
}

.product-list-table th[aria-sort="descending"] .product-sort-link span::before {
    color: var(--color-primary-700);
    content: "↓";
}

.product-identity {
    display: flex;
    min-width: 18rem;
    align-items: center;
    gap: var(--space-3);
}

.product-identity__logo-link,
.ea-card-logo-link {
    display: block;
    flex: 0 0 auto;
}

.product-identity__copy {
    min-width: 0;
}

.product-name {
    color: var(--color-navy-900);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
}

.product-name:hover,
.product-name:focus-visible {
    color: var(--color-primary-700);
}

.product-summary,
.ea-card-description {
    display: -webkit-box;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: var(--line-normal);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-summary {
    margin: var(--space-1) 0 0;
}

.ea-logo,
.ea-logo-placeholder {
    display: inline-flex;
    width: 4rem;
    height: 4rem;
    flex: 0 0 4rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.ea-logo-placeholder {
    background: #dbeafe;
    color: var(--color-primary-700);
    font-weight: 800;
}

.ea-sparkline {
    display: block;
    width: 10rem;
    height: 2.75rem;
}

.ea-sparkline polyline {
    fill: none;
    stroke: var(--color-primary-600);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
}

.ea-sparkline.negative polyline {
    stroke: var(--color-danger-600);
}

.metric-value {
    color: var(--color-navy-900);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
}

.metric-value.positive {
    color: var(--color-success-600);
}

.metric-value.negative {
    color: var(--color-danger-600);
}

.metric-value--drawdown {
    color: var(--color-warning-500);
}

.product-price {
    color: var(--color-navy-900);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
}

.no-performance-data {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.product-cta-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.product-cta-group form {
    display: flex;
    margin: 0;
}

.product-action,
.product-cta-group [data-free-ea-cta] {
    min-height: 2.5rem;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}

.product-cta-group [data-free-ea-cta] {
    border-color: var(--color-primary-600);
    background: var(--color-surface);
    color: var(--color-primary-700);
}

.product-cta-group [data-free-ea-cta]:hover,
.product-cta-group [data-free-ea-cta]:focus-visible {
    background: #dbeafe;
    color: var(--color-primary-700);
}

.product-empty-state {
    padding: var(--space-10);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.product-empty-state h2 {
    margin-bottom: var(--space-3);
}

.product-empty-state p {
    margin-bottom: var(--space-5);
    color: var(--color-text-muted);
}

.ea-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
}

.ea-card {
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.ea-card:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.ea-card-logo {
    width: 4.5rem;
    height: 4.5rem;
    flex-basis: 4.5rem;
}

.ea-card h2 {
    margin: var(--space-4) 0 var(--space-2);
    font-size: var(--text-xl);
}

.ea-card h2 a {
    color: var(--color-navy-900);
    text-decoration: none;
}

.ea-card h2 a:hover,
.ea-card h2 a:focus-visible {
    color: var(--color-primary-700);
}

.ea-card-description {
    min-height: 3rem;
    margin-bottom: var(--space-4);
}

.ea-card-sparkline {
    width: 100%;
    height: 4rem;
    margin-bottom: var(--space-4);
}

.ea-card-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin: 0 0 var(--space-5);
}

.ea-card-metrics div:last-child {
    grid-column: 1 / -1;
}

.ea-card-metrics dt {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ea-card-metrics dd {
    margin: var(--space-1) 0 0;
}

.ea-card .product-cta-group {
    margin-top: auto;
}

@media (max-width: 1000px) {
    .ea-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .product-catalog__header {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-5);
        margin-bottom: var(--space-6);
    }

    .product-catalog__count {
        align-self: flex-start;
    }

    .product-catalog__toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: var(--space-4);
    }

    .product-toolbar__group {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-segmented-control {
        width: 100%;
    }

    .product-segmented-control__option {
        flex: 1 1 0;
    }

    .product-list-table-wrapper {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .product-list-table {
        display: block;
        min-width: 0;
    }

    .product-list-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .product-list-table tbody {
        display: block;
    }

    .product-list-table tr {
        display: block;
        margin-bottom: var(--space-4);
        padding: var(--space-4);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        background: var(--color-surface);
        box-shadow: var(--shadow-sm);
    }

    .product-list-table td {
        display: grid;
        grid-template-columns: minmax(7rem, 34%) minmax(0, 1fr);
        gap: var(--space-3);
        width: 100%;
        padding: var(--space-3) 0;
        border-bottom: 1px solid var(--color-border);
    }

    .product-list-table td::before {
        color: var(--color-text-muted);
        content: attr(data-label);
        font-size: var(--text-xs);
        font-weight: var(--font-weight-semibold);
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .product-list-table td:first-child {
        display: block;
        padding-top: 0;
    }

    .product-list-table td:first-child::before {
        display: none;
    }

    .product-list-table td:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .product-identity {
        min-width: 0;
    }

    .product-summary {
        max-width: 100%;
    }

    .ea-sparkline {
        width: 100%;
        max-width: 16rem;
    }

    .product-cta-group {
        align-items: stretch;
        flex-direction: column;
    }

    .product-cta-group form,
    .product-cta-group .product-action,
    .product-cta-group [data-free-ea-cta] {
        width: 100%;
    }

    .product-cta-group .product-action,
    .product-cta-group [data-free-ea-cta] {
        justify-content: center;
    }

    .ea-grid {
        grid-template-columns: 1fr;
    }
}
