/*
 * The buying layer (inc/commerce.php, docs/WORDPRESS_COMMERCE.md). Tokens only, like assets/theme.css: a client
 * variation restyles all of it. Loaded only when one of its options is on.
 */

/* Header cart button (notable_cart_drawer on): same place, icon and count as the Mini-Cart block it replaces. */
.nt-cart-button { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px; border-radius: 999px; color: var(--nw-ink); text-decoration: none; transition: background var(--nw-ease), color var(--nw-ease); }
.nt-cart-button:hover { background: var(--nw-bg); color: var(--nw-primary); }
.nt-cart-button__count { position: absolute; inset-block-start: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--nw-primary); color: var(--nw-primary-ink); font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.nt-cart-button__count[hidden] { display: none; }

/* Drawer. */
.nt-drawer-open { overflow: hidden; }
.nt-drawer { position: fixed; inset: 0; z-index: 100000; }
.nt-drawer[hidden] { display: none; }
.nt-drawer__scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--nw-ink) 45%, transparent); opacity: 0; transition: opacity .25s ease; }
.nt-drawer__panel { position: absolute; inset-block: 0; inset-inline-end: 0; display: flex; flex-direction: column; width: min(440px, 100vw); background: var(--nw-surface); color: var(--nw-ink); box-shadow: -18px 0 40px -24px color-mix(in srgb, var(--nw-ink) 60%, transparent); transform: translateX(100%); transition: transform .25s ease; outline: none; }
.nt-drawer.is-open .nt-drawer__scrim { opacity: 1; }
.nt-drawer.is-open .nt-drawer__panel { transform: none; }
.nt-drawer.is-busy .nt-drawer__body, .nt-drawer.is-busy .nt-drawer__foot { opacity: .6; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .nt-drawer__panel, .nt-drawer__scrim { transition: none; } }
.nt-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-block-end: 1px solid var(--nw-line); }
.nt-drawer__title { margin: 0; font-size: var(--wp--preset--font-size--large); }
.nt-drawer__count { color: var(--nw-muted); font-family: var(--nw-font); font-size: var(--wp--preset--font-size--small); font-weight: 400; }
.nt-drawer__close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--nw-ink); cursor: pointer; }
.nt-drawer__close:hover { background: var(--nw-bg); color: var(--nw-primary); }
.nt-drawer :focus-visible { outline: 2px solid var(--nw-primary); outline-offset: 2px; }
.nt-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 16px; }
.nt-drawer__lines { margin: 0; padding: 0; list-style: none; }
.nt-line { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding-block: 16px; border-block-end: 1px solid var(--nw-line); }
.nt-line__image { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--nw-bg); }
.nt-line__info { display: grid; gap: 6px; min-width: 0; }
.nt-line__name { color: var(--nw-ink); font-weight: 700; text-decoration: none; }
.nt-line__name:hover { color: var(--nw-primary); text-decoration: underline; }
.nt-line__meta { margin: 0; color: var(--nw-muted); font-size: var(--wp--preset--font-size--small); }
.nt-line__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nt-line__price { font-weight: 700; }
.nt-line__remove { justify-self: start; min-height: 24px; padding: 0; border: 0; background: none; color: var(--nw-muted); font: inherit; font-size: var(--wp--preset--font-size--small); text-decoration: underline; cursor: pointer; }
.nt-line__remove:hover { color: var(--nw-primary); }
.nt-qty { display: inline-flex; align-items: center; border: 1px solid var(--nw-line); border-radius: 999px; }
.nt-qty__step { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--nw-ink); font-size: 18px; cursor: pointer; }
.nt-qty__step:hover:not([disabled]) { background: var(--nw-bg); color: var(--nw-primary); }
.nt-qty__step[disabled] { opacity: .35; cursor: default; }
.nt-qty__input { width: 2.6em; border: 0; background: transparent; color: var(--nw-ink); font: inherit; text-align: center; -moz-appearance: textfield; }
.nt-qty__input::-webkit-inner-spin-button, .nt-qty__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.nt-drawer__empty { display: grid; justify-items: center; gap: 16px; padding-block: 40px 24px; text-align: center; }
.nt-drawer__empty[hidden], .nt-drawer__foot[hidden], .nt-drawer__picks[hidden], .nt-drawer__progress[hidden] { display: none; }

/* Free-shipping progress. */
.nt-drawer__progress { padding: 14px 20px; background: var(--nw-bg); border-block-end: 1px solid var(--nw-line); }
.nt-progress__text { margin: 0 0 8px; font-size: var(--wp--preset--font-size--small); font-weight: 700; }
.nt-progress { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--nw-line) 70%, var(--nw-surface)); overflow: hidden; }
.nt-progress__bar { display: block; height: 100%; border-radius: inherit; background: var(--nw-primary); transition: inline-size .4s ease; }

/* Picks. */
.nt-drawer__picks { margin-block-start: 20px; }
.nt-drawer__picks-title { margin: 0 0 8px; font-size: var(--wp--preset--font-size--medium); }
.nt-drawer__picks ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.nt-pick { display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--nw-line); border-radius: var(--nw-radius); }
.nt-pick img { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; }
.nt-pick__info { display: grid; gap: 2px; min-width: 0; font-size: var(--wp--preset--font-size--small); }
.nt-pick__info a { color: var(--nw-ink); font-weight: 700; text-decoration: none; }
.nt-pick__info a:hover { color: var(--nw-primary); text-decoration: underline; }
.nt-pick__price { color: var(--nw-muted); }
.nt-pick__add { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--nw-primary); border-radius: 999px; background: var(--nw-surface); color: var(--nw-primary); font-size: 20px; text-decoration: none; cursor: pointer; transition: background var(--nw-ease), color var(--nw-ease); }
.nt-pick__add:hover { background: var(--nw-primary); color: var(--nw-primary-ink); }

/* Foot: rush, subtotal, Checkout. */
.nt-drawer__foot { display: grid; gap: 12px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-block-start: 1px solid var(--nw-line); background: var(--nw-surface); }
.nt-drawer__subtotal { display: flex; justify-content: space-between; margin: 0; font-size: var(--wp--preset--font-size--medium); }
.nt-drawer__checkout { width: 100%; justify-content: center; text-align: center; }
.nt-drawer__view { justify-self: center; font-size: var(--wp--preset--font-size--small); font-weight: 700; }
.nt-rush, .nt-rush-toggle label { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--nw-primary); border-radius: var(--nw-radius); background: color-mix(in srgb, var(--nw-primary) 6%, var(--nw-surface)); cursor: pointer; }
.nt-rush__input, .nt-rush-toggle input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--nw-primary); }
.nt-rush__note { margin: 6px 0 0; color: var(--nw-muted); font-size: var(--wp--preset--font-size--small); }
.nt-rush-toggle { margin-block: 12px; }

/* Quick add pills (notable_quick_add = pills). */
.nt-quick-buy__pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.nt-quick-buy__pills legend { padding: 0; margin-block-end: 6px; }
.nt-pill { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 4px 12px; border: 1px solid var(--nw-line); border-radius: 999px; background: var(--nw-surface); color: var(--nw-ink); font-size: var(--wp--preset--font-size--small); line-height: 1.2; cursor: pointer; transition: border-color var(--nw-ease), background var(--nw-ease); }
.nt-pill input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.nt-pill__price { color: var(--nw-muted); font-size: 12px; }
.nt-pill:hover { border-color: var(--nw-primary); }
.nt-pill:has(input:checked) { border-color: var(--nw-primary); background: color-mix(in srgb, var(--nw-primary) 10%, var(--nw-surface)); box-shadow: inset 0 0 0 1px var(--nw-primary); font-weight: 700; }
.nt-pill:has(input:focus-visible) { outline: 2px solid var(--nw-primary); outline-offset: 2px; }

/* Product page: Buy now and the trust row. */
form.cart .nt-buy-now { margin-inline-start: 8px; }
.nt-trust { display: grid; gap: 8px; margin: 16px 0 0; padding: 14px 0 0; border-block-start: 1px solid var(--nw-line); list-style: none; font-size: var(--wp--preset--font-size--small); }
.nt-trust li { display: flex; align-items: center; gap: 10px; }
.nt-trust svg { flex: none; color: var(--nw-primary); }

/* Sticky add to cart: phones only, once the page's own button has scrolled away. */
.nt-sticky-atc { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 9990; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--nw-surface); border-block-start: 1px solid var(--nw-line); box-shadow: 0 -12px 30px -20px color-mix(in srgb, var(--nw-ink) 50%, transparent); }
.nt-sticky-atc[hidden] { display: none; }
.nt-sticky-atc__text { display: grid; min-width: 0; font-size: var(--wp--preset--font-size--small); }
.nt-sticky-atc__name { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.nt-sticky-atc__add { flex: none; }
@media (min-width: 782px) { .nt-sticky-atc { display: none !important; } }
html.nt-has-sticky-atc { scroll-padding-block-end: 90px; }

/* Recently viewed. */
.nt-recent { margin-block: var(--wp--preset--spacing--60); }
.nt-recent[hidden] { display: none; }
.nt-recent__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--wp--preset--spacing--40); margin: 0; padding: 0; list-style: none; }
.nt-recent__item a { display: grid; gap: 8px; color: var(--nw-ink); font-weight: 700; text-decoration: none; }
.nt-recent__item a:hover { color: var(--nw-primary); }
.nt-recent__item img { width: 100%; aspect-ratio: 1; border-radius: var(--nw-radius); object-fit: cover; }
.nt-recent__price { color: var(--nw-muted); font-size: var(--wp--preset--font-size--small); }
@media (max-width: 781px) { .nt-recent__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Predictive search. On phones the opened header search is a full-width row under the header instead of pushing the page sideways. */
.nt-header .wp-block-search.nt-header__search { position: relative; }
@media (max-width: 600px) {
  .nt-header .wp-block-search.nt-header__search:not(.wp-block-search__searchfield-hidden) { position: static; }
  .nt-header .nt-header__search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper { position: absolute; inset-inline: 16px; inset-block-start: 100%; z-index: 20; width: auto !important; padding: 6px; border: 1px solid var(--nw-line); border-radius: var(--nw-radius); background: var(--nw-surface); box-shadow: var(--nw-shadow); }
  .nt-header .nt-header__search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input { flex: 1; min-width: 0; }
}
/* Predictive search. */
.nt-suggest { position: absolute; inset-block-start: calc(100% + 6px); inset-inline-end: 0; z-index: 1000; width: min(420px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; padding: 8px; border: 1px solid var(--nw-line); border-radius: var(--nw-radius); background: var(--nw-surface); box-shadow: var(--nw-shadow); }
.nt-suggest[hidden] { display: none; }
/* On phones the list spans the screen under the search field (the script sets its top). */
@media (max-width: 600px) { .nt-suggest { position: fixed; inset-inline: 16px; width: auto; } }
.nt-suggest__group { margin: 8px 8px 4px; color: var(--nw-muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.nt-suggest__option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: 8px; color: var(--nw-ink); text-decoration: none; }
.nt-suggest__option:not(:has(img, .nt-suggest__thumb)) { grid-template-columns: 1fr; }
.nt-suggest__option:hover, .nt-suggest__option[aria-selected="true"] { background: var(--nw-bg); color: var(--nw-primary); }
.nt-suggest__option img, .nt-suggest__thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--nw-bg); }
.nt-suggest__price { color: var(--nw-muted); font-size: var(--wp--preset--font-size--small); }
.nt-suggest__none { margin: 4px 8px; color: var(--nw-muted); font-size: var(--wp--preset--font-size--small); }

/* Back in stock (notable-blocks includes/back-in-stock.php). */
.nt-bis { display: grid; gap: 8px; margin-block: 16px; padding: 14px; border: 1px solid var(--nw-line); border-radius: var(--nw-radius); }
.nt-bis__row { display: flex; flex-wrap: wrap; gap: 8px; }
.nt-bis__row input[type=email] { flex-basis: 12em; }
.nt-bis__row input[type=email] { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--nw-line); border-radius: 8px; font: inherit; }
.nt-bis__hp { position: absolute !important; left: -9999px !important; }
.nt-bis__status { margin: 0; font-size: var(--wp--preset--font-size--small); }

/* Instant filters (notable_shop_filters = instant): the price slider and its fields stay inside the sidebar. */
.nt-shop__filters :is(.wp-block-woocommerce-product-filters, .wp-block-woocommerce-product-filter-price, .wc-block-product-filter-price-slider) { min-width: 0; max-width: 100%; }
.nt-shop__filters .wc-block-product-filter-price-slider__content input:not([type=range]) { box-sizing: border-box; min-width: 0; width: 100%; }
.nt-shop__filters .wc-block-product-filter-price-slider__content { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.nt-shop__filters .wc-block-product-filter-price-slider__range { width: 100%; max-width: 100%; min-width: 0; }
