:root {
    --paper: #f7f2e7;
    --paper-deep: #e9e1d2;
    --ink: #102f46;
    --ink-soft: #4d6473;
    --accent: #e95f3d;
    --accent-dark: #b8371c;
    --lime: #c8dd69;
    --line: #c8c0b2;
    --white: #fffdf7;
    --focus: #0068a4;
    --shadow: 0 18px 50px rgb(16 47 70 / 10%);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--paper);
    color: var(--ink);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 88% 3%, rgb(200 221 105 / 35%) 0 10rem, transparent 10.1rem),
        linear-gradient(115deg, transparent 0 74%, rgb(233 95 61 / 6%) 74% 75%, transparent 75%),
        var(--paper);
}

img,
input,
select,
button {
    max-width: 100%;
}

a {
    color: inherit;
    text-underline-offset: .2em;
}

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

button,
input,
select {
    font: inherit;
}

button,
.button-link {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ink);
    border-radius: 0;
    padding: .72rem 1.2rem;
    background: var(--ink);
    color: var(--white);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover,
.button-link:hover {
    transform: translate(-2px, -2px);
    background: var(--accent);
    box-shadow: 4px 4px 0 var(--ink);
    color: var(--white);
}

:focus-visible {
    outline: 4px solid var(--focus);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: .5rem;
    left: .5rem;
    padding: .8rem 1rem;
    background: var(--white);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header,
.site-footer,
main {
    width: min(100% - 2rem, 90rem);
    margin-inline: auto;
}

.site-header {
    display: flex;
    min-height: 5.5rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.site-header nav a {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.locale-switcher {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-inline-start: auto;
}

.locale-switcher label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.locale-switcher select,
.locale-switcher button {
    min-height: 2.5rem;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}

.locale-switcher button {
    padding-inline: .75rem;
    cursor: pointer;
}

[aria-current="page"] {
    text-decoration-thickness: .18em;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 700;
    text-decoration: none;
}

.wordmark-dot {
    width: 1rem;
    height: 1rem;
    background: var(--accent);
    border-radius: 50% 50% 0 50%;
    transform: rotate(-20deg);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.04;
}

h1 {
    max-width: 17ch;
    margin-bottom: 1.3rem;
    font-size: clamp(2.6rem, 7vw, 6.8rem);
    font-weight: 500;
    letter-spacing: -.045em;
}

h2 {
    font-size: clamp(1.6rem, 3.2vw, 3rem);
    font-weight: 500;
    letter-spacing: -.025em;
}

.eyebrow {
    margin-bottom: .7rem;
    color: var(--accent-dark);
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero {
    display: grid;
    min-height: calc(100vh - 7.5rem);
    align-items: center;
    gap: 2rem;
    grid-template-columns: minmax(0, 4fr) minmax(14rem, 1fr);
    padding: 4rem 0 5rem;
}

.hero-copy {
    animation: rise 500ms ease both;
}

.hero-description {
    max-width: 47rem;
    color: var(--ink-soft);
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1.6;
}

.aggregator-disclosure {
    max-width: 45rem;
    margin-top: 1.2rem;
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
    color: var(--ink-soft);
    line-height: 1.5;
}

.hero-note {
    position: relative;
    min-height: 20rem;
    padding: 2rem;
    overflow: hidden;
    background: var(--ink);
    color: var(--white);
    animation: rise 500ms 100ms ease both;
}

.hero-note::after {
    position: absolute;
    width: 15rem;
    height: 15rem;
    right: -6rem;
    bottom: -7rem;
    border: 2rem solid var(--lime);
    border-radius: 50%;
    content: "";
}

.hero-number {
    color: var(--lime);
    font-size: .8rem;
    font-weight: 900;
    letter-spacing: .16em;
}

.hero-note p {
    max-width: 8ch;
    margin-top: 5rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    line-height: 1.1;
}

.hero-arrow {
    position: absolute;
    right: 1.5rem;
    top: 1.2rem;
    font-size: 2rem;
}

.search-form {
    max-width: 56rem;
    margin-top: 2rem;
}

.search-form > label {
    display: inline-block;
    margin-bottom: .55rem;
    font-weight: 800;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    box-shadow: 8px 8px 0 var(--paper-deep);
}

.search-reset {
    display: inline-flex;
    min-height: 4rem;
    align-items: center;
    padding: .75rem 1rem;
    border-block: 2px solid var(--ink);
    background: var(--white);
    font-size: .8rem;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 3rem;
    border: 2px solid var(--ink);
    padding: .65rem .8rem;
    background: var(--white);
    color: var(--ink);
}

.search-row input {
    min-height: 4rem;
    border-right: 0;
    font-size: 1.05rem;
}

.search-row button {
    min-width: 8rem;
}

.catalog-preview,
.marketplace-overview,
.inline-state {
    padding: 5rem 0;
    border-top: 1px solid var(--line);
}

.marketplace-overview ul {
    display: grid;
    margin: 0;
    padding: 0;
    border-block: 2px solid var(--ink);
    list-style: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marketplace-overview li {
    display: flex;
    min-width: 0;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.marketplace-overview li span {
    font-weight: 900;
}

.marketplace-overview li small {
    color: var(--ink-soft);
    white-space: nowrap;
}

.section-heading,
.results-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.section-heading h2,
.results-heading h2 {
    margin-bottom: 0;
}

.text-link,
.clear-link {
    color: var(--accent-dark);
    font-weight: 900;
}

.product-grid {
    display: grid;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-card {
    min-width: 0;
    background: var(--white);
    animation: rise 420ms ease both;
}

.product-card:nth-child(2n) {
    animation-delay: 60ms;
}

.product-card:nth-child(3n) {
    animation-delay: 120ms;
}

.product-image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--paper-deep);
}

.product-image-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 250ms ease;
}

.product-image-link:hover img {
    transform: scale(1.025);
}

.product-card-body {
    display: flex;
    min-height: 19rem;
    flex-direction: column;
    padding: 1.3rem;
}

.product-card h3 {
    margin-bottom: .55rem;
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    font-size: 1.15rem;
    line-height: 1.25;
}

.product-card h3 a {
    text-decoration: none;
    overflow-wrap: anywhere;
}

.product-category,
.product-brand {
    color: var(--ink-soft);
    font-size: .78rem;
}

.product-category {
    margin-bottom: .55rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.card-prices {
    margin-top: auto;
    padding-top: 1.2rem;
}

.price {
    margin-bottom: .25rem;
}

.price span {
    color: var(--ink-soft);
    font-size: .8rem;
}

.price strong {
    font-size: 1.25rem;
}

.price-missing {
    color: var(--ink-soft);
    font-size: .9rem;
    line-height: 1.4;
}

.card-meta {
    display: grid;
    gap: .7rem;
    margin-top: 1rem;
    padding-top: .9rem;
    border-top: 1px solid var(--paper-deep);
    font-size: .75rem;
}

.card-observed {
    display: block;
    margin-top: .7rem;
    color: var(--ink-soft);
    font-size: .7rem;
    line-height: 1.4;
}

.freshness {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: .45rem;
    border: 1px solid currentcolor;
    padding: .26rem .5rem;
    font-size: .72rem;
    font-weight: 900;
}

.freshness::before {
    width: .45rem;
    height: .45rem;
    background: currentcolor;
    border-radius: 50%;
    content: "";
}

.freshness.fresh { color: #22603f; }
.freshness.aging { color: #7a5700; }
.freshness.stale,
.freshness.missing { color: #9c3d27; }
.freshness.expired { color: #6f3444; }
.freshness.unknown { color: var(--ink-soft); }

.catalog-header {
    padding: 4rem 0 3rem;
}

.catalog-header h1 {
    margin-bottom: 2rem;
}

.applied-filters {
    padding: 1rem 0 2rem;
}

.applied-filters h2 {
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    font-size: .85rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}

.filter-chip {
    border: 1px solid var(--ink);
    padding: .5rem .7rem;
    background: var(--white);
    font-size: .82rem;
    text-decoration: none;
}

.filter-chip span {
    margin-left: .4rem;
    color: var(--accent-dark);
    font-size: 1.1rem;
}

.catalog-layout {
    display: grid;
    align-items: start;
    gap: 2rem;
    grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
    padding-bottom: 6rem;
}

.filter-panel {
    position: sticky;
    top: 1rem;
    border: 2px solid var(--ink);
    padding: 1.3rem;
    background: var(--paper);
    box-shadow: 7px 7px 0 var(--paper-deep);
}

.filter-panel h2 {
    font-size: 1.7rem;
}

.field,
fieldset {
    margin: 0 0 1.2rem;
}

.field label,
legend {
    display: block;
    margin-bottom: .4rem;
    font-size: .82rem;
    font-weight: 900;
}

fieldset {
    border: 0;
    padding: 0;
}

.check-row {
    display: grid;
    min-height: 2.75rem;
    align-items: center;
    gap: .55rem;
    grid-template-columns: auto 1fr auto;
    font-size: .87rem;
    cursor: pointer;
}

.check-row input {
    width: 1.2rem;
    min-height: 1.2rem;
    accent-color: var(--accent);
}

.check-row small {
    color: var(--ink-soft);
}

.check-row.prominent {
    margin-bottom: 1.2rem;
    padding: .6rem;
    background: var(--paper-deep);
}

.price-fields {
    display: grid;
    gap: .6rem;
    grid-template-columns: 1fr 1fr;
}

.wide-button {
    width: 100%;
}

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

.pagination {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.empty-state,
.inline-state {
    padding: 3rem;
    background: var(--paper-deep);
}

.empty-state h2,
.inline-state h2 {
    max-width: 20ch;
}

.criteria-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 1rem 0 1.5rem;
    padding: 0;
    list-style: none;
}

.criteria-summary li {
    padding: .35rem .55rem;
    border: 1px solid var(--line);
    background: var(--white);
    font-size: .8rem;
    overflow-wrap: anywhere;
}

.product-detail {
    padding-bottom: 6rem;
}

.breadcrumbs {
    display: flex;
    gap: .5rem;
    padding: 2rem 0;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: .8rem;
    white-space: nowrap;
}

.breadcrumbs span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-hero {
    display: grid;
    align-items: start;
    gap: 4rem;
    grid-template-columns: minmax(0, 1.25fr) minmax(19rem, .75fr);
}

.gallery {
    display: grid;
    gap: 1px;
    background: var(--line);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery img {
    width: 100%;
    height: 100%;
    min-height: 9rem;
    aspect-ratio: 4 / 3;
    background: var(--white);
    object-fit: contain;
}

.gallery .primary-image {
    min-height: auto;
    grid-column: 1 / -1;
}

.detail-summary {
    position: sticky;
    top: 2rem;
    padding-top: 1rem;
}

.detail-summary h1 {
    font-size: clamp(2.2rem, 5vw, 4.6rem);
}

.detail-brand {
    color: var(--ink-soft);
    font-weight: 900;
}

.detail-source-count,
.detail-observed {
    margin: .7rem 0 0;
    color: var(--ink-soft);
    font-size: .8rem;
}

.detail-prices {
    margin: 2rem 0;
    padding: 1.3rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.detail-price {
    margin-bottom: .4rem;
}

.detail-price span {
    color: var(--ink-soft);
}

.detail-price strong {
    margin-left: .5rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
}

.detail-description {
    color: var(--ink-soft);
    line-height: 1.65;
}

.attributes-section,
.offers-section {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 2px solid var(--ink);
}

.attributes-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.attributes-list div {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(8rem, 1fr) 1.4fr;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
}

.attributes-list dt {
    color: var(--ink-soft);
}

.attributes-list dd {
    margin: 0;
    font-weight: 800;
}

.offer-list {
    border-top: 1px solid var(--line);
}

.no-active-offers {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-left: 4px solid var(--accent);
}

.no-active-offers h3 {
    margin-bottom: .5rem;
    font-size: 1.35rem;
}

.offer-row {
    display: grid;
    align-items: center;
    gap: 1.5rem;
    grid-template-columns: 1.1fr 1.4fr 1fr 1.2fr;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--line);
}

.offer-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

.offer-row.excluded-offer {
    background: repeating-linear-gradient(-45deg, transparent, transparent 8px, rgb(111 52 68 / 5%) 8px, rgb(111 52 68 / 5%) 16px);
}

.offer-store h3 {
    margin-bottom: .25rem;
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    font-size: 1.1rem;
}

.offer-store p,
.offer-status small,
.offer-action small {
    display: block;
    margin: .4rem 0 0;
    color: var(--ink-soft);
    font-size: .75rem;
}

.offer-status {
    display: grid;
    gap: .5rem;
}

.offer-price {
    display: grid;
    gap: .2rem;
}

.offer-price del {
    color: var(--ink-soft);
    font-size: .8rem;
}

.offer-price strong {
    font-size: 1.2rem;
}

.offer-action {
    text-align: right;
}

.offer-action .button-link {
    width: 100%;
}

.action-disabled {
    display: block;
    padding: .8rem;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    text-align: center;
}

.error-page {
    display: flex;
    min-height: 68vh;
    max-width: 48rem;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: clamp(2.6rem, 7vw, 5.5rem);
}

.error-code {
    color: var(--accent-dark);
    font-size: .85rem;
    font-weight: 900;
    letter-spacing: .2em;
}

.retry-after {
    font-weight: 900;
}

.error-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.site-footer {
    display: flex;
    min-height: 8rem;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: .82rem;
}

.site-footer p {
    margin: 0;
}

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

@media (max-width: 70rem) {
    .product-grid,
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-hero {
        gap: 2rem;
    }

    .offer-row {
        grid-template-columns: 1fr 1fr;
    }

    .marketplace-overview ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 48rem) {
    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 3rem 0;
    }

    .hero-note {
        min-height: 13rem;
    }

    .hero-note p {
        margin-top: 2rem;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .filter-panel,
    .detail-summary {
        position: static;
    }

    .detail-hero {
        grid-template-columns: 1fr;
    }

    .attributes-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 35rem) {
    .site-header,
    .site-footer,
    main {
        width: min(100% - 1.2rem, 90rem);
    }

    .site-header {
        min-height: 4.5rem;
    }

    h1 {
        font-size: 2.65rem;
    }

    .search-row {
        grid-template-columns: 1fr;
        box-shadow: 5px 5px 0 var(--paper-deep);
    }

    .search-row input {
        border-right: 2px solid var(--ink);
        border-bottom: 0;
    }

    .search-reset {
        justify-content: center;
        border: 2px solid var(--ink);
    }

    .product-grid,
    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .marketplace-overview ul {
        grid-template-columns: 1fr;
    }

    .marketplace-overview li {
        padding-inline: .8rem;
    }

    .section-heading,
    .results-heading,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-panel {
        padding: 1rem;
        box-shadow: 4px 4px 0 var(--paper-deep);
    }

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

    .offer-row {
        gap: 1rem;
        grid-template-columns: 1fr;
    }

    .offer-action {
        text-align: left;
    }

    .attributes-list div {
        gap: .4rem;
        grid-template-columns: 1fr;
    }

    .empty-state,
    .inline-state {
        padding: 1.5rem;
    }

    .error-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 24rem) {
    .site-header {
        align-items: stretch;
        flex-direction: column;
        gap: .25rem;
        padding-block: .65rem;
    }

    .site-header nav a,
    .wordmark {
        width: 100%;
    }

    h1,
    h2,
    h3,
    p,
    a,
    dt,
    dd {
        overflow-wrap: anywhere;
    }

    .price-fields,
    .gallery {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-copy,
    .hero-note,
    .product-card { animation: none; }
    button,
    .button-link,
    .product-image-link img { transition: none; }
}
