/* INTWB Shop UX: catalog search + full-width category rows.
   Scoped to body.intwb-sux so deactivating the plugin restores the theme look. */

body.intwb-sux {
    --sux-ink: #221e1d;
    --sux-muted: #6b6460;
    --sux-line: #e8ddd4;
    --sux-cream: #FAF6EE;
    --sux-butter: #F6C75B;
    --sux-butter-soft: #FBE6AC;
    --sux-sky-soft: #D8E8F5;
    --sux-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =====================================================================
   Search
   ================================================================== */

body.intwb-sux .sux-search {
    position: relative;
    max-width: 640px;
    margin: 30px auto 22px;
    font-family: var(--sux-body);
    text-align: left;
}

body.intwb-sux .sux-search__field {
    position: relative;
    display: flex;
    align-items: center;
    height: 62px;
    border: 2px solid var(--sux-ink);
    border-radius: 999px;
    background: #fff;
    box-shadow: 4px 5px 0 var(--sux-ink);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

body.intwb-sux .sux-search:focus-within .sux-search__field {
    box-shadow: 6px 7px 0 var(--sux-ink);
    transform: translate(-1px, -1px);
}

body.intwb-sux .sux-search__icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0 4px 0 22px;
    background-color: var(--sux-ink);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.intwb-sux input.sux-search__input,
body.intwb-sux input.sux-search__input:focus {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 12px;
    border: 0 !important;
    outline: none;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--sux-ink);
    font-family: var(--sux-body);
    font-size: 17px;
    font-weight: 600;
    -webkit-appearance: none;
    appearance: none;
}

body.intwb-sux .sux-search__input::placeholder {
    color: #8a827c;
    font-weight: 500;
    opacity: 1;
}

body.intwb-sux .sux-search__input::-webkit-search-cancel-button {
    display: none;
}

body.intwb-sux .sux-search__clear {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--sux-cream);
    cursor: pointer;
    position: relative;
}

body.intwb-sux .sux-search__clear::before,
body.intwb-sux .sux-search__clear::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    border-radius: 2px;
    background: var(--sux-ink);
    transform: translate(-50%, -50%) rotate(45deg);
}

body.intwb-sux .sux-search__clear::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

body.intwb-sux .sux-search__clear:hover {
    background: var(--sux-butter-soft);
}

body.intwb-sux .sux-search__clear[hidden] {
    display: none;
}

body.intwb-sux .sux-search__kbd {
    flex: 0 0 auto;
    margin-right: 20px;
    padding: 3px 9px;
    border: 1.5px solid var(--sux-line);
    border-bottom-width: 3px;
    border-radius: 8px;
    background: #fff;
    color: var(--sux-muted);
    font-family: var(--sux-body);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

body.intwb-sux .sux-search:focus-within .sux-search__kbd,
body.intwb-sux .sux-search__clear:not([hidden]) ~ .sux-search__kbd {
    display: none;
}

/* Popular searches */
body.intwb-sux .sux-search__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

body.intwb-sux .sux-chips__label {
    color: var(--sux-ink);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-right: 2px;
}

body.intwb-sux .sux-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    border: 1.5px solid var(--sux-ink);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--sux-ink);
    font-family: var(--sux-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

body.intwb-sux .sux-chip:hover,
body.intwb-sux .sux-chip:focus-visible {
    background: var(--sux-butter);
    color: var(--sux-ink);
    box-shadow: 2px 2px 0 var(--sux-ink);
    transform: translate(-1px, -1px);
}

body.intwb-sux .sux-chip--sm {
    min-height: 28px;
    padding: 0 12px;
    font-size: 12px;
}

/* Results panel (attached to <body>, positioned under the field) */
body.intwb-sux .sux-search__panel {
    position: absolute;
    z-index: 9990;
    max-height: min(64vh, 540px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 2px solid var(--sux-ink);
    border-radius: 22px;
    background: #fff;
    box-shadow: 5px 6px 0 var(--sux-ink);
    font-family: var(--sux-body);
    text-align: left;
}

body.intwb-sux .sux-search__panel[hidden] {
    display: none;
}

body.intwb-sux .sux-search__list {
    margin: 0;
    padding: 8px;
    list-style: none;
}

body.intwb-sux .sux-search__list:empty {
    display: none;
}

body.intwb-sux .sux-res {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.intwb-sux .sux-res > a {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 8px 12px 8px 8px;
    border-radius: 14px;
    color: var(--sux-ink);
    text-decoration: none;
}

body.intwb-sux .sux-res.is-active > a {
    background: var(--sux-cream);
}

body.intwb-sux .sux-res__img {
    width: 56px;
    height: 56px;
    border: 1px solid var(--sux-line);
    border-radius: 12px;
    background: #fbf8f3;
    overflow: hidden;
}

body.intwb-sux .sux-res__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.intwb-sux .sux-res__body {
    display: grid;
    gap: 3px;
    min-width: 0;
}

body.intwb-sux .sux-res__name {
    overflow: hidden;
    font-size: 15.5px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.intwb-sux .sux-res mark {
    padding: 0 1px;
    border-radius: 3px;
    background: var(--sux-butter-soft);
    color: inherit;
}

body.intwb-sux .sux-res__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    color: var(--sux-muted);
    font-size: 12.5px;
    font-weight: 600;
}

body.intwb-sux .sux-res__rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--sux-ink);
    font-weight: 700;
}

body.intwb-sux .sux-res__rating .intwb-sticker-rating {
    font-size: 12px;
}

body.intwb-sux .sux-res__price {
    display: grid;
    justify-items: end;
    gap: 4px;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

body.intwb-sux .sux-res__sale {
    padding: 3px 7px;
    border: 1.5px solid var(--sux-ink);
    border-radius: 999px;
    background: var(--sux-butter);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
}

body.intwb-sux .sux-res__oos {
    color: var(--sux-muted);
    font-size: 12px;
    font-weight: 700;
}

/* Matching sizes/scents under their product */
body.intwb-sux .sux-res--opt > a {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 12px;
    margin-left: 52px;
    padding: 6px 12px 6px 10px;
    position: relative;
}

body.intwb-sux .sux-res--opt > a::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 50%;
    left: -22px;
    width: 14px;
    border-left: 1.5px solid var(--sux-line);
    border-bottom: 1.5px solid var(--sux-line);
    border-bottom-left-radius: 8px;
}

body.intwb-sux .sux-res--opt .sux-res__img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
}

body.intwb-sux .sux-res--opt .sux-res__img:empty {
    border-style: dashed;
    background: transparent;
}

body.intwb-sux .sux-res__opt {
    font-size: 13.5px;
    font-weight: 700;
}

body.intwb-sux .sux-res--opt .sux-res__price {
    font-size: 13.5px;
}

body.intwb-sux .sux-res--opt.is-oos .sux-res__opt {
    color: var(--sux-muted);
}

body.intwb-sux .sux-res--more > a {
    display: block;
    margin-left: 52px;
    padding: 6px 10px;
    color: var(--sux-muted);
    font-size: 12.5px;
    font-weight: 700;
}

body.intwb-sux .sux-search__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 18px 12px;
    border-top: 1px solid var(--sux-line);
    color: var(--sux-muted);
    font-size: 12px;
    font-weight: 700;
}

body.intwb-sux .sux-search__list:empty + .sux-search__foot {
    border-top: 0;
}

body.intwb-sux .sux-search__empty {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px 0 4px;
    text-align: center;
}

body.intwb-sux .sux-search__empty strong {
    color: var(--sux-ink);
    font-size: 15px;
}

body.intwb-sux .sux-search__tips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

body.intwb-sux .sux-search__loading {
    width: 100%;
    padding: 6px 0;
    text-align: center;
}

@media (hover: none), (max-width: 768px) {
    body.intwb-sux .sux-search__kbd,
    body.intwb-sux .sux-search__hint {
        display: none;
    }
}

@media (max-width: 768px) {
    body.intwb-sux .sux-search {
        margin: 22px auto 16px;
    }

    body.intwb-sux .sux-search__field {
        height: 54px;
        box-shadow: 3px 4px 0 var(--sux-ink);
    }

    body.intwb-sux .sux-search__icon {
        margin-left: 18px;
    }

    body.intwb-sux input.sux-search__input {
        font-size: 16px;
    }

    body.intwb-sux .sux-search__chips {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        margin: 14px -16px 0;
        padding: 2px 16px 4px;
        scrollbar-width: none;
    }

    body.intwb-sux .sux-search__chips::-webkit-scrollbar {
        display: none;
    }

    body.intwb-sux .sux-chip {
        flex: 0 0 auto;
    }

    body.intwb-sux .sux-res > a {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        gap: 10px;
    }

    body.intwb-sux .sux-res__img {
        width: 48px;
        height: 48px;
    }

    body.intwb-sux .sux-res__name {
        font-size: 14.5px;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    body.intwb-sux .sux-res--opt > a {
        margin-left: 40px;
    }

    body.intwb-sux .sux-res--opt > a::before {
        left: -18px;
        width: 12px;
    }
}

/* =====================================================================
   Category rows (desktop): every product visible, or a clear count
   ================================================================== */

@media (min-width: 1025px) {
    /* Give the category rows the same width as the Ancestral Staples band. */
    body.intwb-sux .iwb-shop-sliders {
        width: min(1320px, calc(100vw - 64px));
        max-width: none;
        margin-left: calc(50% - min(660px, calc(50vw - 32px)));
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    body.intwb-sux .sux-row {
        --sux-gap: 18px;
        --sux-peek: 0;
    }

    body.intwb-sux .sux-row.sux-peek {
        --sux-peek: 0.22;
    }

    body.intwb-sux .sux-row .iwb-shop-slider-track {
        gap: var(--sux-gap);
        padding-top: 4px;
        padding-bottom: 10px;
    }

    body.intwb-sux .sux-row .iwb-shop-slider-track > .iwb-card {
        flex: 0 0 calc((100% - (var(--sux-per, 4) - 1 + var(--sux-peek)) * var(--sux-gap)) / (var(--sux-per, 4) + var(--sux-peek)));
        max-width: none;
    }

    /* Everything fits: no arrows, no swipe cue. */
    body.intwb-sux .sux-row.sux-fits .iwb-shop-slider-controls,
    body.intwb-sux .sux-row .iwb-shop-slider-affordance {
        display: none !important;
    }

    body.intwb-sux .sux-row.sux-fits .iwb-shop-slider-track {
        overflow-x: visible;
        scroll-snap-type: none;
    }

    /* "View all": the row becomes a grid. */
    body.intwb-sux .sux-row.sux-expanded .iwb-shop-slider-track {
        flex-wrap: wrap;
        row-gap: 26px;
        overflow-x: visible;
        scroll-snap-type: none;
    }

    body.intwb-sux .sux-row.sux-expanded {
        --sux-peek: 0;
    }

    body.intwb-sux .sux-row.sux-expanded .iwb-shop-slider-controls {
        display: none !important;
    }

    /* Fade on the right edge says "there's more" while the row is scrollable. */
    body.intwb-sux .sux-row.sux-peek:not(.sux-expanded) .iwb-shop-slider {
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 70px), rgba(0, 0, 0, 0.35) 100%);
        mask-image: linear-gradient(90deg, #000 calc(100% - 70px), rgba(0, 0, 0, 0.35) 100%);
    }

    body.intwb-sux .sux-row.sux-peek.iwb-slider-can-scroll-prev:not(.sux-expanded):not(.iwb-slider-can-scroll-next) .iwb-shop-slider {
        -webkit-mask-image: none;
        mask-image: none;
    }

    body.intwb-sux .sux-row .iwb-shop-slider-nav {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    body.intwb-sux .sux-row-tools {
        display: flex;
        align-items: center;
        gap: 14px;
        font-family: var(--sux-body);
    }

    body.intwb-sux .sux-row-status {
        color: var(--sux-muted);
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
    }

    body.intwb-sux .iwb-shop-staples .sux-row-status,
    body.intwb-sux .sux-row[data-slider-theme="staples"] .sux-row-status {
        color: rgba(250, 246, 238, 0.72);
    }

    body.intwb-sux .sux-row-all {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 0 18px;
        border: 2px solid var(--sux-ink);
        border-radius: 999px;
        background: #fff;
        box-shadow: 3px 3px 0 var(--sux-ink);
        color: var(--sux-ink);
        font-family: var(--sux-body);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.1em;
        line-height: 1;
        text-transform: uppercase;
        white-space: nowrap;
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    }

    body.intwb-sux .sux-row-all:hover,
    body.intwb-sux .sux-row-all:focus-visible {
        background: var(--sux-butter);
        color: var(--sux-ink);
        box-shadow: 1px 1px 0 var(--sux-ink);
        transform: translate(2px, 2px);
    }

    body.intwb-sux .sux-row-all[hidden] {
        display: none;
    }

    body.intwb-sux .iwb-shop-staples .sux-row-all {
        border-color: var(--sux-butter);
        background: var(--sux-butter);
        box-shadow: 3px 3px 0 #000;
    }
}

@media (min-width: 1025px) {
    /* Slightly tighter card text so five columns stay readable. */
    body.intwb-sux .sux-row .iwb-attr-select {
        padding: 10px 28px 10px 11px;
        letter-spacing: 0.03em;
        text-overflow: ellipsis;
    }

    body.intwb-sux .sux-row .iwb-attr-select-wrap::after {
        right: 12px;
    }
}

@media (min-width: 1025px) and (max-width: 1439px) {
    body.intwb-sux .sux-row .iwb-card-title {
        font-size: 18px;
    }
}

@media (max-width: 1024px) {
    body.intwb-sux .sux-row-tools {
        display: none;
    }
}

/* 1.1.4: the theme gives every row track 12px of left padding while the cards snap to their
   start edge, so on load the browser scrolled each row 12px to snap the first card. Chrome
   counts that load-time scroll as the visitor scrolling and stops recording the page's
   Largest Contentful Paint (PageSpeed showed NO_LCP for /shop/). At rest the first card sat
   flush left either way; without the padding it starts there, nothing scrolls, and the
   "previous" arrow is correctly disabled at the start of each row. */
body.intwb-sux .iwb-shop-slider-track {
    padding-left: 0;
}
