:root {
    --color-primary: #f3c63f;
    --color-primary-dark: #735800;
    --color-action-blue: #0073b9;
    --color-action-blue-dark: #005b92;
    --color-heading: #102a43;
    --color-text: #243b53;
    --color-muted: #52606d;
    --color-border: #d9e2ec;
    --color-background: #f3f6f8;
    --color-surface: #ffffff;
    --color-surface-blue: #fff9e7;
    --color-danger: #9b1c1c;
    --color-danger-background: #fce8e6;
    --shadow-main: 0 8px 30px rgb(16 42 67 / 10%);
    --shadow-card: 0 3px 12px rgb(16 42 67 / 7%);
    --radius-small: 5px;
    --radius-medium: 10px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    line-height: 1.55;
}

button,
input {
    font: inherit;
}

main {
    position: relative;
    width: min(1120px, calc(100% - 32px));
    margin: 40px auto;
    padding: 52px;
    overflow: hidden;
    background: var(--color-surface);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-main);
}

main::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 7px;
    background: #f3c63f;
    content: "";
}

h1,
h2,
h3 {
    color: var(--color-heading);
    line-height: 1.2;
}

h1 {
    max-width: 800px;
    margin: 0 0 60px;
    font-size: clamp(2rem, 4vw, 2.8rem);
    letter-spacing: -0.025em;
}

main > p {
    max-width: 760px;
    margin: 0;
    color: var(--color-muted);
    font-size: 1.05rem;
}

label {
    display: block;
    margin-top: 38px;
    margin-bottom: 9px;
    color: var(--color-heading);
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    border: 1px solid #9fb3c8;
    border-radius: var(--radius-small);
    background: var(--color-surface);
    color: var(--color-text);
}

input::placeholder {
    color: #7b8794;
}

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

input:focus {
    border-color: var(--color-primary);
    outline: 3px solid rgb(0 115 185 / 18%);
}

#clear-search {
    display: block;
    min-height: 42px;
    margin-top: 10px;
    margin-left: auto;
    padding: 8px 18px;
    border: 1px solid #9fb3c8;
    border-radius: var(--radius-small);
    background: var(--color-surface);
    color: var(--color-heading);
    font-weight: 700;
    cursor: pointer;
}

#clear-search:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-blue);
    color: var(--color-primary-dark);
}

#clear-search:focus-visible,
.article-button:focus-visible,
.back-button:focus-visible,
.print-button:focus-visible,
.product-link:focus-visible {
    outline: 3px solid rgb(0 115 185 / 25%);
    outline-offset: 3px;
}

#clear-search[hidden] {
    display: none;
}

#results {
    margin-top: 34px;
}

.search-results,
.relation-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.article-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    width: 100%;
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-small);
    background: var(--color-surface);
    color: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.article-button:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 18px rgb(16 42 67 / 12%);
    transform: translateY(-2px);
}

.article-button strong {
    color: var(--color-heading);
    font-size: 1.05rem;
    line-height: 1.35;
}

.article-button span {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--color-text);
    font-size: 0.9rem;
}

.article-button small {
    color: var(--color-muted);
}

.article-button .long-swedish-name,
.article-header .long-swedish-name {
    color: var(--color-muted);
    line-height: 1.45;
}

.article-number {
    font-weight: 600;
}

.status {
    display: inline-block;
    width: fit-content;
    margin-top: 3px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-discontinued {
    background: var(--color-danger-background);
    color: var(--color-danger);
}

.back-button {
    margin: 0 0 28px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--color-primary-dark);
    font-weight: 700;
    cursor: pointer;
}

.back-button:hover {
   color: #4f3d00;
    text-decoration: underline;
}

.print-button {
    display: block;
    min-height: 44px;
    margin: -66px 0 26px auto;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--radius-small);
    background: var(--color-action-blue);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.print-button:hover {
    background: var(--color-action-blue-dark);
}

.article-header {
    margin-bottom: 36px;
    padding: 30px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background: #fbfdff;
}

.article-header h2 {
    margin: 0 0 12px;
    font-size: clamp(1.65rem, 3vw, 2.1rem);
}

.article-header p {
    margin: 7px 0;
}

.article-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 13px;
}

.product-link {
    display: inline-flex;
    align-items: center;
   color: var(--color-primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.product-link:hover {
    color: #4f3d00;
    text-decoration: underline;
}

.article-image {
    display: block;
    width: 180px;
    max-width: 100%;
    height: 140px;
    margin: 0 auto 12px;
    object-fit: contain;
}

.article-image[hidden] {
    display: block;
    visibility: hidden;
}

.selected-article-image {
    width: min(360px, 100%);
    height: 240px;
    margin: 20px auto 26px;
}

.relation-section {
    margin-top: 42px;
}

.relation-section h2 {
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
    font-size: 1.35rem;
}

.relation-section > p {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-small);
    color: var(--color-muted);
    background: #fbfdff;
}

.relation-item {
    height: 100%;
}

@media (max-width: 760px) {
    main {
        width: min(100% - 20px, 1120px);
        margin: 10px auto;
        padding: 38px 22px;
    }

    h1 {
        font-size: 1.85rem;
    }

    .search-results,
    .relation-list {
        grid-template-columns: 1fr;
    }

    .print-button {
        margin: 0 0 22px;
    }

    .article-header {
        padding: 22px;
    }

    .selected-article-image {
        height: 200px;
    }
}
.site-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 36px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--color-border);
}

.site-header a {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
}

.site-logo {
    display: block;
    width: min(210px, 100%);
    height: auto;
}

/* Tre typografiska nivÃ¥er pÃ¥ skÃ¤rmen */
@media screen {
    body,
    input,
    button,
    main > p,
    label,
    #results,
    .article-button span,
    .article-button small,
    .article-header p,
    .product-link,
    .back-button,
    .status {
        font-size: 16px;
        font-weight: 400;
    }

    h1 {
    max-width: none;
    margin-right: auto;
    margin-left: auto;
    font-size: 40px;
    font-weight: 700;
    text-align: center;
}
main > p {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}
    h2,
    .article-header h2,
    .relation-section h2 {
        font-size: 22px;
        font-weight: 700;
    }

    .article-button strong {
        font-size: 16px;
        font-weight: 600;
    }

    .article-number {
        font-weight: 400;
    }

    #clear-search,
    .print-button {
        font-size: 16px;
        font-weight: 700;
    }

    .product-link,
    .back-button {
        font-weight: 400;
    }
}
.quick-searches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 22px;
}

.quick-searches > span {
    color: var(--color-muted);
    font-size: 16px;
}

#quick-search-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-search-button {
    min-height: 40px;
    padding: 7px 15px;
    border: 2px solid #52606d;
    border-radius: 999px;
    background: #ffffff;
    color: var(--color-heading);
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
}

.quick-search-button:hover {
    background: var(--color-primary);
}

.quick-search-button:focus-visible {
    outline: 3px solid rgb(243 198 63 / 35%);
    outline-offset: 3px;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media screen {
    h1 {
        max-width: none;
        margin: 0 0 20px;
        font-size: 44px;
        font-weight: 500;
        letter-spacing: -0.035em;
        text-align: center;
    }

    .intro {
        max-width: none;
        margin: 0 0 34px;
        text-align: left;
    }

    .article-count {
        max-width: none;
        margin: 18px 0 0;
        text-align: left;
    }
}

.quick-searches {
    display: block;
    margin-top: 22px;
    overflow-x: auto;
}

#quick-search-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    width: max-content;
}
.site-header {
    display: block;
    margin-bottom: 36px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--color-border);
    text-align: right;
}

.site-header a {
    display: inline-block;
    width: 210px;
    max-width: 100%;
    margin: 0;
}

.site-logo {
    display: block;
    width: 100%;
    height: auto;
}
.search-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 20px;
    margin-top: 32px;
}

.quick-searches {
    min-width: 0;
    margin: 0;
}

#quick-search-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

#clear-search {
    flex: 0 0 auto;
    margin: 0;
}

.article-count {
    margin-top: 18px;
}
.quick-search-filter {
    display: grid;
    gap: 5px;
    min-width: 210px;
    color: var(--color-muted);
    font-size: 14px;
    margin: 0;
font-weight: 400;
}

.quick-search-filter select {
    min-height: 44px;
    padding: 8px 38px 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    background: var(--color-surface);
    color: var(--color-heading);
    font: inherit;
    cursor: pointer;
}

.quick-search-filter select:focus-visible {
    outline: 3px solid rgb(243 198 63 / 35%);
    outline-offset: 2px;
}

@media (max-width: 760px) {
    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #quick-search-buttons {
        flex-wrap: wrap;
        width: 100%;
    }

    .quick-search-filter {
        flex: 1 1 100%;
    }

    #clear-search {
        align-self: flex-end;
    }
}
@media print {
    @page {
        size: A4;
        margin: 15mm;
    }

    body {
        background: #ffffff;
        color: #000000;
    }

    main {
        width: auto;
        margin: 0;
        padding: 0;
        overflow: visible;
        box-shadow: none;
    }

  main::before,
body > main > p,
label[for="search"],
#search,
#clear-search,
.quick-searches,
.back-button,
.print-button {
    display: none !important;
}

    h1 {
        margin-bottom: 24px;
        font-size: 24pt;
    }

    #results {
        margin-top: 0;
    }

    .article-header {
        padding: 0 0 20px;
        border: 0;
        border-bottom: 1px solid #999999;
        background: #ffffff;
    }

    .search-results,
    .relation-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .article-button {
        padding: 12px;
        border: 1px solid #999999;
        box-shadow: none;
        break-inside: avoid;
    }

    .article-button:hover {
        transform: none;
    }

    .relation-section {
        margin-top: 28px;
    }

    .product-link {
        color: #000000;
        text-decoration: none;
    }

    .selected-article-image {
        height: 180px;
    }
}
.no-relations {
    padding: 20px;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-small);
    background: #fbfdff;
    color: var(--color-muted);
}
#clear-search:disabled {
    border-color: var(--color-border);
    background: #f5f5f5;
    color: var(--color-muted);
    cursor: not-allowed;
    opacity: 0.65;
}
.article-count {
    margin: 16px 0 0;
    color: var(--color-muted);
    font-size: 16px;
}
.site-footer {
    margin-top: 48px;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: right;
}
.result-options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    margin: 16px 0 0;
}

.result-options .article-count {
    margin: 0;
}

.discontinued-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--color-muted);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    cursor: pointer;
}

.discontinued-toggle input {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    accent-color: var(--color-accent);
    cursor: pointer;
}

@media (max-width: 600px) {
    .result-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-header a {
    order: 1;
    margin: 0;
}

.language-switch {
    order: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    color: var(--color-muted);
    font-size: 13px;
}

.language-switch button {
    min-height: 0;
    margin: 0;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}

.language-switch button:hover {
    color: var(--color-primary-dark);
}

.language-switch button[aria-pressed="true"] {
    color: var(--color-heading);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.language-switch button:focus-visible {
    border-radius: 3px;
    outline: 3px solid rgb(0 115 185 / 25%);
    outline-offset: 3px;
}

@media (max-width: 520px) {
    .site-header {
        gap: 12px;
    }

    .site-logo {
        width: min(170px, 100%);
    }
}