.oj-category-header {
    --oj-category-ink: #140009;
    --oj-category-action: #303030;
    --oj-category-muted: #5f6264;
    --oj-category-line: rgba(20, 0, 9, 0.13);
    --oj-category-surface: #f5f2ec;
    --oj-category-focus: #ab9a61;
    background: #fff;
    color: var(--oj-category-ink);
    font-family: "Open Sans", sans-serif;
    font-weight: 300;
}

/* The dynamic header is immediately followed by Flatsome's otherwise empty
   shop-title strip and the main shop content. Direct sibling selectors avoid
   an expensive relational search through the full product DOM. */
.oj-category-header + .shop-page-title,
.oj-category-header + .shop-page-title + main .shop-container > .term-description {
    display: none !important;
}

.oj-category-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-width: 1890px;
    margin-inline: auto;
    padding: clamp(2rem, 3vw, 3.25rem) clamp(1.125rem, 1.3vw, 1.5rem) clamp(1.5rem, 2.5vw, 2.5rem);
}

.oj-category-header--with-image .oj-category-header__inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
    column-gap: clamp(2rem, 6vw, 6.5rem);
    align-items: center;
}

.oj-category-header__content {
    max-width: 780px;
}

.oj-category-header__breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
    overflow: hidden;
    color: var(--oj-category-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-transform: uppercase;
    white-space: nowrap;
}

.oj-category-header__breadcrumb a,
.oj-category-header__breadcrumb span {
    flex: 0 0 auto;
    color: inherit;
}

.oj-category-header__breadcrumb a {
    text-decoration: none;
    transition: color 180ms ease;
}

.oj-category-header__breadcrumb a:hover {
    color: var(--oj-category-ink);
}

.oj-category-header__separator {
    opacity: 0.45;
}

.oj-category-header__title {
    max-width: 100%;
    margin: 0;
    color: var(--oj-category-ink);
    font-family: Opulent, "Times New Roman", serif;
    font-size: clamp(3rem, 3.4vw, 4.25rem);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.01em;
    line-height: 1.05;
    text-transform: uppercase;
    text-wrap: balance;
    white-space: nowrap;
}

.oj-category-header__description {
    max-width: 82ch;
    margin-top: clamp(1.25rem, 2.5vw, 2rem);
    color: #565b5e;
    font-size: 1rem;
    font-family: "Open Sans", sans-serif;
    font-weight: 300;
    line-height: 1.6;
    text-wrap: pretty;
}

.oj-category-header__description > :first-child {
    margin-top: 0;
}

.oj-category-header__description > :last-child {
    margin-bottom: 0;
}

.oj-category-header__media {
    aspect-ratio: 4 / 3;
    margin: 0;
    overflow: hidden;
    background: var(--oj-category-surface);
}

.oj-category-header__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.oj-category-header__navigation {
    grid-column: 1 / -1;
    min-width: 0;
    margin-top: clamp(1.75rem, 3vw, 2.75rem);
    border-top: 1px solid var(--oj-category-line);
    padding-top: 1rem;
}

.oj-category-header__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.oj-category-header__item {
    margin: 0;
}

.oj-category-header__link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--oj-category-line);
    border-radius: 2px;
    padding: 0.65rem 1rem;
    background: transparent;
    color: var(--oj-category-action);
    font-family: "Open Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.oj-category-header__link:hover {
    border-color: var(--oj-category-action);
    background: var(--oj-category-surface);
    color: var(--oj-category-action);
}

.oj-category-header__link:active {
    transform: translateY(1px);
}

.oj-category-header__link.is-current {
    border-color: var(--oj-category-action);
    background: var(--oj-category-action);
    color: #fff;
}

.oj-category-header__link:focus-visible,
.oj-category-header__breadcrumb a:focus-visible {
    outline: 2px solid var(--oj-category-focus);
    outline-offset: 3px;
}

@media (max-width: 849px) {
    .oj-category-header--with-image .oj-category-header__inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .oj-category-header__inner {
        padding: 2rem 1.25rem 1.5rem;
    }

    .oj-category-header__breadcrumb {
        margin-bottom: 1.25rem;
        font-size: 0.68rem;
    }

    .oj-category-header__title {
        font-size: clamp(2.75rem, 12vw, 3.75rem);
        line-height: 1.04;
        white-space: normal;
    }

    .oj-category-header__title--long-word {
        font-size: clamp(2rem, 9.5vw, 3rem);
        letter-spacing: 0;
    }

    .oj-category-header__description {
        margin-top: 1.1rem;
        font-size: 1rem;
        line-height: 1.6;
    }

    .oj-category-header__media {
        grid-row: 2;
        margin-top: 1.5rem;
    }

    .oj-category-header__navigation {
        margin-inline: -1.25rem;
        margin-top: 1.5rem;
        padding: 0.9rem 1.25rem 0;
    }

    .oj-category-header__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .oj-category-header__item {
        min-width: 0;
    }

    .oj-category-header__item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .oj-category-header__link {
        width: 100%;
        min-height: 48px;
        padding-inline: 0.75rem;
        text-align: center;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .oj-category-header__link,
    .oj-category-header__breadcrumb a {
        transition: none;
    }
}
