.koko-store {
    --store-ink: #35241d;
    --store-accent: #5f3817;
    --store-line: #e5dad0;
    --store-matte: #faf6f1;
    color: var(--store-ink);
    font-family: "Raleway", system-ui, sans-serif;
}

article:has(> .entry-content > .koko-store) > .entry-header {
    margin-bottom: 26px;
}

.koko-store [hidden] {
    display: none !important;
}

.koko-store__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding-block: 10px 16px;
    border-bottom: 1px solid var(--store-line);
}

.koko-store__categories {
    display: flex;
    flex: 1 1 480px;
    flex-wrap: wrap;
    gap: 5px 8px;
}

.koko-store__categories a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 4px 8px;
    border: 1px solid var(--store-line);
    border-radius: 20px;
    color: var(--store-accent);
    background: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.koko-store__categories a:hover {
    background: var(--store-matte);
    border-color: var(--store-accent);
}

.koko-store__views {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--store-line);
    border-radius: 9px;
    background: var(--store-matte);
}

.koko-store__views button {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0;
    padding: 5px 11px;
    border: 0;
    border-radius: 6px;
    color: var(--store-accent);
    background: transparent;
    font: 650 0.875rem/1.15 "Raleway", system-ui, sans-serif;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
}

.koko-store__views button:hover {
    background: #eee3d7;
}

.koko-store__views button[aria-pressed="true"] {
    color: #fff;
    background: var(--store-accent);
}

.koko-store__icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background:
        linear-gradient(currentColor, currentColor) left top / 14px 2px,
        linear-gradient(currentColor, currentColor) left center / 14px 2px,
        linear-gradient(currentColor, currentColor) left bottom / 14px 2px;
    background-repeat: no-repeat;
}

[data-koko-view="grid"] .koko-store__icon {
    background:
        linear-gradient(currentColor, currentColor) left top / 5px 5px,
        linear-gradient(currentColor, currentColor) right top / 5px 5px,
        linear-gradient(currentColor, currentColor) left bottom / 5px 5px,
        linear-gradient(currentColor, currentColor) right bottom / 5px 5px;
    background-repeat: no-repeat;
}

.koko-store :is(a, button):focus-visible {
    outline: 2px solid var(--store-accent);
    outline-offset: 3px;
}

.koko-store__section {
    margin-block: 26px 34px;
    scroll-margin-top: 116px;
}

.koko-store .koko-store__heading {
    margin: 0 0 11px;
    text-align: left;
    font-size: clamp(1.375rem, 2.4vw, 1.85rem);
    line-height: 1.2;
}

.koko-store__heading a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--store-accent);
    text-decoration: none;
}

.koko-store__heading a:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.koko-store__heading a > span {
    box-sizing: border-box;
    width: 0.38em;
    height: 0.38em;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    transform: rotate(45deg);
}

.koko-store ul.koko-store__products {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.koko-store li.koko-store__card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--store-line);
    border-radius: 10px;
    background: #fff;
}

.koko-store__card:focus-within,
.koko-store__card:hover {
    border-color: #bd9d83;
}

.koko-store a.koko-store__item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.koko-store__image {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    background: var(--store-matte);
}

.koko-store__image img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.koko-store__details {
    display: grid;
    gap: 4px;
    min-width: 0;
    text-align: left;
}

.koko-store__name {
    color: var(--store-ink);
    font-size: 0.9375rem;
    font-weight: 650;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.koko-store__item:hover .koko-store__name {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.koko-store__price {
    color: #5c4b40;
    font-size: 0.875rem;
    font-weight: 550;
    line-height: 1.25;
}

.koko-store__price .amount {
    color: inherit;
    white-space: nowrap;
}

.koko-store .kokomonk-card-cart {
    padding-top: 0;
}

.koko-store .kokomonk-card-cart button.kokomonk-cart-step__button:not([hidden]) {
    width: 44px;
    height: 44px;
}

.koko-store__card:has(.kokomonk-card-cart__options:not([hidden]), .kokomonk-card-cart__status:not(:empty)) :is(.koko-store__actions, .kokomonk-card-cart) {
    display: contents;
}

.koko-store .kokomonk-card-cart__options,
.koko-store .kokomonk-card-cart__status {
    grid-column: 1 / -1;
    margin: 0;
}

.koko-store[data-view="grid"] .koko-store__products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
}

.koko-store[data-view="grid"] .koko-store__card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    align-items: start;
}

.koko-store[data-view="grid"] .koko-store__item {
    grid-template-columns: minmax(0, 1fr);
}

.koko-store[data-view="grid"] .kokomonk-card-cart {
    text-align: left;
}

@media (max-width: 639px) {
    .koko-store__toolbar {
        gap: 8px;
    }

    .koko-store__categories {
        flex-wrap: nowrap;
        min-width: 0;
        overflow-x: auto;
        padding: 3px 3px 7px;
        scrollbar-width: thin;
    }

    .koko-store__section {
        margin-block: 22px 26px;
    }
}

@media (min-width: 640px) {
    .koko-store ul.koko-store__products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .koko-store[data-view="grid"] .koko-store__products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1090px) {
    .koko-store ul.koko-store__products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .koko-store[data-view="grid"] .koko-store__products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
