/* Invoxity site header for standalone product pages (invoMind, InvoChef).
   Mirrors the main site's menu. Every class is prefixed "ivx-" so it never
   clashes with the product page's own styles. The theme comes from the
   header's data-ivx-theme attribute, which site-header.js keeps in sync. */

.ivx-header {
    --ivx-bg: #ffffff;
    --ivx-text: #000000;
    --ivx-muted: #6b6b6b;
    --ivx-line: #e9e9e9;
    --ivx-panel: #ffffff;
    --ivx-card: #f3f3f3;
    --ivx-card-hover: #ececec;
    --ivx-accent: #ff7b5e;
    --ivx-accent-text: #c2461f;
    --ivx-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.25);

    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--ivx-bg);
    border-bottom: 1px solid var(--ivx-line);
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ivx-text);
    -webkit-font-smoothing: antialiased;
}

/* Main-site pages: pinned to the top like the old menu. Their page layouts
   already leave room for it (and body gets 64px on phones in custom.css). */
.ivx-header.ivx-header--fixed {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
}

.ivx-header[data-ivx-theme="dark"] {
    --ivx-bg: #171717;
    --ivx-text: #d4d4d4;
    --ivx-muted: #a3a3a3;
    --ivx-line: #2b2b2b;
    --ivx-panel: #1f1f1f;
    --ivx-card: #2a2a2a;
    --ivx-card-hover: #333232;
    --ivx-accent-text: #ff7b5e;
    --ivx-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
}

.ivx-header *,
.ivx-header *::before,
.ivx-header *::after {
    box-sizing: border-box;
}

.ivx-header a {
    color: inherit;
    text-decoration: none;
}

.ivx-header button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.ivx-header ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ivx-header p {
    margin: 0;
}

.ivx-bar {
    position: relative;
    height: 72px;
    max-width: 1500px; /* same container as the main site's header */
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.ivx-logo img {
    display: block;
    height: 55px !important; /* the main site forces img height:auto on phones */
    width: auto;
}

.ivx-logo .ivx-logo-dark,
.ivx-header[data-ivx-theme="dark"] .ivx-logo .ivx-logo-light {
    display: none;
}

.ivx-header[data-ivx-theme="dark"] .ivx-logo .ivx-logo-dark {
    display: block;
}

/* ---------- desktop menu ---------- */
.ivx-nav {
    /* A full-width layer with the links centred on the page, like the main
       site's menu. It ignores clicks itself so the logo and toggle stay usable. */
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.ivx-nav > ul {
    pointer-events: auto;
}

.ivx-nav > ul {
    display: flex;
    align-items: center;
    gap: 32px;
}

.ivx-nav > ul > li {
    position: static;
}

/* ".ivx-header .ivx-top" outranks the button reset above, so dropdown
   buttons get the same size and weight as plain links. */
.ivx-header .ivx-top {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 72px;
    font-size: 18px;
    font-weight: 500;
    color: var(--ivx-text);
    transition: color 0.2s ease;
}

.ivx-top::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    height: 2px;
    background-color: var(--ivx-accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.25s ease;
}

.ivx-top:hover,
.ivx-top[aria-expanded="true"] {
    color: var(--ivx-accent);
}

.ivx-top[aria-expanded="true"]::after,
.ivx-top[aria-current="page"]::after {
    transform: scaleX(1);
}

.ivx-top[aria-current="page"],
.ivx-m-link[aria-current="page"],
.ivx-m-sub a[aria-current="page"] {
    color: var(--ivx-accent);
}

.ivx-caret {
    width: 10px;
    height: 10px;
    transition: transform 0.2s ease;
}

.ivx-top[aria-expanded="true"] .ivx-caret {
    transform: rotate(180deg);
}

/* The main site's desktop menu has no dropdown arrows. */
.ivx-nav .ivx-caret {
    display: none;
}

.ivx-panel {
    position: absolute;
    left: calc(50% - 50vw); /* full screen width, like the main site's dropdowns */
    right: calc(50% - 50vw);
    top: 100%;
    background-color: var(--ivx-panel);
    border-bottom: 1px solid var(--ivx-line);
    box-shadow: var(--ivx-shadow);
    padding: 24px;
}

.ivx-panel[hidden] {
    display: none;
}

.ivx-grid {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

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

.ivx-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 22px;
    border-radius: 8px;
    background-color: var(--ivx-card);
    transition: background-color 0.2s ease;
}

.ivx-card:hover {
    background-color: var(--ivx-card-hover);
}

.ivx-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--ivx-text);
}

.ivx-header[data-ivx-theme="dark"] .ivx-card-title {
    color: #f5f5f5;
}

.ivx-card-text {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ivx-muted);
}

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

.ivx-card[aria-current="page"] {
    box-shadow: inset 0 0 0 2px var(--ivx-accent);
}

.ivx-new {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: var(--ivx-accent);
    color: #1a1a1a;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
}

/* ---------- right side: theme toggle + menu button ---------- */
.ivx-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    margin-right: 30px; /* the main site's toggle sits 42px in from the edge */
}

.ivx-icon-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--ivx-text);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.ivx-icon-btn:hover {
    color: var(--ivx-accent);
    background-color: var(--ivx-card);
}

.ivx-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Like the main site: the icon shows the current theme (sun in light, moon in dark). */
.ivx-theme .ivx-i-moon,
.ivx-header[data-ivx-theme="dark"] .ivx-theme .ivx-i-sun {
    display: none;
}

.ivx-header[data-ivx-theme="dark"] .ivx-theme .ivx-i-moon {
    display: block;
}

.ivx-menu-btn {
    display: none;
}

.ivx-header :focus-visible {
    outline: 2px solid var(--ivx-accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------- mobile drawer ---------- */
.ivx-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background-color: rgba(0, 0, 0, 0.45);
}

.ivx-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    width: min(360px, 88vw);
    overflow-y: auto;
    background-color: var(--ivx-panel);
    box-shadow: var(--ivx-shadow);
    padding: 16px 20px 32px;
}

.ivx-backdrop[hidden],
.ivx-drawer[hidden] {
    display: none;
}

.ivx-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ivx-drawer-head img {
    height: 40px;
    width: auto;
}

.ivx-m-list > li {
    border-bottom: 1px solid var(--ivx-line);
}

/* ".ivx-header .ivx-m-link" outranks the main site's own link styles. */
.ivx-header .ivx-m-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    font-size: 17px;
    font-weight: 500;
    color: var(--ivx-text);
    text-align: left;
}

.ivx-m-link[aria-expanded="true"] {
    color: var(--ivx-accent);
}

.ivx-m-link[aria-expanded="true"] .ivx-caret {
    transform: rotate(180deg);
}

.ivx-m-sub {
    padding: 0 0 12px 12px;
}

.ivx-m-sub[hidden] {
    display: none;
}

.ivx-header .ivx-m-sub a {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 15px;
    color: var(--ivx-muted);
}

.ivx-m-sub a:hover {
    color: var(--ivx-accent);
}

.ivx-drawer-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 15px;
    color: var(--ivx-muted);
}

@media (max-width: 1199.98px) {
    .ivx-nav {
        display: none;
    }

    .ivx-menu-btn {
        display: grid;
    }

    .ivx-bar {
        height: 64px;
        padding: 0 12px;
    }

    .ivx-actions {
        margin-right: 0;
    }

    .ivx-logo img {
        height: 40px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ivx-header *,
    .ivx-header *::before,
    .ivx-header *::after {
        transition: none !important;
    }
}
