:root {
    --ink: #17212b;
    --muted: #637083;
    --line: #dbe3ea;
    --paper: #ffffff;
    --page: #f4f7f9;
    --red: #c82032;
    --teal: #007c7a;
    --teal-dark: #005f5e;
    --shadow: 0 12px 28px rgba(23, 33, 43, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: Inter, Arial, sans-serif;
}

img {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
}

.site-header {
    align-items: center;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 16px clamp(18px, 5vw, 72px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    align-items: center;
    color: var(--ink);
    display: flex;
    font-weight: 800;
    gap: 10px;
    text-decoration: none;
}

.brand-logo {
    height: 40px;
    object-fit: contain;
    width: auto;
}

.back-link {
    color: var(--teal);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.search-hero,
.results-header,
.catalog-section {
    padding: clamp(28px, 6vw, 96px) clamp(18px, 5vw, 72px);
}

.search-hero {
    background: linear-gradient(135deg, #ffffff 0%, #edf7f6 100%);
    border-bottom: 1px solid var(--line);
}

.hero-content,
.results-header {
    max-width: 980px;
}

.eyebrow {
    color: var(--red);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 10px;
    text-transform: uppercase;
}

h1,
h2 {
    letter-spacing: 0;
    line-height: 1.12;
    margin: 0;
}

h1 {
    font-size: clamp(34px, 7vw, 76px);
    max-width: 920px;
}

.section-heading {
    margin-bottom: 28px;
}

.section-heading h2,
.empty-state h2 {
    font-size: clamp(28px, 4vw, 52px);
}

.search-form {
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: flex;
    gap: 10px;
    margin-top: 32px;
    max-width: 860px;
    padding: 10px;
}

.search-form.compact {
    margin-top: 24px;
}

.search-form input {
    border: 0;
    color: var(--ink);
    flex: 1;
    min-width: 0;
    outline: 0;
    padding: 16px;
}

.search-form button,
.primary-button {
    background: var(--teal);
    border: 0;
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
    padding: 16px 26px;
    text-align: center;
    text-decoration: none;
}

.search-form button:hover,
.primary-button:hover {
    background: var(--teal-dark);
}

.category-grid,
.product-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.category-card {
    margin: 0;
}

.category-card button,
.product-card,
.empty-state,
.preview-dialog {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.category-card button {
    color: var(--ink);
    cursor: pointer;
    padding: 0;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease;
    width: 100%;
}

.category-card button:hover,
.product-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.category-card img,
.product-image-button img {
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    width: 100%;
}

.category-card span {
    display: block;
    font-size: 20px;
    font-weight: 800;
    padding: 18px;
}

.results-header {
    padding-bottom: 36px;
}

.results-header h1 {
    font-size: clamp(30px, 5vw, 64px);
}

.results-section {
    padding-top: 0;
}

.product-card {
    display: flex;
    flex-direction: column;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-image-button {
    background: #ffffff;
    border: 0;
    cursor: zoom-in;
    padding: 0;
}

.product-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
}

.product-code {
    color: var(--teal);
    font-size: 13px;
    font-weight: 800;
    margin: 0;
    overflow-wrap: anywhere;
}

.product-info h2 {
    font-size: 18px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.product-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    margin-top: auto;
}

.secondary-button {
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
    padding: 14px;
    text-align: center;
    text-decoration: none;
}

.empty-state {
    max-width: 720px;
    padding: clamp(24px, 5vw, 64px);
}

.empty-state p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.preview-modal[hidden] {
    display: none;
}

.preview-modal {
    inset: 0;
    position: fixed;
    z-index: 100;
}

.preview-backdrop {
    background: rgba(23, 33, 43, 0.74);
    inset: 0;
    position: absolute;
}

.preview-dialog {
    left: 50%;
    max-height: calc(100vh - 40px);
    max-width: min(960px, calc(100vw - 36px));
    overflow: auto;
    padding: 16px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.preview-dialog img {
    background: #ffffff;
    max-height: 72vh;
    object-fit: contain;
    width: 100%;
}

.preview-dialog h2 {
    font-size: 20px;
    line-height: 1.35;
    margin-top: 14px;
}

.preview-close {
    background: var(--ink);
    border: 0;
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
    margin-bottom: 12px;
    padding: 12px 16px;
}

.sr-only {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

@media (max-width: 640px) {
    .search-form {
        display: grid;
    }

    .search-form button,
    .primary-button {
        width: 100%;
    }

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