:root {
    --gnism-height: 68px;
    --gnism-yellow: #ffd200;
    --gnism-ink: #171717;
    --gnism-muted: #687080;
    --gnism-line: #e7e9ed;
}

.gnism {
    display: none;
}

.gnism-inline-search {
    position: relative;
    z-index: 100;
    width: 100%;
    color: var(--gnism-ink);
}

.gnism-inline-control {
    display: grid;
    width: 100%;
    height: 40px;
    grid-template-columns: 22px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
    padding: 0 7px 0 12px;
    border: 1px solid #d7dbe2;
    border-radius: 8px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.gnism-inline-search--md .gnism-inline-control {
    height: 46px;
}

.gnism-inline-control:focus-within {
    border-color: var(--gnism-yellow);
    box-shadow: 0 0 0 3px rgba(255, 210, 0, .2);
}

.gnism-inline-control > svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #687080;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gnism-inline-control input {
    -webkit-appearance: none !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--gnism-ink) !important;
    font-size: 15px !important;
}

.gnism-inline-control input::-webkit-search-cancel-button {
    display: none;
    -webkit-appearance: none;
}

.gnism-inline-control button {
    display: grid !important;
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    place-items: center;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f1f3f6 !important;
    color: #4b5563 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.gnism-inline-control button[hidden] {
    display: none !important;
}

.gnism-inline-control button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.gnism-inline-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    display: none;
    max-height: min(430px, 70vh);
    overflow-y: auto;
    border: 1px solid var(--gnism-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .16);
}

.gnism-inline-results.is-open {
    display: block;
}

.gnism-inline-results .gnism-result {
    display: grid !important;
    min-height: 72px;
    grid-template-columns: 56px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 11px;
    padding: 8px 11px !important;
    border-bottom: 1px solid var(--gnism-line);
    color: var(--gnism-ink) !important;
    text-decoration: none !important;
}

.gnism-inline-results .gnism-result img {
    width: 56px !important;
    height: 56px !important;
    object-fit: contain !important;
}

.gnism-inline-results .gnism-result strong,
.gnism-inline-results .gnism-result small {
    display: block;
}

.gnism-inline-results .gnism-result strong {
    font-size: 13px;
    line-height: 1.3;
}

.gnism-inline-results .gnism-result small {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 700;
}

.gnism-inline-results .gnism-result > svg,
.gnism-inline-results .gnism-show-all svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.gnism-inline-results .gnism-show-all {
    display: flex !important;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--gnism-ink) !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
}

.gnism-inline-results .gnism-search-empty,
.gnism-inline-results .gnism-search-hint {
    padding: 24px 16px;
    color: var(--gnism-muted);
    text-align: center;
}

.gnism-inline-results .gnism-spinner {
    display: block;
    width: 28px;
    height: 28px;
    margin: 24px auto;
    border: 3px solid #e5e7eb;
    border-top-color: var(--gnism-yellow);
    border-radius: 50%;
    animation: gnism-spin .75s linear infinite;
}

@keyframes gnism-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1024px) {
    body {
        padding-bottom: calc(var(--gnism-height) + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.single-product #sticky-add-to-cart {
        bottom: var(--gnism-offset, calc(var(--gnism-height) + env(safe-area-inset-bottom, 0px))) !important;
    }

    body.single-product.gnism-open #sticky-add-to-cart {
        opacity: 0 !important;
        transform: translateY(160%) !important;
        pointer-events: none !important;
    }

    body.gnism-open {
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    .gnism {
        display: contents;
        color: var(--gnism-ink);
        font-family: inherit;
    }

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

    .gnism svg {
        display: block;
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .gnism-bar {
        position: fixed !important;
        z-index: 999990;
        top: auto !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        height: calc(var(--gnism-height) + env(safe-area-inset-bottom, 0px));
        padding: 6px 5px env(safe-area-inset-bottom, 0px);
        border-top: 1px solid var(--gnism-line);
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 -10px 30px rgba(15, 23, 42, .08);
        backdrop-filter: blur(14px);
        transform: none !important;
        translate: none !important;
    }

    .gnism-item {
        position: relative;
        display: flex !important;
        min-width: 0 !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        margin: 0 !important;
        padding: 0 2px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #555b66 !important;
        font-family: inherit !important;
        font-size: 10px !important;
        font-weight: 600 !important;
        line-height: 1.1 !important;
        text-decoration: none !important;
        cursor: pointer;
    }

    .gnism-item::before {
        position: absolute;
        top: -6px;
        width: 28px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--gnism-yellow);
        content: "";
        opacity: 0;
    }

    .gnism-item.is-active,
    .gnism-item:active {
        color: var(--gnism-ink) !important;
    }

    .gnism-item.is-active::before {
        opacity: 1;
    }

    .gnism-icon-shell {
        position: relative;
        display: grid;
        width: 32px;
        height: 32px;
        place-items: center;
    }

    .gnism-item--primary .gnism-icon-shell {
        width: 38px;
        height: 38px;
        margin-top: -8px;
        border: 2px solid var(--gnism-ink);
        border-radius: 50%;
        background: var(--gnism-yellow);
        color: var(--gnism-ink);
    }

    .gnism-item--primary .gnism-icon-shell svg {
        width: 21px;
        height: 21px;
    }

    .gnism-cart-count {
        position: absolute;
        top: -1px;
        right: -5px;
        display: grid;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        place-items: center;
        border: 2px solid #fff;
        border-radius: 999px;
        background: var(--gnism-yellow);
        color: var(--gnism-ink);
        font-size: 9px;
        font-weight: 800;
        line-height: 1;
    }

    .gnism-shade {
        position: fixed;
        z-index: 999991;
        inset: 0 0 calc(var(--gnism-height) + env(safe-area-inset-bottom, 0px));
        display: block;
        background: rgba(15, 23, 42, .42);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    .gnism-shade.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .gnism-panel {
        position: fixed;
        z-index: 999992;
        top: max(0px, env(safe-area-inset-top, 0px));
        right: 0;
        bottom: calc(var(--gnism-height) + env(safe-area-inset-bottom, 0px));
        left: 0;
        display: flex;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
        background: #fff;
        opacity: 0;
        visibility: hidden;
        transform: translateY(24px);
        transition: opacity .2s ease, transform .2s ease, visibility .2s;
    }

    .gnism-panel.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .gnism-panel-header {
        display: flex;
        min-height: 62px;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px 10px 18px;
        border-bottom: 1px solid var(--gnism-line);
        background: #fff;
    }

    .gnism-panel-header h2 {
        margin: 0;
        color: var(--gnism-ink);
        font-size: 19px;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: 0;
    }

    .gnism-icon-button,
    .gnism-search-clear,
    .gnism-category > button {
        display: grid !important;
        flex: 0 0 auto;
        place-items: center;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: var(--gnism-ink) !important;
        box-shadow: none !important;
        cursor: pointer;
    }

    .gnism-icon-button {
        width: 42px;
        height: 42px;
    }

    .gnism-search-control {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr) 34px;
        gap: 9px;
        align-items: center;
        margin: 12px 14px;
        padding: 0 8px 0 13px;
        border: 1px solid #d7dbe2;
        border-radius: 8px;
        background: #f5f6f8;
    }

    .gnism-search-control > svg {
        width: 20px;
        height: 20px;
        color: #707784;
    }

    .gnism-search-control input {
        -webkit-appearance: none !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        outline: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: var(--gnism-ink) !important;
        font-size: 16px !important;
    }

    .gnism-search-control input::-webkit-search-cancel-button {
        display: none;
        -webkit-appearance: none;
    }

    .gnism-search-clear {
        width: 34px;
        height: 34px;
        border-radius: 50% !important;
        background: #dfe2e7 !important;
    }

    .gnism-search-clear svg {
        width: 17px;
        height: 17px;
    }

    .gnism-search-results,
    .gnism-category-list {
        min-height: 0;
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 14px 22px;
    }

    .gnism-search-hint {
        margin: 24px 0;
        color: var(--gnism-muted);
        font-size: 14px;
        text-align: center;
    }

    .gnism-spinner {
        display: block;
        width: 30px;
        height: 30px;
        margin: 34px auto;
        border: 3px solid #e5e7eb;
        border-top-color: var(--gnism-yellow);
        border-radius: 50%;
        animation: gnism-spin .7s linear infinite;
    }

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

    .gnism-result {
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr) 22px;
        gap: 12px;
        align-items: center;
        min-height: 78px;
        padding: 10px 2px;
        border-bottom: 1px solid var(--gnism-line);
        color: var(--gnism-ink);
        text-decoration: none;
    }

    .gnism-result img {
        display: block;
        width: 58px;
        height: 58px;
        padding: 3px;
        object-fit: contain;
        border: 1px solid var(--gnism-line);
        border-radius: 6px;
        background: #fff;
    }

    .gnism-result > span {
        display: grid;
        gap: 5px;
        min-width: 0;
    }

    .gnism-result strong {
        display: -webkit-box;
        overflow: hidden;
        color: var(--gnism-ink);
        font-size: 13px;
        font-weight: 650;
        line-height: 1.3;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .gnism-result small {
        color: var(--gnism-ink);
        font-size: 14px;
        font-weight: 750;
    }

    .gnism-result > svg {
        width: 18px;
        height: 18px;
        color: #8a909a;
    }

    .gnism-show-all,
    .gnism-all-products {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 48px;
        color: var(--gnism-ink);
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
    }

    .gnism-show-all {
        margin-top: 12px;
        padding: 0 14px;
        border-radius: 7px;
        background: var(--gnism-yellow);
    }

    .gnism-show-all svg,
    .gnism-all-products > svg:last-child {
        width: 19px;
        height: 19px;
    }

    .gnism-search-empty {
        display: grid;
        justify-items: center;
        gap: 12px;
        padding: 48px 16px;
        color: var(--gnism-muted);
        text-align: center;
    }

    .gnism-search-empty svg {
        width: 34px;
        height: 34px;
    }

    .gnism-search-empty strong {
        color: var(--gnism-ink);
        font-size: 15px;
    }

    .gnism-category-list {
        padding-top: 12px;
    }

    .gnism-all-products {
        justify-content: flex-start;
        margin-bottom: 8px;
        padding: 0 12px;
        border-radius: 7px;
        background: var(--gnism-yellow);
    }

    .gnism-all-products span {
        flex: 1 1 auto;
    }

    .gnism-category {
        position: relative;
        padding-left: calc(var(--gnism-depth, 0) * 14px);
        border-bottom: 1px solid var(--gnism-line);
    }

    .gnism-category > a {
        display: flex;
        min-height: 48px;
        align-items: center;
        gap: 8px;
        padding: 0 46px 0 4px;
        color: var(--gnism-ink);
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
    }

    .gnism-category > a span {
        min-width: 0;
        flex: 1 1 auto;
    }

    .gnism-category > a small {
        color: #8a909a;
        font-size: 11px;
        font-weight: 600;
    }

    .gnism-category > button {
        position: absolute;
        top: 3px;
        right: 0;
        width: 42px;
        height: 42px;
        transition: transform .16s ease;
    }

    .gnism-category > button svg {
        width: 18px;
        height: 18px;
    }

    .gnism-category > button[aria-expanded="true"] {
        transform: rotate(90deg);
    }

    .gnism-category-children {
        border-top: 1px solid #f1f2f4;
    }
}

@media (max-width: 360px) {
    .gnism-item {
        font-size: 9px !important;
    }
}
