/* products.css */

@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/jost-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/jost-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --teal: #00627e;
    --teal-dark: #004f66;
    --accent: #00b1e6;
    --accent-dark: #0089b3;
    --accent-soft: #e5f7fd;
    --ink: #292929;
    --text: #5f6368;
    --muted: #8a8f94;
    --line: #e3e7ea;
    --bg: #f6f6f6;
    --white: #ffffff;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--accent-dark);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--white);
    color: var(--ink);
    padding: 10px 16px;
    z-index: 2000;
}

.skip-link:focus {
    left: 8px;
    top: 8px;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Header */
.site-header {
    background: var(--teal);
    color: var(--white);
    min-height: 84px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 84px;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo-image {
    display: block;
    height: 48px;
    width: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    margin-left: 26px;
}

.site-nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 16px;
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.site-nav a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.6);
}

.site-nav a[aria-current="page"] {
    border-bottom-color: var(--white);
    font-weight: 500;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    padding: 9px 18px;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.header-link:hover {
    background: var(--white);
    color: var(--teal);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-buttons:empty {
    display: none;
}

.account {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    padding-right: 6px;
}

.account .icon {
    width: 30px;
    height: 30px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

.account-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.account-name {
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-role {
    font-size: 13px;
    color: #cfeaf3;
}

.header-link-quiet {
    border-color: transparent;
    text-decoration: underline;
}

@media (max-width: 1100px) {
    .header-content {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .site-nav {
        order: 3;
        flex: 0 0 calc(100% + 48px);
        margin: 0 -24px;
        padding: 0 16px;
        background: var(--teal-dark);
        overflow-x: auto;
    }

    .site-nav a {
        padding: 10px 10px;
        font-size: 15px;
    }

    .header-links {
        margin-left: auto;
        min-height: 68px;
    }
}

@media (max-width: 900px) {
    .signed-in .header-links > .header-link {
        display: none;
    }
}

/* Accessibility options */
.a11y {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
}

.a11y-toggle {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: var(--teal);
    border: 2px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.a11y-toggle:hover,
.a11y-toggle[aria-expanded="true"] {
    background: var(--teal-dark);
}

.a11y-toggle svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

.a11y-panel {
    position: absolute;
    bottom: 64px;
    right: 0;
    z-index: 1200;
    width: 270px;
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    padding: 16px 18px;
}

.a11y-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.a11y-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    cursor: default;
}

label.a11y-row {
    cursor: pointer;
}

.a11y-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--teal);
}

.a11y-size {
    display: inline-flex;
    border: 1px solid #cfd5da;
    border-radius: 2px;
    overflow: hidden;
}

.a11y-size button {
    width: 40px;
    height: 36px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--white);
    border: none;
    border-left: 1px solid #cfd5da;
    cursor: pointer;
}

.a11y-size button:first-child {
    border-left: none;
}

.a11y-size .size-1 {
    font-size: 18px;
}

.a11y-size .size-2 {
    font-size: 22px;
}

.a11y-size button[aria-pressed="true"] {
    background: var(--teal);
    color: var(--white);
}

.a11y-panel .link-btn {
    margin-top: 10px;
}

html.a11y-text-1 {
    zoom: 1.15;
}

html.a11y-text-2 {
    zoom: 1.3;
}

html.a11y-contrast {
    --teal: #003d4f;
    --teal-dark: #002b38;
    --accent: #00688a;
    --accent-dark: #004e68;
    --accent-soft: #ffffff;
    --ink: #000000;
    --text: #1c1c1c;
    --muted: #333333;
    --line: #5c5c5c;
    --bg: #ffffff;
}

html.a11y-contrast .filter-input,
html.a11y-contrast .search-box,
html.a11y-contrast .toggle-group,
html.a11y-contrast .toggle-option,
html.a11y-contrast .view-switch,
html.a11y-contrast .view-btn + .view-btn,
html.a11y-contrast .page-btn,
html.a11y-contrast .btn-outline,
html.a11y-contrast .a11y-size,
html.a11y-contrast .a11y-size button,
html.a11y-contrast .chip,
html.a11y-contrast .feature-badge {
    border-color: #1c1c1c;
}

html.a11y-contrast .feature-badge {
    border: 1px solid #1c1c1c;
}

html.a11y-contrast .site-footer,
html.a11y-contrast .footer-bottom,
html.a11y-contrast .products-table th {
    background: #ffffff;
}

html.a11y-contrast .page-btn:disabled {
    color: #595959;
}

html.a11y-underline .site-nav a {
    text-decoration: none;
}

html.a11y-underline a,
html.a11y-underline .link-btn,
html.a11y-underline .card-more,
html.a11y-underline .products-table td.name button {
    text-decoration: underline;
}

html.a11y-spacing body {
    line-height: 1.8;
    letter-spacing: 0.04em;
    word-spacing: 0.12em;
}

html.a11y-spacing .intro,
html.a11y-spacing .intro-about,
html.a11y-spacing .disclaimer,
html.a11y-spacing .acknowledgements {
    line-height: 2;
}

/* Page title */
.page-head {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 26px 0 30px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 14px;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.breadcrumb .current {
    color: var(--accent-dark);
}

.breadcrumb:empty {
    display: none;
}

.eyebrow {
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 6px;
}

.page-head h1 {
    font-size: 42px;
    line-height: 1.15;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 12px;
}

.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}

.intro {
    font-size: 17px;
    line-height: 1.6;
}

.intro p,
.intro-about p {
    margin-bottom: 10px;
}

.intro p:last-child,
.intro-about p:last-child {
    margin-bottom: 0;
}

.demo-note {
    font-weight: 500;
    color: var(--ink);
}

.intro-about {
    font-size: 15px;
    line-height: 1.55;
    background: var(--bg);
    border-left: 3px solid var(--accent);
    padding: 16px 18px;
}

@media (max-width: 900px) {
    .intro-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
}

/* Layout */
.layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    padding-top: 28px;
    padding-bottom: 60px;
}

/* Filters */
.filters {
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.filters-head h2 {
    font-size: 19px;
    font-weight: 600;
    color: var(--ink);
}

.link-btn {
    background: none;
    border: none;
    font: inherit;
    font-size: 15px;
    color: var(--accent-dark);
    cursor: pointer;
    text-decoration: underline;
}

.filter-block {
    border-bottom: 1px solid var(--line);
}

.filter-block summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
}

.filter-block summary::-webkit-details-marker {
    display: none;
}

.filter-block summary::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.filter-block[open] summary::after {
    transform: rotate(45deg);
}

.filter-body {
    padding: 0 18px 16px;
}

.filter-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 15px;
    color: var(--text);
    margin: 10px 0 5px;
}

.filter-body > .filter-label:first-child {
    margin-top: 0;
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
}

.filter-row .filter-label {
    margin: 0;
}

.filter-input {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid #cfd5da;
    border-radius: 2px;
}

.filter-hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

.range-input {
    width: 100%;
    accent-color: var(--accent-dark);
}

.range-value {
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
}

.toggle-group {
    display: inline-flex;
    border: 1px solid #cfd5da;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.toggle-option {
    font: inherit;
    font-size: 14px;
    padding: 5px 11px;
    background: var(--white);
    color: var(--text);
    border: none;
    border-left: 1px solid #cfd5da;
    cursor: pointer;
}

.toggle-option:first-child {
    border-left: none;
}

.toggle-option.active {
    background: var(--teal);
    color: var(--white);
}

.filters-done {
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    font: inherit;
    font-weight: 500;
    border-radius: 2px;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-outline {
    background: var(--white);
    border: 1px solid #cfd5da;
    color: var(--ink);
}

.count-badge {
    background: var(--teal);
    color: var(--white);
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 10px;
    text-align: center;
    padding: 0 5px;
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 12px 14px;
}

.search-box {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #cfd5da;
    border-radius: 2px;
    color: var(--muted);
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    font: inherit;
    color: var(--ink);
    background: transparent;
}

.sort-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    white-space: nowrap;
}

.sort-box select {
    width: 210px;
    height: 42px;
}

.view-switch {
    display: inline-flex;
    border: 1px solid #cfd5da;
    border-radius: 2px;
    overflow: hidden;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
    background: var(--white);
    color: var(--text);
    border: none;
    cursor: pointer;
}

.view-btn + .view-btn {
    border-left: 1px solid #cfd5da;
}

.view-btn.active {
    background: var(--teal);
    color: var(--white);
}

.filters-toggle {
    display: none;
}

/* Status row */
.status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 18px 0 14px;
    min-height: 32px;
}

.result-count {
    color: var(--ink);
    font-weight: 500;
}

.result-count .range {
    color: var(--text);
    font-weight: 400;
}

.pagination-top {
    margin-left: auto;
}

.pagination-top .page-btn {
    min-width: 36px;
    height: 36px;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-basis: 100%;
}

.active-filters:empty {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-size: 14px;
    background: var(--accent-soft);
    color: var(--teal-dark);
    border: 1px solid #bfe9f7;
    border-radius: 16px;
    padding: 3px 10px;
    cursor: pointer;
}

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

.chip .x {
    font-size: 16px;
    line-height: 1;
}

/* Tiles */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.product-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    font: inherit;
    color: inherit;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 18px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.product-title {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.product-brand {
    font-size: 15px;
    color: var(--text);
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
    min-height: 24px;
}

.feature-badge {
    font-size: 13px;
    color: var(--teal-dark);
    background: var(--accent-soft);
    border-radius: 2px;
    padding: 2px 8px;
}

.product-specs {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 12px;
    font-size: 14.5px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.product-specs dt {
    color: var(--muted);
}

.product-specs dd {
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-more {
    margin-top: 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--accent-dark);
}

/* Table */
.table-wrap {
    background: var(--white);
    border: 1px solid var(--line);
    overflow-x: auto;
}

.products-table {
    width: 100%;
    min-width: 900px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 15px;
}

.clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.products-table th {
    text-align: left;
    font-weight: 500;
    color: var(--ink);
    background: #f1f4f6;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.products-table th button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    font: inherit;
    font-weight: 500;
    color: inherit;
    background: none;
    border: none;
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
}

.products-table th span.plain {
    display: block;
    padding: 12px 14px;
}

.products-table th .arrow {
    color: var(--muted);
    font-size: 12px;
}

.products-table th[aria-sort="ascending"] .arrow,
.products-table th[aria-sort="descending"] .arrow {
    color: var(--accent-dark);
}

.products-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    vertical-align: top;
    overflow: hidden;
}

.products-table tbody tr {
    cursor: pointer;
}

.products-table tbody tr:hover {
    background: var(--accent-soft);
}

.products-table td.name {
    color: var(--ink);
    font-weight: 500;
}

.products-table td.name button {
    width: 100%;
    font: inherit;
    font-weight: 500;
    color: var(--ink);
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

/* Empty and loading states */
.empty-state,
.loading {
    grid-column: 1 / -1;
    text-align: center;
    background: var(--white);
    border: 1px solid var(--line);
    padding: 56px 20px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.empty-state .btn {
    margin-top: 16px;
}

.spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 14px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pager-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 26px;
}

.per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.per-page select {
    width: 78px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    font: inherit;
    color: var(--ink);
    background: var(--white);
    border: 1px solid #cfd5da;
    border-radius: 2px;
    cursor: pointer;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent);
}

.page-btn.current {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
}

.page-btn:disabled {
    color: #b6bcc1;
    cursor: default;
}

.page-gap {
    color: var(--muted);
    padding: 0 4px;
}

/* Footer */
.site-footer {
    background: #eef1f3;
    border-top: 1px solid var(--line);
    color: var(--text);
}

.site-footer > .container:first-child {
    padding-top: 40px;
}

.disclaimer {
    max-width: 1000px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.6;
}

.disclaimer h3,
.acknowledgements h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}

.disclaimer .last-updated {
    margin-top: 10px;
    font-weight: 500;
    color: var(--ink);
}

.acknowledgements {
    background: var(--white);
    border-top: 1px solid var(--line);
    margin-top: 40px;
    padding: 40px 0;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

.acknowledgements h3 {
    margin-bottom: 20px;
}

.acknowledgements p {
    max-width: 1000px;
    margin: 0 auto 10px;
}

.ack-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 30px 50px;
    margin-bottom: 25px;
}

.ack-logo {
    display: block;
    height: 60px;
    width: auto;
    max-width: 100%;
}

.ack-logo-cost {
    height: 100px;
}

.footer-bottom {
    background: #eef1f3;
    border-top: 1px solid var(--line);
    padding: 14px 0;
    font-size: 14px;
    text-align: center;
}

.footer-bottom a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
}

.footer-bottom .icon {
    width: 15px;
    height: 15px;
}

.footer-bottom a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* Back to top */
.to-top {
    position: fixed;
    right: 25px;
    bottom: 86px;
    z-index: 900;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: var(--teal);
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.to-top:hover {
    background: var(--teal-dark);
}

.to-top .icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
}

/* Product details */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 40, 52, 0.55);
    overflow-y: auto;
    padding: 40px 16px;
}

.modal.open {
    display: block;
}

.modal-content {
    max-width: 860px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 3px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: var(--teal);
    color: var(--white);
    padding: 22px 26px;
}

.modal-header h2 {
    font-size: 26px;
    line-height: 1.2;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.modal-header p {
    margin-top: 4px;
    color: #cfeaf3;
}

.close-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    font-size: 26px;
    line-height: 1;
    color: var(--white);
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    cursor: pointer;
}

.close-btn:hover {
    background: var(--white);
    color: var(--teal);
}

.modal-body {
    padding: 22px 26px 28px;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
}

.spec-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
}

.spec-label {
    color: var(--muted);
}

.spec-value {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.source-box {
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    font-size: 15px;
    overflow-wrap: anywhere;
}

.source-box strong {
    display: block;
    color: var(--ink);
    font-weight: 500;
    margin-bottom: 4px;
}

body.modal-open {
    overflow: hidden;
}

/* Smaller screens */
@media (max-width: 1000px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .filters {
        display: none;
    }

    .filters.open {
        display: block;
    }

    .filters-toggle {
        display: inline-flex;
    }

    .filters-done {
        display: flex;
        width: calc(100% - 36px);
        margin: 16px 18px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .site-nav {
        flex-basis: calc(100% + 32px);
        margin: 0 -16px;
        padding: 0 8px;
        gap: 0;
    }

    .site-nav a {
        padding: 10px 8px;
        font-size: 14px;
    }

    .header-content {
        min-height: 68px;
    }

    .logo-image {
        height: 38px;
    }

    .header-link {
        padding: 7px 12px;
        font-size: 14px;
    }

    .account-text {
        display: none;
    }

    .auth-buttons {
        gap: 6px;
    }

    .pagination-top {
        margin-left: 0;
        flex-basis: 100%;
    }

    .page-head h1 {
        font-size: 32px;
    }

    .intro {
        font-size: 16px;
    }

    .sort-box {
        flex: 1 1 100%;
    }

    .sort-box select {
        flex: 1;
        width: auto;
    }

    .view-switch {
        margin-left: auto;
    }

    .products-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pager-row {
        justify-content: center;
    }

    .spec-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .spec-item {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .modal {
        padding: 12px 8px;
    }

    .modal-header,
    .modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 440px) {
    .logo-image {
        height: 32px;
    }

    .header-content {
        gap: 10px;
    }

    .header-link {
        padding: 6px 9px;
        font-size: 13px;
    }

    .a11y {
        right: 14px;
        bottom: 14px;
    }

    .to-top {
        right: 17px;
        bottom: 78px;
    }

    .a11y-panel {
        width: min(270px, calc(100vw - 28px));
    }
}
