/* Search and cart use the native modal layer and the same control scale. */
body:has(.hwk-shop-dialog[open]) {
    overflow: hidden;
}
.hwk-shop-dialog {
    position: fixed;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: var(--hwk-control-radius);
    background: #f5f5f3;
    color: #191919;
    font-family: var(--hwk-font);
    box-shadow: var(--hwk-shadow-panel);
    overscroll-behavior: contain;
}
.hwk-shop-dialog:not([open]),
.hwk-shop-dialog [hidden],
.hwk-product-search [hidden] {
    display: none !important;
}
.hwk-shop-dialog::backdrop {
    background: #0a0a0a99;
    animation: hwk-dialog-fade .18s ease-out;
}
.hwk-shop-dialog :is(a, button, input):focus-visible {
    outline: 2px solid #555;
    outline-offset: 2px;
}
.hwk-dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    margin-bottom: 12px;
}
.hwk-dialog-heading h2 {
    margin: 0;
    color: #191919;
    font-size: 20px;
    line-height: 1.3;
}
.hwk-dialog-heading button {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--hwk-control-radius);
    background: #e7e7e4;
    color: #222;
}
.hwk-dialog-heading button:hover {
    background: #dcdcd9;
}

.hwk-header-search {
    inset: 12px 0 auto;
    width: min(660px, calc(100% - 32px));
    max-height: calc(100dvh - 24px);
    margin-inline: auto;
    padding: 14px 20px 18px;
    overflow-y: auto;
}
.hwk-header-search[open] {
    animation: hwk-search-drop .23s ease-out;
}
.hwk-product-search .hwk-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    height: auto;
    max-width: none;
    margin: 0;
    padding: 4px;
    border: 1px solid #c8c8c6;
    border-radius: var(--hwk-control-radius);
    background: #fff;
}
.hwk-product-search .hwk-search:focus-within {
    border-color: #707070;
    box-shadow: 0 0 0 1px #707070;
}
.hwk-product-search .hwk-search input[type="search"] {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    color: #222;
    box-shadow: none;
    font-size: 16px;
    line-height: 1.4;
}
.hwk-product-search .hwk-search input::placeholder {
    color: #717171;
    opacity: 1;
}
.hwk-product-search .hwk-search input:focus-visible {
    outline: none;
}
.hwk-product-search input[type="search"]::-webkit-search-cancel-button {
    appearance: none;
    width: 17px;
    height: 17px;
    background: #555;
    mask: url(icons/close.svg) center / contain no-repeat;
    cursor: pointer;
}
.hwk-product-search .hwk-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: 44px;
    min-width: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--hwk-control-radius);
    background: #191919;
    color: #fff;
    font-size: 13px;
}
.hwk-product-search .hwk-search button:hover {
    background: #363636;
}
.hwk-product-search .hwk-search button .hwk-icon {
    width: 18px;
    height: 18px;
    filter: none;
}
.hwk-search-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.hwk-search-categories a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 0;
    border-radius: var(--hwk-control-radius);
    background: #e8e8e5;
    color: #333;
    font-size: 12px;
    line-height: 1.4;
}
.hwk-search-categories a:hover,
.hwk-search-all:hover {
    background: #dededb;
}
.hwk-search-status {
    margin: 10px 0 0;
    color: #595959;
    font-size: 13px;
    line-height: 1.5;
}
.hwk-search-status:empty,
.hwk-cart-status:empty {
    display: none;
}
.hwk-search-results {
    display: grid;
    gap: 4px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}
.hwk-search-results a {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--hwk-control-radius);
    background: #eee;
    color: #222;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.hwk-search-results a:hover,
.hwk-search-results a:focus-visible {
    background: #e2e2df;
}
.hwk-search-result-image {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: var(--hwk-control-radius);
    background: #f7f7f5;
    overflow: hidden;
}
.hwk-search-result-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.hwk-search-all {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 36px;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: var(--hwk-control-radius);
    color: #222;
    font-size: 13px;
}
.hwk-search-all .hwk-icon {
    width: 16px;
    height: 16px;
}

.hwk-cart-drawer {
    inset: 0 0 0 auto;
    width: min(440px, 100%);
    height: 100dvh;
    max-height: none;
    padding: 14px 18px max(18px, env(safe-area-inset-bottom));
    border-radius: var(--hwk-control-radius) 0 0 var(--hwk-control-radius);
    overflow-y: auto;
}
.hwk-cart-drawer[open] {
    display: flex;
    flex-direction: column;
    animation: hwk-cart-slide .24s ease-out;
}
.hwk-cart-drawer .hwk-dialog-heading {
    flex: 0 0 auto;
}
.hwk-cart-status {
    margin: 2px 0 12px;
    color: #555;
    font-size: 14px;
}
.hwk-cart-drawer-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.hwk-cart-drawer-content .widget_shopping_cart_content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.hwk-cart-drawer .woocommerce-mini-cart {
    flex: 1 1 auto;
    display: grid;
    align-content: start;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.hwk-cart-drawer .woocommerce-mini-cart-item {
    position: relative;
    min-height: 76px;
    padding: 10px 42px 10px 76px;
    border-radius: var(--hwk-control-radius);
    background: #eaeae8;
    line-height: 1.4;
    font-size: 14px;
}
.hwk-cart-drawer .woocommerce-mini-cart-item > a:not(.remove) {
    display: block;
    color: #202020;
    font-weight: var(--hwk-weight-medium);
    overflow-wrap: anywhere;
}
.hwk-cart-drawer .woocommerce-mini-cart-item img {
    position: absolute;
    inset: 9px auto auto 9px;
    width: 58px;
    height: 58px;
    margin: 0;
    border-radius: var(--hwk-control-radius);
    object-fit: contain;
}
.hwk-cart-drawer .woocommerce-mini-cart-item .remove {
    position: absolute;
    top: 6px;
    right: 5px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--hwk-control-radius);
    color: #333;
    background: transparent;
    font-size: 23px;
    line-height: 1;
}
.hwk-cart-drawer .woocommerce-mini-cart-item .remove:hover {
    background: #dadad7;
}
.hwk-cart-drawer .woocommerce-mini-cart-item .quantity {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #555;
}
.hwk-cart-drawer .variation {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
    margin: 4px 0 0;
    font-size: 12px;
    color: #555;
}
.hwk-cart-drawer .variation :is(p, dd) {
    margin: 0;
}
.hwk-cart-drawer .woocommerce-mini-cart__total {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 12px 0 0;
    padding: 14px 0 10px;
    font-size: 15px;
}
.hwk-cart-drawer .woocommerce-mini-cart__buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 0;
}
.hwk-cart-drawer :is(.woocommerce-mini-cart__buttons a, .hwk-cart-fallback a) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--hwk-control-radius);
    background: #e6e6e3;
    color: #202020;
    font-size: 13px;
    font-weight: var(--hwk-weight-medium);
    line-height: 1.35;
    text-align: center;
}
.hwk-cart-drawer .woocommerce-mini-cart__buttons a.checkout {
    background: #1b1b1b;
    color: #fff;
}
.hwk-cart-drawer :is(.woocommerce-mini-cart__buttons a, .hwk-cart-fallback a):hover {
    background: #d8d8d5;
}
.hwk-cart-drawer .woocommerce-mini-cart__buttons a.checkout:hover {
    background: #383838;
}
.hwk-cart-drawer .woocommerce-mini-cart__empty-message {
    margin: 4px 0;
    padding: 18px 14px;
    border-radius: var(--hwk-control-radius);
    background: #eaeae8;
    font-size: 14px;
}

@keyframes hwk-dialog-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes hwk-search-drop {
    from { transform: translateY(-100%); opacity: .3; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes hwk-cart-slide {
    from { transform: translateX(100%); opacity: .4; }
    to { transform: translateX(0); opacity: 1; }
}
@media (max-width: 767px) {
    .hwk-header-search {
        width: 100%;
        padding: 12px 14px 16px;
    }
    .hwk-dialog-heading {
        margin-bottom: 8px;
    }
    .hwk-dialog-heading h2 {
        font-size: 18px;
    }
    .hwk-header-search .hwk-search button {
        padding-inline: 10px;
    }
    .hwk-header-search .hwk-search button > span {
        display: none;
    }
    .hwk-cart-drawer {
        width: min(440px, calc(100% - 12px));
        padding-inline: 14px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .hwk-shop-dialog[open], .hwk-shop-dialog::backdrop {
        animation: none;
    }
}

@media (max-width: 1023px) {
    .hwk-shop-dialog::backdrop {
        --safe-top: env(safe-area-inset-top, 0px);
        background: linear-gradient(#000 var(--safe-top), #0a0a0a99 var(--safe-top));
    }
    .hwk-header-search {
        top: 0;
        max-height: calc(100dvh - 12px);
        /* The notch stays within the dialog even when the results scroll. */
        border-top: var(--hwk-mobile-safe-top, 0px) solid #000;
        border-radius: 0 0 var(--hwk-control-radius) var(--hwk-control-radius);
    }
    .hwk-cart-drawer {
        top: var(--hwk-mobile-safe-top, 0px);
        height: calc(100dvh - var(--hwk-mobile-safe-top, 0px));
    }
}

/* One compact progress display for the drawer and the native Cart block. */
.hwk-cart-rewards {
    padding: 12px;
    border-radius: var(--hwk-control-radius);
    background: linear-gradient(120deg, #ececea, #e5e5e2);
    color: #242424;
}
.hwk-cart-drawer .hwk-cart-rewards {
    margin-bottom: 9px;
}
.hwk-rewards-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 3px 12px;
    margin-bottom: 10px;
}
.hwk-rewards-heading h2 {
    margin: 0;
    color: inherit;
    font-size: 16px;
    line-height: 1.25;
}
.hwk-rewards-heading p,
.hwk-rewards-note {
    margin: 0;
    color: #525252;
    font-size: 12px;
    line-height: 1.45;
}
.hwk-rewards-heading .amount {
    font-weight: var(--hwk-weight-medium);
    color: #222;
}
.hwk-reward-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.hwk-reward-step {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.hwk-cart-drawer .hwk-reward-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hwk-reward-step progress {
    display: block;
    appearance: none;
    width: 100%;
    height: 5px;
    margin: 0 0 7px;
    border: 0;
    border-radius: var(--hwk-control-radius);
    background: #cececa;
    accent-color: #3d3d3d;
}
.hwk-reward-step progress::-webkit-progress-bar {
    border-radius: var(--hwk-control-radius);
    background: #cececa;
}
.hwk-reward-step progress::-webkit-progress-value {
    border-radius: var(--hwk-control-radius);
    background: #3d3d3d;
}
.hwk-reward-step progress::-moz-progress-bar {
    border-radius: var(--hwk-control-radius);
    background: #3d3d3d;
}
.hwk-reward-label {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-height: 52px;
    padding: 7px 6px;
    border-radius: var(--hwk-control-radius);
    background: #f7f7f5;
    overflow-wrap: anywhere;
    hyphens: auto;
}
.hwk-reward-label .hwk-icon {
    width: 16px;
    height: 16px;
    color: #474747;
}
.hwk-reward-label strong,
.hwk-reward-label small {
    display: block;
    color: inherit;
    line-height: 1.35;
}
.hwk-reward-label strong {
    font-size: 12px;
}
.hwk-reward-label small {
    margin-top: 2px;
    color: #555;
    font-size: 11px;
}
.hwk-reward-step.is-reached .hwk-reward-label {
    background: #d9d9d5;
}
.hwk-reward-step.is-unavailable .hwk-reward-label {
    color: #595959;
    background: #ededeb;
}
.hwk-rewards-note {
    margin-top: 7px;
}
.hwk-cart-feedback :is(.woocommerce-message, .woocommerce-error, .woocommerce-info) {
    display: block;
    margin: 0 0 8px;
    padding: 9px 11px;
    border: 0;
    border-radius: var(--hwk-control-radius);
    background: #e6e6e2;
    color: #222;
    font-size: 13px;
    line-height: 1.4;
    list-style: none;
}
.hwk-cart-feedback .woocommerce-message a.wc-forward {
    display: none;
}
.hwk-cart-feedback .woocommerce-error {
    background: #f4e4e1;
    color: #702820;
}
form.cart[aria-busy="true"] .single_add_to_cart_button {
    opacity: .65;
}
@media (max-width: 767px) {
    .hwk-reward-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hwk-reward-label {
        flex-direction: column;
        gap: 3px;
        min-height: 72px;
    }
    .hwk-reward-label strong {
        font-size: 11px;
    }
    .hwk-reward-label small {
        font-size: 10px;
    }
}
