spacer before the stepper shoves it sideways in a flex cell. */
table.items-list[data-csw-grid] td.qnt-count > div:empty { display: none; }
/* ================= ITEM CELLS (desktop + mobile) ================= */
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.thumb .thumb-wrapper {
position: relative; box-sizing: border-box; width: 86px; height: 86px; padding: 6px; background: #fff;
border: 1px solid #f4f5f5; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.thumb .thumb-wrapper::after { content: ""; position: absolute; inset: 0; background: rgba(123, 131, 132, 0.08); pointer-events: none; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.thumb .thumb-wrapper > a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.thumb img {
display: block; max-width: 100% !important; max-height: 100%; width: auto !important; height: auto !important;
object-fit: contain; margin: 0 !important;
}
/* Name cell: a column, so the delivery block (inserted first) can show after the name, except on wide desktop. */
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name { display: flex; flex-direction: column; align-items: stretch; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name > .csw-delivery { order: 1; margin-top: 10px; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name > a.show-more-info { align-self: flex-start; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name a.bolder {
font-size: 14px !important; font-weight: 400 !important; line-height: 1.4 !important;
color: var(--csw-blue) !important; text-decoration: none;
}
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name a.bolder:hover { text-decoration: underline; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--csw-text-body); }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .item-sku-wrapper,
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .item-pack-size-wrapper {
display: inline-block !important; margin: 0 14px 0 0 !important; font-size: 12px !important; color: var(--csw-text-muted);
}
/* "Product Code" / "Pack Size" -> "Code" / "Pack", CSS only. */
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .item-sku-value.item_sku{margin-left:5px}
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .item-sku-label,
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .item-pack-size-label { font-size: 0 !important; font-weight: 600; color: var(--csw-text-body); }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .item-sku-label::before { content: "Code"; font-size: 12px; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .item-pack-size-label::before { content: "Pack"; font-size: 12px; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .add-reference { display: block !important; margin-top: 8px; font-size: 12px !important; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .ref-label { color: var(--csw-orange) !important; font-size: 12px !important; text-decoration: none; cursor: pointer; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .ref-label > i { display: none; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name .more-info .ref-label::before { content: "+ "; }
/* Price: quiet. Total: the strong number. */
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.price .content_value,
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.price .content_value * {
background: none !important; box-shadow: none !important; border: 0 !important; padding: 0 !important;
font-size: 14px !important; font-weight: 400 !important; color: var(--csw-text-muted) !important;
}
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.total .content_value,
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.total .content_value * {
background: none !important; box-shadow: none !important; border: 0 !important; padding: 0 !important;
font-size: 15px !important; font-weight: 600 !important; color: var(--csw-blue) !important;
}
/* Quantity: one outlined stepper. */
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.qnt-count {
display: flex !important; align-items: center; justify-content: center; box-sizing: border-box; height: 34px;
border: 1px solid var(--csw-hairline) !important; border-radius: 6px; overflow: hidden; background: #fff !important;
}
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.qnt-count a.incr-btn {
flex: none; display: flex !important; align-items: center; justify-content: center; width: 32px !important;
height: 32px !important; padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important;
background: none !important; box-shadow: none !important; color: var(--csw-blue) !important; font-size: 16px !important;
line-height: 1; text-decoration: none;
}
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.qnt-count a.incr-btn:hover { background: var(--csw-surface-muted) !important; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.qnt-count input.quantity {
flex: none; width: 40px !important; height: 32px !important; padding: 0 !important; margin: 0 !important;
border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important;
text-align: center; font-size: 14px !important; font-weight: 600; color: var(--csw-blue) !important;
}
/* Remove: bin icon only; the "Remove" text stays in the DOM (font-size 0) as the link's accessible name. */
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.delete a.delete-btn {
display: inline-flex !important; align-items: center; justify-content: center; width: 28px; height: 28px;
padding: 0 !important; border: 0 !important; border-radius: 6px; background: none !important; box-shadow: none !important;
color: var(--csw-text-muted) !important; font-size: 0 !important; text-decoration: none;
}
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.delete a.delete-btn > i { display: none !important; }
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.delete a.delete-btn::before {
content: ""; width: 18px; height: 18px; background-color: currentColor;
-webkit-mask: var(--csw-icon-bin) center / contain no-repeat; mask: var(--csw-icon-bin) center / contain no-repeat;
}
table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.delete a.delete-btn:hover { color: var(--csw-blue) !important; background: var(--csw-surface-muted) !important; }
/* Search alternatives (Contact Us only). The site's link rules inside the cart table strip the bottom
border, so every side is set explicitly with !important. */
table.items-list a.csw-alt-link {
display: inline-block !important; align-self: flex-start; box-sizing: border-box; height: auto !important;
min-height: 0 !important; margin: 0 12px 10px !important; padding: 5px 10px !important; background: #fff !important;
border: 1px solid var(--csw-orange) !important; border-bottom: 1px solid var(--csw-orange) !important;
border-radius: 6px !important; box-shadow: none !important; overflow: visible !important; color: var(--csw-orange) !important;
font-size: 11px !important; font-weight: 700 !important; line-height: 1.2 !important; letter-spacing: 0.06em;
text-transform: uppercase; text-decoration: none !important;
}
table.items-list a.csw-alt-link:hover,
table.items-list a.csw-alt-link:focus-visible { background: var(--csw-orange) !important; color: #fff !important; }
/* Outside wide desktop the card sits under the name: card-sized, not the whole name column. */
.desktop table.items-list[data-csw-grid][data-csw-tuned][data-csw-compact] tbody > tr:not(.csw-band) > td.name > .csw-delivery,
.mobile table.items-list[data-csw-grid] tbody > tr:not(.csw-band) > td.name > .csw-delivery { align-self: flex-start; width: 100%; max-width: 260px; }
/* ================= BANDS ================= */
tr.csw-band { margin-top: 24px; }
tr.csw-band:first-child { margin-top: 0; }
tr.csw-band > td { grid-column: 1 / -1; display: block; padding: 0 !important; border: 0 !important; background: none !important; }
tr.csw-band[data-csw-tier="fast"] { --csw-band-accent: var(--csw-green); --csw-band-bg: var(--csw-green-tint); --csw-band-fg: var(--csw-green); }
tr.csw-band[data-csw-tier="medium"],
tr.csw-band[data-csw-tier="slow"] { --csw-band-accent: var(--csw-orange); --csw-band-bg: var(--csw-orange-tint); --csw-band-fg: var(--csw-orange-ink); }
tr.csw-band[data-csw-tier="unknown"] { --csw-band-accent: var(--csw-blue-deep); --csw-band-bg: var(--csw-light-grey); --csw-band-fg: var(--csw-blue-deep); }
tr.csw-band[data-csw-tier="loading"] { --csw-band-accent: #c5ccd0; --csw-band-bg: var(--csw-surface-muted); --csw-band-fg: var(--csw-text-muted); }
.csw-band-inner {
display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 10px 16px 10px 20px; border-radius: 4px;
background: linear-gradient(90deg, var(--csw-band-accent) 4px, var(--csw-band-bg) 4px);
}
.csw-band-label {
font-family: var(--csw-font-display); font-size: 19px; font-weight: 600; line-height: 1.2; letter-spacing: 0.01em;
text-transform: uppercase; color: var(--csw-band-fg);
}
.csw-band-count { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--csw-text-muted); white-space: nowrap; }
/* ================= DELIVERY OPTIONS PANEL ================= */
.csw-delivery-options {
margin-bottom: 16px; padding: 24px; border-radius: 10px; overflow: hidden; background-color: #3a5545;
background-image: linear-gradient(rgba(67, 95, 78, 0.68), rgba(67, 95, 78, 0.68)), url("https://eu.evocdn.io/dealer/1655/content/media/My_Theme/complete-delivery-bg.png"); background-size: cover; background-position: center;
color: #fff; font-size: 13px; line-height: 1.5; text-align: left;
}
.csw-dopt-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
.csw-dopt-title {
font-family: var(--csw-font-title, inherit); font-size: 2.25rem; font-weight: 700; line-height: 1;
letter-spacing: -0.03em; text-transform: lowercase; color: #fff;
}
.csw-dopt-title em { font-style: normal; color: var(--csw-orange); }
.csw-dopt-copy { margin: 12px 0 18px; font-size: 13px; line-height: 1.55; color: #fff; }
.csw-dopt-list { display: flex; flex-direction: column; gap: 10px; }
/* Not a native
: something on this page scoped to radio inputs swallowed clicks. */
.csw-delivery-radio {
display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 8px; background: transparent; color: #fff; cursor: pointer; pointer-events: auto;
transition: background-color 0.15s, color 0.15s;
}
.csw-delivery-radio:hover { background: rgba(255, 255, 255, 0.08); }
.csw-delivery-radio.csw-checked { background: #fff; border-color: #fff; color: var(--csw-blue); }
.csw-delivery-radio:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.csw-radio-dot { flex: none; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: #fff; }
.csw-delivery-radio.csw-checked .csw-radio-dot { background: var(--csw-orange); }
.csw-radio-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.csw-radio-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 700; }
.csw-radio-badge {
padding: 3px 6px; border-radius: 4px; background: var(--csw-orange); color: #fff; font-size: 10px; font-weight: 700;
line-height: 1.2; letter-spacing: 0.06em; text-transform: uppercase;
}
.csw-radio-lines { display: flex; flex-direction: column; font-size: 13px; line-height: 1.45; }
.csw-dopt-footer { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.4); font-size: 12px; line-height: 1.5; color: #fff; }
.csw-dopt-footer[hidden] { display: none; }
.csw-delivery-options.csw-is-busy .csw-delivery-radio { cursor: progress; }
/* ================= COMPLETE ORDER DELIVERY LINE =================
Marker line only: picture + name, pinned above every band. Keyed off the item_
class Vue renders.
The delete cell stays in the DOM, just hidden, so the radio can still trigger its Remove button. */
body.ex-cart.csw-on table.items-list tr.item_148061607[class] { order: -1 !important; }
body.ex-cart.csw-on table.items-list tr.item_148061607[class] > td:not(.thumb):not(.name),
body.ex-cart.csw-on table.items-list tr.item_148061607[class] :is(.gift-element, .show-more-info, .more-info, .loader_item, .csw-delivery) { display: none !important; }
body.ex-cart.csw-on table.items-list tr.item_148061607[class] a { pointer-events: none; cursor: default; }
body.ex-cart.csw-on table.items-list tr.item_148061607[class] {
background: var(--csw-green-tint); border: 1px solid #cdead4 !important; border-radius: 8px;
padding: 14px 0 !important; margin: 0 0 24px;
}
body.ex-cart.csw-on table.items-list tr.item_148061607[class] > td.name { align-self: center; padding-right: 0 !important; }
body.ex-cart.csw-on table.items-list tr.item_148061607[class] > td.name::before {
content: "Consolidated delivery"; display: block; width: fit-content; margin-bottom: 6px; padding: 2px 9px;
border-radius: 999px; background: var(--csw-green); color: #fff; font-size: 10.5px; font-weight: 700;
letter-spacing: 0.05em; text-transform: uppercase;
}
body.ex-cart.csw-on table.items-list tr.item_148061607[class] > td.name::after {
content: "Everything arrives together in one delivery once all items are ready, and we\\2019ll plant a tree on your behalf.";
display: block; max-width: 62ch; margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--csw-text-body);
}
/* "Free" tag on the right. Grid-only: in a real table row ::after would become a stray cell. */
table.items-list[data-csw-grid] tr.item_148061607[class]::after {
content: "Free"; grid-row: 1; justify-self: end; align-self: center; padding: 4px 11px; border: 1px solid #cdead4;
border-radius: 999px; background: #fff; color: var(--csw-green); font-size: 12px; font-weight: 700;
letter-spacing: 0.05em; text-transform: uppercase;
}
.desktop table.items-list[data-csw-grid][data-csw-tuned] tbody > tr.item_148061607[class] > td.name { grid-column: 2 / -3 !important; }
.desktop table.items-list[data-csw-grid][data-csw-tuned] tbody > tr.item_148061607[class]::after { grid-column: -3 / -1; margin-right: 16px; }
.mobile table.items-list[data-csw-grid] tbody > tr.item_148061607[class] > td.name { grid-column: 2 / -2 !important; }
.mobile table.items-list[data-csw-grid] tbody > tr.item_148061607[class]::after { grid-column: -2 / -1; margin-right: 12px; }
/* ============ CONSOLIDATED DELIVERY BOX (marker line + dated bands, when "together" is chosen) ============
One frame round the marker line, the dated bands and their lines; Contact Us follows outside it. Vue owns the
rows, so they can't be wrapped: each row draws its part of the frame (sides; "first" the top, "last" the bottom)
and keeps a 12 px inset inside it. After the marker-line rules on purpose: same specificity, so these win. */
body.ex-cart.csw-on { --csw-frame: #465f4e; --csw-frame-gap: 12px; }
body.ex-cart.csw-on table.items-list[data-csw-consol-on] tr[data-csw-consol] {
margin: 0 !important;
padding-left: var(--csw-frame-gap) !important;
padding-right: var(--csw-frame-gap) !important;
border: 0 !important;
border-left: 3px solid var(--csw-frame) !important;
border-right: 3px solid var(--csw-frame) !important;
border-radius: 0 !important;
}
body.ex-cart.csw-on table.items-list[data-csw-consol-on] tr[data-csw-consol="first"] {
border-top: 3px solid var(--csw-frame) !important;
border-radius: 8px 8px 0 0 !important;
}
body.ex-cart.csw-on table.items-list[data-csw-consol-on] tr[data-csw-consol="last"] {
border-bottom: 3px solid var(--csw-frame) !important;
border-radius: 0 0 8px 8px !important;
}
/* The hairline between lines stops at the inset, like the content */
body.ex-cart.csw-on table.items-list[data-csw-consol-on] tr[data-csw-consol="mid"]:not(.csw-band) {
background: linear-gradient(var(--csw-hairline), var(--csw-hairline)) center bottom / calc(100% - 2 * var(--csw-frame-gap)) 1px no-repeat !important;
}
/* Band headers inside: 12 px gap above, accent bar on the left; "fast" in the frame colour */
body.ex-cart.csw-on table.items-list[data-csw-consol-on] tr.csw-band[data-csw-consol] { padding-top: var(--csw-frame-gap) !important; /*! border-top: 0 !important; */}
body.ex-cart.csw-on table.items-list[data-csw-consol-on] tr.csw-band[data-csw-consol][data-csw-tier="fast"] {
--csw-band-accent: var(--csw-frame); --csw-band-fg: var(--csw-frame);
}
/* The marker line: its own tinted box inside the frame (a ::before behind the cells, so the row can keep the frame) */
body.ex-cart.csw-on table.items-list[data-csw-consol-on] tr.item_148061607[data-csw-consol] {
padding-top: calc(var(--csw-frame-gap) + 14px) !important;
padding-bottom: 14px !important;
background: none !important;
}
table.items-list[data-csw-grid][data-csw-consol-on] tr.item_148061607[data-csw-consol]::before {
content: ""; grid-column: 1 / -1; grid-row: 1; align-self: stretch; margin: -14px 0;
border-radius: 6px; background: var(--csw-green-tint);
}
/* Desktop rows share the table's columns, so the inset comes out of the first and last ones: tighter cell padding there */
.desktop table.items-list[data-csw-grid][data-csw-tuned][data-csw-consol-on]:not([data-csw-compact]) tbody > tr[data-csw-consol]:not(.csw-band) > td.thumb { padding-left: 2px !important; }
.desktop table.items-list[data-csw-grid][data-csw-tuned][data-csw-consol-on]:not([data-csw-compact]) tbody > tr[data-csw-consol]:not(.csw-band) > td.delete { padding-right: 2px !important; }
.desktop table.items-list[data-csw-grid][data-csw-tuned][data-csw-consol-on]:not([data-csw-compact]) tbody > tr.item_148061607[data-csw-consol] > td.thumb { padding-left: 12px !important; }
.desktop table.items-list[data-csw-grid][data-csw-tuned][data-csw-consol-on]:not([data-csw-compact]) tbody > tr.item_148061607[data-csw-consol] > td.thumb .thumb-wrapper { width: 74px; height: 74px; }
.desktop table.items-list[data-csw-grid][data-csw-tuned][data-csw-consol-on][data-csw-compact] tbody > tr[data-csw-consol]:not(.csw-band) > td.thumb .thumb-wrapper { width: 58px; height: 58px; }
/* Mobile: thumb off the box edge; the Free tag drops under the text so the text keeps its width */
.mobile table.items-list[data-csw-grid][data-csw-consol-on] tbody > tr.item_148061607[data-csw-consol] > td.thumb { margin-left: 12px; }
.mobile table.items-list[data-csw-grid][data-csw-consol-on] tbody > tr.item_148061607[data-csw-consol] > td.name { grid-column: 2 / -1 !important; padding-right: 12px !important; }
.mobile table.items-list[data-csw-grid][data-csw-consol-on] tbody > tr.item_148061607[data-csw-consol]::after { grid-column: 2 / -1; grid-row: 2; justify-self: start; margin: 0; }
.mobile table.items-list[data-csw-grid][data-csw-consol-on] tbody > tr.item_148061607[data-csw-consol]::before { grid-row: 1 / span 2; }
/* ================= BUSY (adding/removing the marker line) ================= */
.shopping-cart[data-csw-busy] { opacity: 0.55; transition: opacity 0.15s; }
/* Progress card in , outside the dimmed/inert cart. Desktop: sticky inside the cart's area.
Mobile: fixed to the middle of the screen. */
.csw-busy-overlay { position: absolute; z-index: 1000; pointer-events: none; }
.csw-busy-card {
position: sticky; top: calc(50vh - 40px); width: max-content; max-width: calc(100% - 32px); margin: 40px auto 0;
display: flex; align-items: center; gap: 14px; padding: 16px 22px; background: #fff; border: 1px solid #cdead4;
border-radius: 10px; box-shadow: 0 8px 28px rgba(31, 58, 40, 0.16); color: var(--csw-blue); font-size: 14px; line-height: 1.4;
}
.csw-busy-title { font-weight: 700; }
.csw-busy-sub { font-size: 12.5px; color: var(--csw-text-muted); }
.csw-spinner {
flex: none; width: 26px; height: 26px; box-sizing: border-box; border: 3px solid var(--csw-green-tint);
border-top-color: var(--csw-green); border-radius: 50%; animation: csw-spin 0.8s linear infinite;
}
@keyframes csw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
.csw-spinner { animation-duration: 2.4s; }
.csw-delivery-radio { transition: none; }
}
@media (max-width: 768px) {
.csw-busy-card { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; }
}
a.to-checkout.csw-checkout-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
body.ex-cart.csw-on .shopping-cart .cart-resume { float: unset; }
/* ==========================================================================
* SEARCH ALTERNATIVES POPOVER (body.ex-cart) — anchored on desktop, a bottom sheet under 768 px
* ========================================================================== */
.csw-alt-pop{display:none;position:fixed;margin:0;inset:auto;z-index:100000;box-sizing:border-box;background:#fff;color:#2b2e33;border:1px solid #e4e6ea;border-radius:10px;box-shadow:0 14px 36px rgba(20,30,50,.18);padding:0;max-height:min(560px,calc(100vh - 24px));overflow:auto;font-size:14px;line-height:1.45;text-align:left}
.csw-alt-pop:popover-open{display:block}
.csw-alt-pop *{box-sizing:border-box}
.csw-alt-pop [hidden]{display:none!important}
.csw-alt-pop.is-sheet{left:0!important;right:0;top:auto!important;bottom:0;width:100%!important;max-height:80vh;border-radius:14px 14px 0 0;padding-bottom:env(safe-area-inset-bottom,0px)}
.csw-alt-h{display:flex;align-items:center;gap:8px;padding:10px 10px 10px 14px;border-bottom:1px solid #e4e6ea;position:sticky;top:0;background:#fff;z-index:1}
.csw-alt-h span{font-size:12.5px;color:#8b9098;margin-right:auto}.csw-alt-h b{color:#2b2e33;font-weight:600}
.csw-alt-x{border:0;background:transparent;width:32px;height:32px;border-radius:6px;display:grid;place-items:center;color:#8b9098;cursor:pointer;padding:0;flex:none}
.csw-alt-x:hover{background:#f4f5f7;color:#2b2e33}.csw-alt-x svg{width:14px;height:14px}
.csw-alt-b{padding:0 14px}
.csw-alt-steps{list-style:none;margin:0;padding:14px 0;display:flex;flex-direction:column;gap:9px}
.csw-alt-step{display:flex;flex-wrap:wrap;align-items:center;gap:9px;font-size:13px;color:#8b9098;margin:0;padding:0}
.csw-alt-bar{flex-basis:100%;height:4px;margin:-3px 0 0 27px;background:#eceef1;border-radius:2px;overflow:hidden;display:none}
.csw-alt-step.is-active .csw-alt-bar,.csw-alt-step.is-done .csw-alt-bar{display:block}
.csw-alt-bar i{display:block;height:100%;width:0;border-radius:2px;background:#ef7d1d;transition:width .5s ease}
.csw-alt-step.is-active .csw-alt-bar i{background:repeating-linear-gradient(45deg,#ef7d1d 0 8px,#f5a05a 8px 16px);background-size:23px 100%;animation:csw-alt-stripes 1s linear infinite}
.csw-alt-step.is-done .csw-alt-bar i{background:#4ea35a}
@keyframes csw-alt-stripes{to{background-position:23px 0}}
.csw-alt-ind{width:18px;height:18px;border-radius:50%;border:2px solid #e4e6ea;display:grid;place-items:center;flex:none}
.csw-alt-ind svg{width:10px;height:10px;display:none}
.csw-alt-step.is-active{color:#2b2e33}.csw-alt-step.is-active .csw-alt-ind{border-color:#ef7d1d;border-right-color:transparent;animation:csw-alt-spin .8s linear infinite}
.csw-alt-step.is-done{color:#2b2e33}.csw-alt-step.is-done .csw-alt-ind{border-color:#4ea35a;background:#4ea35a;animation:none}.csw-alt-step.is-done .csw-alt-ind svg{display:block;color:#fff}
.csw-alt-row{display:flex;flex-direction:column;gap:8px;padding:12px 0;border-top:1px solid #e4e6ea}
.csw-alt-list>.csw-alt-row:first-child{border-top:0}
.csw-alt-top{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:10px;align-items:start}
.csw-alt-thumb{width:48px;height:48px;border-radius:6px;background:#f4f5f7;display:grid;place-items:center;overflow:hidden}
.csw-alt-thumb img{width:100%;height:100%;object-fit:contain;display:block}
.csw-alt-title{color:#2f3b70;font-size:13px;line-height:1.3;font-weight:500;margin:0 0 2px;text-decoration:none;display:block}
a.csw-alt-title:hover{text-decoration:underline}
.csw-alt-code{color:#8b9098;font-size:11.5px;letter-spacing:.02em}
.csw-alt-price{color:#ef7d1d;font-weight:700;font-size:16px;white-space:nowrap}
.csw-alt-bot{display:flex;align-items:stretch;gap:6px}
.csw-alt-card{flex:1;min-width:0;display:flex}
.csw-alt-buy{display:flex;gap:6px}
.csw-alt-qty{display:grid;grid-template-columns:22px 1fr 22px;align-items:center;height:36px;width:70px;border:1px solid #e4e6ea;border-radius:6px;background:#fff;overflow:hidden}
.csw-alt-qty button{border:0;background:transparent;height:100%;padding:0;margin:0;color:#2f3b70;font-size:15px;line-height:1;cursor:pointer}
.csw-alt-qty input{width:100%;min-width:0;height:100%;border:0;margin:0;padding:0;text-align:center;background:transparent;font-weight:600;font-size:13px;color:#2b2e33;-moz-appearance:textfield}
.csw-alt-qty input::-webkit-outer-spin-button,.csw-alt-qty input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.csw-alt-add{width:44px;height:36px;flex:none;border:0;border-radius:6px;background:#ef7d1d;color:#fff;display:grid;place-items:center;cursor:pointer;padding:0;margin:0;transition:background .15s}
.csw-alt-add:hover{background:#d86c10}.csw-alt-add svg{width:22px;height:20px}
.csw-alt-add-lbl{display:none}
.csw-alt-swap{flex:1;min-width:84px;height:36px;display:flex;align-items:center;justify-content:center;gap:7px;padding:0 12px;border:0;border-radius:6px;background:#ef7d1d;color:#fff;font:inherit;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;cursor:pointer}
.csw-alt-swap:hover{background:#d86c10}.csw-alt-swap svg{width:18px;height:18px;flex:none}
.csw-alt-swap.is-done{background:#4ea35a}.csw-alt-swap.is-error{background:#c0392b}.csw-alt-swap:disabled{opacity:.6;cursor:not-allowed}
.csw-alt-buy .csw-alt-add--secondary{flex:none;width:44px;background:#fff;color:#ef7d1d;border:1px solid #ef7d1d}
.csw-alt-buy .csw-alt-add--secondary:hover{background:#ef7d1d;color:#fff}
.csw-alt-buy .csw-alt-add--secondary .csw-alt-add-lbl{display:none}
.csw-alt-note{margin:0;padding:8px 10px;border-radius:6px;background:#fcefe3;color:#b5570f;font-size:12px;line-height:1.4}
@media (min-width:1024px){
.csw-alt-pop:not(.is-sheet){max-height:min(700px,calc(100vh - 24px))}
.csw-alt-h{padding-left:20px}.csw-alt-b{padding:0 20px}
.csw-alt-list{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px 0} /* space below too: the next line's border never touches the cards */
.csw-alt-list:empty{padding:0}
.csw-alt-row,.csw-alt-list>.csw-alt-row:first-child{gap:10px;padding:12px;border:1px solid #e4e6ea;border-radius:8px}
.csw-alt-title{font-size:12.5px}
.csw-alt-bot{flex-wrap:wrap}
.csw-alt-card{flex-basis:100%}
.csw-alt-buy{flex:1}
.csw-alt-add{flex:1;width:auto;display:flex;align-items:center;justify-content:center;gap:8px}
.csw-alt-add svg{width:20px;height:18px}
.csw-alt-add-lbl{display:inline;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.csw-alt-more{margin-top:0}
}
/* The delivery card itself comes from the core styles; in the popover it's a slim strip */
.csw-alt-pop .csw-delivery--strip{flex:1;flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:10px;row-gap:2px;min-height:36px;padding:5px 10px;box-sizing:border-box}
.csw-alt-pop .csw-delivery--strip .csw-dl-label{padding:0;gap:7px;font-size:10.5px;letter-spacing:.07em;white-space:nowrap}
.csw-alt-pop .csw-delivery--strip .csw-stock-list{display:flex;align-items:center;gap:10px;padding:0;font-size:11.5px}
.csw-alt-pop .csw-delivery--strip .csw-stock-list::before{width:1px;height:16px;margin:0}
.csw-alt-pop .csw-delivery--strip .csw-stock-row{display:flex;align-items:center;gap:5px;padding:0}
.csw-alt-add.is-done{background:#4ea35a}.csw-alt-add.is-error{background:#c0392b}
.csw-alt-add:disabled{background:#c9cdd2;cursor:not-allowed}
.csw-alt-more{width:100%;height:36px;margin:4px 0 10px;border:1px solid #ef7d1d;border-radius:6px;background:#fff;color:#ef7d1d;font-weight:700;font-size:11px;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 12px;font-family:inherit}
.csw-alt-more:hover{background:#ef7d1d;color:#fff}.csw-alt-more:disabled{color:#8b9098;border-color:#e4e6ea;cursor:progress}
.csw-alt-foot{font-size:12px;color:#8b9098;padding:10px 0 12px;border-top:1px solid #e4e6ea;display:flex;align-items:center;gap:8px}
.csw-alt-empty{font-size:13px;color:#2b2e33;padding:18px 0 14px;margin:0}
.csw-alt-cat{margin:0;padding:10px 0 12px;border-top:1px solid #e4e6ea;font-size:12.5px;color:#4b5661}
.csw-alt-cat a{color:#ef7d1d;font-weight:600;text-decoration:none}.csw-alt-cat a:hover{text-decoration:underline}
.csw-alt-cat.is-cta{border-top:0;padding:0 0 16px}
.csw-alt-cat .csw-alt-cat-btn{display:flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:6px 14px;box-sizing:border-box;border:1px solid #ef7d1d;border-radius:6px;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;text-align:center}
.csw-alt-cat .csw-alt-cat-btn:hover{background:#ef7d1d;color:#fff;text-decoration:none}
.csw-alt-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.csw-alt-spin{width:13px;height:13px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;display:inline-block;animation:csw-alt-spin .7s linear infinite;flex:none}
.csw-alt-pop :focus-visible{outline:2px solid #ef7d1d;outline-offset:2px}
@keyframes csw-alt-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.csw-alt-pop *{animation-duration:.001s!important}}
/* ==========================================================================
* PRODUCT-GRID TILES (.csw-tile, added by the script on PAGES.gridTiles)
* name
* £21.99 ..................... COPYA4NOR
* ┌ delivery card ┐ [ − 1 + ]
* │ │ [ basket ]
* The store's input, Add button and addcart() stay where they are; this lays them out.
* ========================================================================== */
.csw-tile.tileparent {
border-top: 0;
}
.csw-tile .tile {
padding: 0;
border: 1px solid #eee !important;
border-radius: 10px;
overflow: hidden;
}
.csw-tile .tile .footer {
padding: 0 15px 15px;
}
/* Badges: one tab shape for every ribbon, stacked in the image's top-left corner (grid tiles and the product page).
* The store's ribbon colours (inline background/colour on .ribbon) are kept; its folded ends are hidden. */
.csw-tile .tile { position: relative; }
:is(.csw-tile, body.ex-product.csw-pdp .productimage_container) .badges-wrapper {
position: absolute !important;
top: 0 !important;
left: 0 !important;
z-index: 2;
display: flex !important;
flex-direction: column;
align-items: flex-start;
gap: 4px;
width: auto !important;
height: auto !important;
margin: 0 !important;
padding: 0 !important;
}
:is(.csw-tile, body.ex-product.csw-pdp .productimage_container) .badges-wrapper .ribbon-wrapper {
position: static !important;
display: block !important;
width: auto !important;
height: auto !important;
margin: 0 !important;
padding: 0 !important;
transform: none !important;
}
:is(.csw-tile, body.ex-product.csw-pdp .productimage_container) .badges-wrapper :is(.ribbon-side, .ribbon-tips) { display: none !important; }
:is(.csw-tile, body.ex-product.csw-pdp .productimage_container) .badges-wrapper .ribbon {
position: static !important;
display: flex !important;
align-items: center;
width: auto !important;
max-width: 100%;
height: 36px !important;
margin: 0 !important;
padding: 0 16px 0 14px !important;
border: 0 !important;
border-radius: 10px 0 10px 0 !important;
box-shadow: none !important;
transform: none !important;
font-size: 13px !important;
font-weight: 700 !important;
line-height: 1 !important;
letter-spacing: -0.01em;
text-transform: none;
white-space: nowrap;
}
:is(.csw-tile, body.ex-product.csw-pdp .productimage_container) .badges-wrapper .ribbon span {
position: static !important;
display: inline !important;
padding: 0 !important;
font: inherit !important;
color: inherit !important;
}
/* image badges (e.g. eco aware, if it's a picture): same height and corners */
:is(.csw-tile, body.ex-product.csw-pdp .productimage_container) .badges-wrapper img {
display: block;
width: auto !important;
height: 36px !important;
border-radius: 14px 0 14px 0;
}
.csw-tile .footer-wrapper,
.csw-tile .footer-wrapper-description,
.csw-tile .buttons.group { height: auto !important; }
.csw-tile :is(.brand-label, .indicators-grid, .product-category, .product-points, .uom, .multiple-uom, .multiple-uom-label,
.price-label-inc-vat, .product-sku, .product-stock-wrap, .live-inventory-v2-wrapper, .addtoquicklist-wrapper,
.product-compare-action) { display: none !important; }
.csw-tile .product-name a { color: var(--csw-blue); font-size: 14px; font-weight: 400; line-height: 1.4; text-decoration: none; }
.csw-tile .product-name a:hover { text-decoration: underline; }
/* price on the left, product code on the right */
.csw-tile .footer-wrapper-price {
display: flex !important;
align-items: baseline;
justify-content: space-between;
width: 100%;
}
.csw-tile .footer-wrapper-price .price-label { float: none !important; width: auto !important; margin: 0 !important; font-size: 20px; font-weight: 700; color: var(--csw-orange); }
.csw-tile-code { margin-left: auto; font-size: 11px; color: var(--csw-text-muted); letter-spacing: 0.02em; white-space: nowrap; }
/* card on the left (both rows); stepper, then the Add button, on the right */
.csw-tile .buttons.group {
display: grid !important;
grid-template-columns: minmax(0, 1fr) 28px minmax(28px, 40px) 28px;
grid-template-rows: 36px minmax(44px, auto);
align-items: stretch;
padding: 12px 0 0;
border-top: 1px solid var(--csw-hairline);
text-align: left !important;
margin-top: 0;
}
.csw-tile .buttons.group > .csw-delivery { grid-column: 1; grid-row: 1 / 3; margin-right: 10px; }
.csw-tile .buttons.group > :is(script, .addtoquicklist-wrapper) { display: none !important; }
.csw-tile .buttons.group > .csw-tile-step--dec { grid-column: 2; grid-row: 1; }
.csw-tile .buttons.group > :is(.qty-list, .inputquantity) {
grid-column: 3; grid-row: 1; width: 100% !important; height: 36px !important; min-width: 0; margin: 0 !important; padding: 0 !important;
border: 1px solid var(--csw-hairline) !important; border-left: 0 !important; border-right: 0 !important; border-radius: 0 !important;
box-shadow: none !important; background: #fff !important; text-align: center; font-size: 14px; font-weight: 600; color: var(--csw-blue);
}
.csw-tile .buttons.group > .csw-tile-step--inc { grid-column: 4; grid-row: 1; }
.csw-tile-step {
display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; background: #fff;
border: 1px solid var(--csw-hairline); color: var(--csw-blue); font-size: 16px; line-height: 1; cursor: pointer;
}
.csw-tile-step--dec { border-right: 0; border-radius: 6px 0 0 0; }
.csw-tile-step--inc { border-left: 0; border-radius: 0 6px 0 0; }
.csw-tile-step:hover { background: var(--csw-surface-muted); }
/* The store's Add button fills the column under the stepper, whatever widths the theme gives it or its wrapper */
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper {
grid-column: 2 / 5; grid-row: 2; position: relative; display: flex !important;
width: auto !important; max-width: none !important; min-width: 0 !important; float: none !important; margin: 0 !important; padding: 0 !important;
}
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper .btn-add-to-cart {
flex: 1 1 auto !important; display: block !important; float: none !important; width: 100% !important; max-width: none !important;
height: auto !important; min-height: 44px; margin: 0 !important; padding: 0 !important;
border: 0 !important; border-radius: 0 0 6px 6px !important; background: var(--csw-orange) !important; box-shadow: none !important;
font-size: 0 !important; line-height: 0 !important; color: transparent !important; /* the store's text stays: accessible name, Adding/Added states */
}
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper .btn-add-to-cart::before,
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper .btn-add-to-cart::after,
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper .btn-add-to-cart > i { display: none !important; } /* the theme's own icons */
/* the basket icon sits on the wrapper, over the button, so theme button rules can't hide it; clicks pass through */
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper::after {
content: ""; position: absolute; inset: 0; margin: auto; width: 24px; height: 22px; background-color: #fff; pointer-events: none;
-webkit-mask: var(--csw-icon-basket) center / contain no-repeat; mask: var(--csw-icon-basket) center / contain no-repeat;
}
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper .btn-add-to-cart:hover { background: #d86c10 !important; }
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper .btn-add-to-cart:is(:disabled, .disabled) { opacity: 1; cursor: progress; }
/* still waiting for prices and stock (disabled, not adding): the basket icon stays, faded */
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper[data-csw-wait] { opacity: 0.55; }
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper[data-csw-wait] .btn-add-to-cart { cursor: not-allowed; }
/* The store's own states ("Adding" with a spinner, "Added"): the script marks the wrapper data-csw-state while the
button isn't at rest; the store's text and icon show instead of the basket */
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper[data-csw-state]::after { display: none; }
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper[data-csw-state] .btn-add-to-cart {
display: flex !important; align-items: center; justify-content: center; gap: 6px;
font-size: 12px !important; line-height: 1.2 !important; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
color: #fff !important;
}
.csw-tile .buttons.group > .live-inventory-v2-add-to-cart-wrapper[data-csw-state] .btn-add-to-cart > i { display: inline-block !important; }
/* Contact us: the Search alternatives button inside the card */
/* Configurable products: the store's Configure button where the stepper and basket go (it opens the product page) */
.csw-tile[data-csw-mode="configure"] .buttons.group > .btn-list.is-master {
grid-column: 2 / 5 !important; grid-row: 1 / 3 !important; display: flex !important; box-sizing: border-box;
max-width: none !important; min-width: 0 !important; text-indent: 0 !important; overflow: hidden; align-items: center; justify-content: center;
width: 100% !important; height: auto !important; min-height: 80px; margin: 0 !important; padding: 0 8px !important; float: none !important;
border: 0 !important; border-radius: 6px !important; background: var(--csw-orange) !important; box-shadow: none !important;
color: #fff !important; font-size: 11px !important; font-weight: 700; line-height: 1.25; letter-spacing: 0.06em; text-transform: uppercase; white-space: normal;
}
.csw-tile[data-csw-mode="configure"] .buttons.group > .btn-list.is-master > span { color: inherit !important; font: inherit !important; }
.csw-tile[data-csw-mode="configure"] .buttons.group > .btn-list.is-master:hover { background: #d86c10 !important; }
/* no lead time on a configurable product: no card, the button takes the row */
.csw-tile[data-csw-mode="configure"][data-csw-card="0"] .buttons.group > .btn-list.is-master { grid-column: 1 / -1 !important; min-height: 44px; }
/* Call for price (no quantity box, no basket): the store's notice in their place */
.csw-tile[data-csw-mode="other"] .buttons.group > .price-call {
grid-column: 2 / 5 !important; grid-row: 1 / 3 !important; display: flex !important; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px;
box-sizing: border-box; width: auto !important; min-width: 0; overflow: hidden; float: none !important;
margin: 0 !important; padding: 6px !important; border: 1px solid var(--csw-hairline) !important; border-radius: 6px; background: #fff !important;
color: var(--csw-blue) !important; font-size: 11px !important; font-weight: 700; line-height: 1.25 !important; letter-spacing: 0.04em;
text-align: center; text-transform: uppercase; white-space: normal !important;
}
.csw-tile[data-csw-mode="other"] .buttons.group > .price-call :is(span, i) { font-size: inherit !important; line-height: inherit !important; color: inherit !important; }
/* ---------- Slim tiles: nothing under the lead time, or no card ([data-csw-slim="1"]) ----------
configurable: [ 3-5 DAYS ............ ][ CONFIGURE ] (no card: [ CONFIGURE ] across)
buyable: [ 3-5 DAYS ................................ ]
[ − 1 + ][ basket ] */
.csw-tile .buttons.group > .csw-delivery.csw-delivery--strip {
flex-direction: row; align-items: center; height: 36px; min-height: 0; padding: 0 10px; box-sizing: border-box; margin-right: 0;
}
.csw-tile .buttons.group > .csw-delivery--strip .csw-dl-status { flex-direction: row; }
.csw-tile .buttons.group > .csw-delivery--strip .csw-dl-label { padding: 0; gap: 7px; white-space: nowrap; }
.csw-tile[data-csw-mode="configure"][data-csw-slim="1"] .buttons.group {
grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 36px; column-gap: 6px; row-gap: 0; /* the button takes what its label needs */
}
.csw-tile[data-csw-mode="configure"][data-csw-slim="1"] .buttons.group > .csw-delivery { grid-column: 1; grid-row: 1; }
.csw-tile[data-csw-mode="configure"][data-csw-slim="1"] .buttons.group > .btn-list.is-master {
grid-column: 2 !important; grid-row: 1 !important; height: 36px !important; min-height: 0; text-align: center !important;
padding: 0 16px !important; white-space: nowrap !important;
}
.csw-tile[data-csw-mode="configure"][data-csw-slim="1"] .buttons.group > .csw-delivery--strip .csw-dl-label { overflow: hidden; text-overflow: ellipsis; }
.csw-tile[data-csw-mode="configure"][data-csw-slim="1"][data-csw-card="0"] .buttons.group > .btn-list.is-master { grid-column: 1 / -1 !important; }
.csw-tile[data-csw-mode="configure"] .buttons.group > .btn-list.is-master {
justify-content: center !important; gap: 8px; text-align: center !important; line-height: 1 !important;
}
.csw-tile[data-csw-mode="configure"] .buttons.group > .btn-list.is-master > span {
display: inline !important; flex: none !important; width: auto !important; margin: 0 !important; padding: 0 !important;
float: none !important; text-align: center !important;
}
.csw-tile[data-csw-mode="configure"] .buttons.group > .btn-list.is-master::before {
content: ""; flex: none; width: 16px; height: 16px; background-color: currentColor;
-webkit-mask: var(--csw-icon-configure) center / contain no-repeat; mask: var(--csw-icon-configure) center / contain no-repeat;
}
.csw-tile[data-csw-mode="configure"] .buttons.group > .btn-list.is-master > i { display: none !important; }
.csw-tile[data-csw-mode="buy"][data-csw-slim="1"] .buttons.group {
grid-template-columns: 28px minmax(28px, 1fr) 28px 72px; grid-template-rows: 36px 36px; column-gap: 0; row-gap: 6px;
}
.csw-tile[data-csw-mode="buy"][data-csw-slim="1"] .buttons.group > .csw-delivery { grid-column: 1 / -1; grid-row: 1; }
.csw-tile[data-csw-mode="buy"][data-csw-slim="1"] .buttons.group > .csw-tile-step--dec { grid-column: 1; grid-row: 2; border-radius: 6px 0 0 6px; }
.csw-tile[data-csw-mode="buy"][data-csw-slim="1"] .buttons.group > :is(.qty-list, .inputquantity) { grid-column: 2; grid-row: 2; }
.csw-tile[data-csw-mode="buy"][data-csw-slim="1"] .buttons.group > .csw-tile-step--inc { grid-column: 3; grid-row: 2; border-radius: 0 6px 6px 0; }
.csw-tile[data-csw-mode="buy"][data-csw-slim="1"] .buttons.group > .live-inventory-v2-add-to-cart-wrapper { grid-column: 4; grid-row: 2; margin-left: 6px !important; }
.csw-tile[data-csw-mode="buy"][data-csw-slim="1"] .buttons.group > .live-inventory-v2-add-to-cart-wrapper .btn-add-to-cart { min-height: 36px; border-radius: 6px !important; }
:is(.csw-tile, .csw-pdp-buy) .csw-delivery a.csw-alt-link {
display: block;
margin: 0 10px 10px;
padding: 5px 8px;
border: 1px solid var(--csw-orange);
border-radius: 6px;
background: #fff;
color: var(--csw-orange);
font-size: 11px;
font-weight: 700;
line-height: 1.25;
letter-spacing: 0.06em;
text-align: center;
text-transform: uppercase;
text-decoration: none;
white-space: wrap;
}
:is(.csw-tile, .csw-pdp-buy) .csw-delivery a.csw-alt-link:hover,
:is(.csw-tile, .csw-pdp-buy) .csw-delivery a.csw-alt-link:focus-visible { background: var(--csw-orange); color: #fff; }
/* 0 stock with a known lead time: a full-width Search alternatives button under the card and the basket */
.csw-tile .buttons.group > a.csw-alt-link.csw-alt-link--below {
grid-column: 1 / -1; grid-row: 3; display: flex !important; align-items: center; justify-content: center;
height: 36px; margin: 8px 0 0 !important; padding: 0 10px !important; box-sizing: border-box;
border: 1px solid var(--csw-orange) !important; border-radius: 6px !important; background: #fff !important; box-shadow: none !important;
color: var(--csw-orange) !important; font-size: 11px !important; font-weight: 700 !important; line-height: 1 !important;
letter-spacing: 0.06em !important; text-transform: uppercase; text-decoration: none !important; white-space: nowrap;
}
.csw-tile .buttons.group > a.csw-alt-link.csw-alt-link--below:hover,
.csw-tile .buttons.group > a.csw-alt-link.csw-alt-link--below:focus-visible { background: var(--csw-orange) !important; color: #fff !important; }
/* ==========================================================================
* PRODUCT PAGE (body.ex-product) — the store's own markup, laid out like the PDP mockup:
* breadcrumb
* [ image ][ title, code, category, points ][ buy box ] ≥1200 px
* [ image ][ title … / buy box under it ] 768–1199 px
* one column <768 px
* [ description ][ specifications ]
* The store's columns (col-lg-10 > row > image + summary, col-lg-2 filter-container) are flattened into one grid with
* display: contents; nothing is moved.
*
* The main image comes two ways, both in the same square frame (.main-image):
* one picture .main-image > .row > .col-md-12 > .magnify > img.productimagesolo — centred
* gallery .main-image > .prod-gal (MasterSlider: slides + .ms-thumb-list) — with 2+ slides the thumbnails
* sit over the frame's bottom-left and the picture keeps clear of them; a 1-slide gallery looks like
* one picture. MasterSlider still sizes its own view and slides; only the pictures inside are fitted.
* Pictures are fitted with max-width / max-height (container units), never stretched, so jQuery Magnify's lens
* (which works on the box) still lines up.
* ========================================================================== */
body.ex-product.csw-pdp {
--csw-icon-zoom: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Ccircle%20cx=%2711%27%20cy=%2711%27%20r=%277%27/%3E%3Cpath%20d=%27m21%2021-4.3-4.3M11%208v6M8%2011h6%27/%3E%3C/svg%3E");
--csw-icon-check-white: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27white%27%20stroke-width=%273.2%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M6%2012.5l4%204L18%208%27/%3E%3C/svg%3E");
--csw-pdp-shadow: 0 2px 8px rgba(27, 66, 87, 0.14);
}
/* ---------- Layout ---------- */
body.ex-product.csw-pdp .mainproductpagedesktop > .row {
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-areas: "bc" "pre" "img" "info" "buy" "post";
margin: 0;
}
body.ex-product.csw-pdp .mainproductpagedesktop > .row::before,
body.ex-product.csw-pdp .mainproductpagedesktop > .row::after,
body.ex-product.csw-pdp .mainproductpagedesktop > .details-wrap > .row::before,
body.ex-product.csw-pdp .mainproductpagedesktop > .details-wrap > .row::after { display: none; }
body.ex-product.csw-pdp .mainproductpagedesktop > .row > .col-lg-10,
body.ex-product.csw-pdp .mainproductpagedesktop > .row > .col-lg-10 > .row:has(> .productimage_container) { display: contents; }
body.ex-product.csw-pdp .mainproductpagedesktop > .row > :is(.row-breadcrumb, .filter-container),
body.ex-product.csw-pdp :is(.productimage_container, .productsummary_container) {
float: none; width: auto; min-width: 0; padding: 0;
}
body.ex-product.csw-pdp .mainproductpagedesktop > .row > .row-breadcrumb { grid-area: bc; }
body.ex-product.csw-pdp .mainproductpagedesktop > .row > .col-lg-10 > .row:has(~ .row > .productimage_container) { grid-area: pre; margin: 0; }
body.ex-product.csw-pdp .mainproductpagedesktop > .row > .col-lg-10 > .row:has(> .productimage_container) ~ .row { grid-area: post; margin: 0; }
body.ex-product.csw-pdp .productimage_container { grid-area: img; align-self: start; width: 100%; max-width: 460px; }
body.ex-product.csw-pdp .productsummary_container { grid-area: info; margin-top: 24px; }
body.ex-product.csw-pdp .mainproductpagedesktop > .row > .filter-container { grid-area: buy; margin-top: 24px; }
@media (min-width: 768px) {
body.ex-product.csw-pdp .mainproductpagedesktop > .row {
grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
grid-template-areas: "bc bc" "pre pre" "img info" "img buy" "post post";
column-gap: 32px;
}
body.ex-product.csw-pdp .productsummary_container { margin-top: 0; }
body.ex-product.csw-pdp .mainproductpagedesktop > .row > .filter-container { margin-top: 32px; }
}
@media (min-width: 1200px) {
body.ex-product.csw-pdp .mainproductpagedesktop > .row {
grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr) 340px;
grid-template-areas: "bc bc bc" "pre pre pre" "img info buy" "post post post";
column-gap: 40px;
}
body.ex-product.csw-pdp .mainproductpagedesktop > .row > .filter-container { margin-top: 0; }
}
/* ---------- Breadcrumb ---------- */
body.ex-product.csw-pdp .row-breadcrumb .breadcrumb {
display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0;
margin: 0 0 24px; padding: 0; background: none; font-size: 12px;
}
body.ex-product.csw-pdp .row-breadcrumb .breadcrumb > li + li::before { content: "›"; padding: 0 8px; color: var(--csw-text-muted); font-size: 14px; }
body.ex-product.csw-pdp .row-breadcrumb .breadcrumb a { color: var(--csw-text-muted); text-decoration: none; white-space: nowrap; }
body.ex-product.csw-pdp .row-breadcrumb .breadcrumb > li.breadcrumb_home a { color: var(--csw-blue); }
body.ex-product.csw-pdp .row-breadcrumb .breadcrumb > li:last-child a { color: var(--csw-blue); font-weight: 600; }
body.ex-product.csw-pdp .row-breadcrumb .breadcrumb a:hover { color: var(--csw-blue); text-decoration: underline; }
/* ---------- Main image: the frame ---------- */
body.ex-product.csw-pdp .productimage_container > div:has(> .main-image) { position: relative; } /* badges sit on its corner */
body.ex-product.csw-pdp .productimage_container .main-image {
position: relative;
aspect-ratio: 1 / 1;
container-type: size;
border: 1px solid #f4f5f5;
border-radius: 10px;
overflow: hidden;
background: #fff;
}
body.ex-product.csw-pdp .productimage_container .product-brand { display: none; } /* the brand is in the details; no logo under the picture */
body.ex-product.csw-pdp .productimage_container .icons-block { float: none; width: auto; margin-top: 12px; padding: 0; }
/* one picture */
body.ex-product.csw-pdp .main-image > .row { height: 100%; margin: 0; }
body.ex-product.csw-pdp .main-image > .row::before,
body.ex-product.csw-pdp .main-image > .row::after { display: none; }
body.ex-product.csw-pdp .main-image > .row > [class*="col-"] {
position: static; float: none; width: 100%; height: 100%;
display: flex; align-items: center; justify-content: center;
padding: 16px;
}
body.ex-product.csw-pdp .main-image .magnify { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
body.ex-product.csw-pdp .main-image img.productimagesolo {
display: block !important;
width: auto !important; height: auto !important;
max-width: calc(100cqw - 32px) !important; max-height: calc(100cqh - 32px) !important;
margin: 0 !important;
}
/* gallery (MasterSlider) */
body.ex-product.csw-pdp .main-image .prod-gal { position: static !important; height: 100%; margin: 0 !important; }
body.ex-product.csw-pdp .main-image .ms-slide { container-type: size; }
body.ex-product.csw-pdp .main-image .ms-slide-bgcont {
display: flex !important; align-items: center; justify-content: center;
box-sizing: border-box; padding: 16px;
}
body.ex-product.csw-pdp .main-image .ms-slide-bgcont img {
display: block !important;
width: auto !important; height: auto !important;
max-width: calc(100cqw - 32px) !important; max-height: calc(100cqh - 32px) !important;
margin: 0 !important;
}
/* 2+ slides: picture at the top, clear of the thumbnail strip */
body.ex-product.csw-pdp .main-image .prod-gal:has(.ms-slide + .ms-slide) .ms-slide-bgcont { align-items: flex-start; padding-bottom: 88px; }
body.ex-product.csw-pdp .main-image .prod-gal:has(.ms-slide + .ms-slide) .ms-slide-bgcont img { max-height: calc(100cqh - 104px) !important; }
body.ex-product.csw-pdp .main-image .ms-thumb-list {
top: auto !important; right: 64px !important; bottom: 10px !important; left: 10px !important;
width: auto !important; height: 72px !important;
padding: 4px; box-sizing: border-box; z-index: 3; overflow: hidden;
}
body.ex-product.csw-pdp .main-image .prod-gal:not(:has(.ms-slide + .ms-slide)) .ms-thumb-list { display: none !important; }
body.ex-product.csw-pdp .main-image .ms-thumb-frame {
width: 64px !important; height: 64px !important; margin: 0 8px 0 0 !important; padding: 6px;
box-sizing: border-box; border: 1px solid #dce3e2; border-radius: 8px; background: #fff;
box-shadow: var(--csw-pdp-shadow); opacity: 0.5; transition: opacity 0.2s; cursor: pointer;
}
body.ex-product.csw-pdp .main-image .ms-thumb-frame:hover,
body.ex-product.csw-pdp .main-image .ms-thumb-frame-selected { opacity: 1; }
body.ex-product.csw-pdp .main-image .ms-thumb { display: block; width: 100% !important; height: 100% !important; object-fit: contain; }
body.ex-product.csw-pdp .main-image :is(.ms-thumb-ol, .ms-thumblist-fwd, .ms-thumblist-bwd) { display: none !important; }
/* zoom (the store's lightbox button), bottom-right in both */
body.ex-product.csw-pdp .main-image .product-lightbox-open {
position: absolute !important; top: auto !important; right: 14px !important; bottom: 14px !important; left: auto !important;
z-index: 4; display: flex; align-items: center; justify-content: center;
width: 40px; height: 40px; margin: 0; padding: 0;
border: 0; border-radius: 50%; background: #fff; box-shadow: var(--csw-pdp-shadow);
color: var(--csw-blue); cursor: zoom-in;
}
body.ex-product.csw-pdp .main-image .prod-gal:has(.ms-slide + .ms-slide) .product-lightbox-open { bottom: 26px !important; } /* level with the thumbnails */
body.ex-product.csw-pdp .main-image .product-lightbox-open .lightbox-icon { display: none; }
body.ex-product.csw-pdp .main-image .product-lightbox-open::before {
content: ""; width: 18px; height: 18px; background-color: currentColor;
-webkit-mask: var(--csw-icon-zoom) center / contain no-repeat; mask: var(--csw-icon-zoom) center / contain no-repeat;
}
body.ex-product.csw-pdp .main-image .product-lightbox-open:hover { color: var(--csw-orange); }
/* ---------- Summary: title, code, indicators, category, options, points ---------- */
body.ex-product.csw-pdp .productsummary_container .product-summary { text-align: left; }
body.ex-product.csw-pdp .productsummary_container .row { margin: 0; }
body.ex-product.csw-pdp .productsummary_container .row > [class*="col-"] { float: none; width: auto; padding: 0; }
body.ex-product.csw-pdp .productsummary_container .product-title h1.product-name {
margin: 0; font-family: var(--csw-font-display); font-size: 34px; font-weight: 600; line-height: 1.05;
letter-spacing: 0.01em; text-transform: uppercase; color: var(--csw-blue);
}
body.ex-product.csw-pdp .productsummary_container .product-title::after {
content: ""; display: block; width: 40px; height: 3px; margin: 18px 0 20px; background: var(--csw-orange);
}
body.ex-product.csw-pdp .productsummary_container .productdetails {
display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
padding-bottom: 18px; border-bottom: 1px solid var(--csw-hairline);
}
body.ex-product.csw-pdp .productsummary_container .productdetails > * { margin: 0 !important; }
body.ex-product.csw-pdp .productsummary_container .productdetails > :not(.prod-code, .product-indicators) { flex-basis: 100%; }
body.ex-product.csw-pdp .productsummary_container .productdetails > .prod-code + * + :not(.prod-code, .product-indicators),
body.ex-product.csw-pdp .productsummary_container .productdetails > .product-indicators + :not(.prod-code, .product-indicators) { margin-top: 10px !important; }
body.ex-product.csw-pdp .productsummary_container .prod-code .label {
display: inline-block; padding: 6px 12px; border-radius: 6px; background: var(--csw-blue); color: #fff;
font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
body.ex-product.csw-pdp .productsummary_container .product-indicators { display: flex; align-items: center; gap: 8px; }
body.ex-product.csw-pdp .productsummary_container .product-indicators > i:not(.fa-stack) {
display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
border-radius: 50%; background: var(--csw-light-grey); color: var(--csw-blue); font-size: 14px;
}
body.ex-product.csw-pdp .productsummary_container .product-indicators > i.fa-leaf { background: var(--csw-green); color: #fff; }
body.ex-product.csw-pdp .productsummary_container .product-indicators > i.fa-stack {
width: 30px; height: 30px; line-height: 30px; border-radius: 50%; background: var(--csw-light-grey); color: var(--csw-blue); font-size: 11px;
}
body.ex-product.csw-pdp .productsummary_container :is(.prod-category, .manufacturer-name) > span {
display: grid; grid-template-columns: 110px minmax(0, 1fr); column-gap: 22px; font-size: 14px; color: var(--csw-text-body);
}
body.ex-product.csw-pdp .productsummary_container :is(.prod-category, .manufacturer-name) strong { color: var(--csw-blue); font-weight: 700; }
body.ex-product.csw-pdp .productsummary_container .prod-category a { color: var(--csw-text-body); }
/* configurable: the option selects */
body.ex-product.csw-pdp .productsummary_container .product-options { margin-top: 18px; }
body.ex-product.csw-pdp .productsummary_container .option-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 12px; }
body.ex-product.csw-pdp .productsummary_container .option-group > label { margin: 0; font-size: 14px; font-weight: 700; color: var(--csw-blue); }
body.ex-product.csw-pdp .productsummary_container .option-group .has-tooltip { color: var(--csw-text-muted); }
body.ex-product.csw-pdp .productsummary_container .option-group-values { flex-basis: 100%; }
body.ex-product.csw-pdp .productsummary_container .option-group select {
width: 100%; max-width: 360px; height: 44px; padding: 0 12px;
border: 1px solid var(--csw-hairline); border-radius: 6px; background: #fff; color: var(--csw-blue); font-size: 14px;
}
body.ex-product.csw-pdp .productsummary_container .option-group.is-not-selected select { border-color: var(--csw-orange); }
/* selling points: orange tick bullets */
body.ex-product.csw-pdp .productsummary_container .product-points ul {
display: flex; flex-direction: column; gap: 9px; margin: 18px 0 0; padding: 0; list-style: none;
font-size: 14px; line-height: 1.45; color: var(--csw-text-body);
}
body.ex-product.csw-pdp .productsummary_container .product-points ul:not(:has(li)) { display: none; }
body.ex-product.csw-pdp .productsummary_container .product-points li { display: flex; gap: 10px; align-items: flex-start; }
body.ex-product.csw-pdp .productsummary_container .product-points li::before {
content: ""; flex: 0 0 18px; height: 18px; margin-top: 1px; border-radius: 50%;
background: var(--csw-orange) var(--csw-icon-check-white) center / 12px no-repeat;
}
/* ---------- Buy box (.product-shopping-actions; csw-pdp-buy when the script gave it the delivery card) ---------- */
body.ex-product.csw-pdp .filter-container .product-shopping-actions {
display: flex; flex-direction: column; gap: 18px;
margin: 0; padding: 24px; border-radius: 10px; background: var(--csw-surface-muted);
text-align: left !important;
}
body.ex-product.csw-pdp .product-shopping-actions .row { margin: 0; }
body.ex-product.csw-pdp .product-shopping-actions .row > [class*="col-"] { float: none; width: auto; padding: 0; }
body.ex-product.csw-pdp .product-shopping-actions > .row:not(:has(> *)) { display: none; } /* empty store rows: no gap */
body.ex-product.csw-pdp .product-shopping-actions > .deliv-text { order: 1; }
body.ex-product.csw-pdp .product-shopping-actions > :is(.row:has(.product-shopping-actions-addtocart), .prod-tools-wrap) { order: 2; }
/* price panel */
body.ex-product.csw-pdp .product-shopping-actions .row > .product-shopping-actions-prices {
display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px;
padding: 18px 20px; border-radius: 8px; background: #fff;
}
body.ex-product.csw-pdp .product-shopping-actions-prices > :is(.alert, .price-from, .price-label-inc-vat) { flex-basis: 100%; margin: 0; }
body.ex-product.csw-pdp .product-shopping-actions-prices > .live-inventory-v2-wrapper { display: none; }
body.ex-product.csw-pdp .product-shopping-actions-prices .price-from { font-size: 13px; color: var(--csw-text-muted); }
body.ex-product.csw-pdp .product-shopping-actions-prices .price {
display: flex !important; flex: 1 1 auto; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0;
}
body.ex-product.csw-pdp .product-shopping-actions-prices .has-price { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: var(--csw-orange); }
body.ex-product.csw-pdp .product-shopping-actions-prices .price .uom { display: block !important; margin: 0; padding-top: 4px; font-size: 13px; color: var(--csw-text-body); text-align: right; }
body.ex-product.csw-pdp .product-shopping-actions-prices .price-label-inc-vat { font-size: 13px; color: var(--csw-text-muted); }
body.ex-product.csw-pdp .product-shopping-actions-prices .price-call {
display: flex; align-items: center; gap: 10px; flex-basis: 100%; font-size: 20px; font-weight: 700; color: var(--csw-blue);
}
body.ex-product.csw-pdp .product-shopping-actions-prices .price-call .fa { color: var(--csw-orange); }
/* tier prices */
body.ex-product.csw-pdp .product-shopping-actions .row:has(.tierBoxes) :is(.group-focus, .arrow-down) { display: none; }
body.ex-product.csw-pdp .product-shopping-actions .tierBoxes {
display: flex !important; flex-direction: column; padding: 6px 16px; border-radius: 8px; background: #fff;
}
body.ex-product.csw-pdp .product-shopping-actions .tierBox {
display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 7px 0;
border-bottom: 1px solid var(--csw-hairline); font-size: 13px; color: var(--csw-text-body);
}
body.ex-product.csw-pdp .product-shopping-actions .tierBox:last-child { border-bottom: 0; }
body.ex-product.csw-pdp .product-shopping-actions .tierBox:first-child { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--csw-text-muted); }
body.ex-product.csw-pdp .product-shopping-actions .tierBox:not(:first-child) .tierPrice { font-weight: 600; color: var(--csw-blue); }
body.ex-product.csw-pdp .product-shopping-actions .tierBox > .tierDiscount { text-align: right; }
body.ex-product.csw-pdp .product-shopping-actions .tierBox:not(:first-child) > .tierDiscount { color: var(--csw-green); font-weight: 600; }
/* the card replaces the store's stock rows and its "Next Day Delivery" line */
body.ex-product.csw-pdp .csw-pdp-buy:has(.csw-delivery) :is(.product-stock-wrap, .deliv-text) { display: none !important; }
body.ex-product.csw-pdp .csw-pdp-buy .row > [class*="col-"]:has(> .product-stock-wrap) { display: none; }
body.ex-product.csw-pdp .csw-pdp-buy .csw-dl-label { padding: 12px 20px; }
body.ex-product.csw-pdp .csw-pdp-buy .csw-stock-list { padding: 0 20px 15px; }
/* no card (e.g. a configurable product): the store's delivery line, as a strip */
body.ex-product.csw-pdp .product-shopping-actions > .deliv-text {
display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 20px; border-radius: 6px;
background: var(--csw-green-tint); color: var(--csw-green-deep);
font-size: 11px; font-weight: 700; line-height: 1.3; letter-spacing: 0.08em; text-transform: uppercase;
}
body.ex-product.csw-pdp .product-shopping-actions:not([data-leadtime]) > .deliv-text { background: #fff; color: var(--csw-blue); }
body.ex-product.csw-pdp .product-shopping-actions > .deliv-text img { width: 22px !important; height: auto; }
body.ex-product.csw-pdp .product-shopping-actions > .deliv-text p { margin: 0; }
body.ex-product.csw-pdp .product-shopping-actions > .deliv-text .text-orange { color: inherit; }
/* quantity + Add to basket: one 52 px bar, the card above it */
body.ex-product.csw-pdp .product-shopping-actions .buttons.group {
display: grid; grid-template-columns: auto minmax(0, 1fr); grid-auto-flow: row dense; row-gap: 18px;
height: auto !important; margin: 0;
}
body.ex-product.csw-pdp .product-shopping-actions .buttons.group > * { grid-column: 1 / -1; margin: 0; }
body.ex-product.csw-pdp .product-shopping-actions .buttons.group > .qnt-count {
grid-column: 1; display: flex !important; align-items: stretch; height: 52px; margin: 0; padding: 0;
border: 1px solid var(--csw-hairline); border-right: 0; border-radius: 6px 0 0 6px; background: #fff; overflow: hidden; float: none;
}
body.ex-product.csw-pdp .product-shopping-actions .qnt-count .incr-btn {
display: flex; align-items: center; justify-content: center; width: 40px; margin: 0; padding: 0;
border: 0; background: none; color: var(--csw-blue); font-size: 17px; text-decoration: none;
}
body.ex-product.csw-pdp .product-shopping-actions .qnt-count .incr-btn:hover { background: var(--csw-surface-muted); }
body.ex-product.csw-pdp .product-shopping-actions .qnt-count .inputquantity {
width: 44px; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none;
color: var(--csw-blue); font-size: 15px; font-weight: 600; text-align: center;
}
body.ex-product.csw-pdp .product-shopping-actions .buttons.group > .live-inventory-v2-add-to-cart-wrapper { grid-column: 2; display: flex; margin: 0; }
body.ex-product.csw-pdp .product-shopping-actions .buttons.group:not(:has(> .qnt-count)) > .live-inventory-v2-add-to-cart-wrapper { grid-column: 1 / -1; }
body.ex-product.csw-pdp .product-shopping-actions .live-inventory-v2-add-to-cart-wrapper .live-inventory-v2-wrapper { display: none; }
body.ex-product.csw-pdp .product-shopping-actions .live-inventory-v2-add-to-cart-wrapper .btn-add-to-cart {
display: flex; align-items: center; justify-content: center; gap: 10px; flex: 1 1 auto; width: 100%; height: 52px; margin: 0; padding: 0 12px;
border: 0; border-radius: 0 6px 6px 0; background: var(--csw-orange); color: #fff; box-shadow: none;
font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
body.ex-product.csw-pdp .product-shopping-actions .buttons.group:not(:has(> .qnt-count)) .btn-add-to-cart { border-radius: 6px; }
body.ex-product.csw-pdp .product-shopping-actions .btn-add-to-cart:is(:hover, :focus-visible) { background: var(--csw-orange-ink); color: #fff; }
body.ex-product.csw-pdp .product-shopping-actions .btn-add-to-cart:is(:disabled, .disabled) { opacity: 0.55; }
body.ex-product.csw-pdp .product-shopping-actions .btn-add-to-cart .fa { padding: 0 !important; font-size: 15px; }
body.ex-product.csw-pdp .csw-pdp-buy .buttons.group > a.csw-alt-link--below {
display: flex; align-items: center; justify-content: center; height: 42px; padding: 0 10px;
border: 1px solid var(--csw-orange); border-radius: 6px; background: #fff; color: var(--csw-orange);
font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
}
body.ex-product.csw-pdp .csw-pdp-buy .buttons.group > a.csw-alt-link--below:is(:hover, :focus-visible) { background: var(--csw-orange); color: #fff; }
/* Order pad / Compare: two outlined buttons */
body.ex-product.csw-pdp .product-shopping-actions .prod-tools-wrap { margin: 0; }
body.ex-product.csw-pdp .product-shopping-actions .prod-tools-wrap:not(:has(> .prod-tools-wrap)) { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.ex-product.csw-pdp .product-shopping-actions :is(a.addtoquicklist, .product-compare-action) {
display: flex !important; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; margin: 0; padding: 0 8px;
border: 1px solid var(--csw-blue); border-radius: 6px; background: #fff; color: var(--csw-blue);
font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer;
}
body.ex-product.csw-pdp .product-shopping-actions :is(a.addtoquicklist, .product-compare-action):hover { background: var(--csw-blue); color: #fff; }
body.ex-product.csw-pdp .product-shopping-actions .product-compare-action .fa-stack { width: 1.4em; height: 1.4em; line-height: 1.4em; font-size: 10px; }
/* under the box: banners, share links */
body.ex-product.csw-pdp .filter-container .singlebanner_wrapper { margin-top: 18px; }
body.ex-product.csw-pdp .filter-container .singlebanner_wrapper img { max-width: 100%; height: auto; border-radius: 10px; }
body.ex-product.csw-pdp .filter-container .social-links { margin-top: 12px; }
/* ---------- Description / Specifications: two cards ---------- */
body.ex-product.csw-pdp .mainproductpagedesktop > .details-wrap > .row {
display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 24px; margin: 48px 0 0;
}
body.ex-product.csw-pdp .mainproductpagedesktop > .details-wrap > .row:not(:has(> *)) { display: none; }
body.ex-product.csw-pdp .details-wrap .row > :is(.productdescription_container, .productspecs_container) { float: none; width: auto; min-width: 0; padding: 0; }
body.ex-product.csw-pdp .details-wrap .product-panel { height: 100%; margin: 0; }
body.ex-product.csw-pdp .details-wrap .panel {
display: flex; flex-direction: column; height: 100%; margin: 0;
border: 1px solid var(--csw-hairline); border-radius: 10px; overflow: hidden; box-shadow: none; background: var(--csw-surface-muted);
}
body.ex-product.csw-pdp .details-wrap .panel-heading {
display: flex; align-items: center; justify-content: space-between; padding: 16px 22px;
border: 0; background: var(--csw-surface-muted); cursor: pointer;
}
body.ex-product.csw-pdp .details-wrap .panel-heading h3 {
margin: 0; font-family: var(--csw-font-display); font-size: 19px; font-weight: 600; letter-spacing: 0.01em; text-transform: uppercase; color: var(--csw-blue);
}
body.ex-product.csw-pdp .details-wrap .panel-heading::after { content: "–"; font-size: 18px; line-height: 1; color: var(--csw-blue); }
body.ex-product.csw-pdp .details-wrap .panel-heading.collapsed::after { content: "+"; }
body.ex-product.csw-pdp .details-wrap .panel-collapse { flex: 1 1 auto; background: #fff; }
body.ex-product.csw-pdp .details-wrap .panel-body { padding: 20px 22px; border: 0 !important; font-size: 14px; line-height: 1.6; color: var(--csw-text-body); }
body.ex-product.csw-pdp .details-wrap .panel-body .row { margin: 0; }
body.ex-product.csw-pdp .details-wrap .panel-body [class*="col-"] { float: none; width: auto; padding: 0; }
body.ex-product.csw-pdp .details-wrap .panel-body .form-group { margin: 0; }
body.ex-product.csw-pdp .details-wrap .tech-specs .item:not(.see-more) > .row {
display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 12px;
padding: 10px 0; border-bottom: 1px solid var(--csw-hairline); font-size: 13px;
}
body.ex-product.csw-pdp .details-wrap .tech-specs .item > .row::before,
body.ex-product.csw-pdp .details-wrap .tech-specs .item > .row::after { display: none; }
body.ex-product.csw-pdp .details-wrap .tech-specs .item:not(.see-more) > .row > :first-child { text-align: left !important; color: var(--csw-text-muted); }
body.ex-product.csw-pdp .details-wrap .tech-specs .item > .row > :last-child p { margin: 0; font-weight: 600; color: var(--csw-blue); }
body.ex-product.csw-pdp .details-wrap .see-more a { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; text-decoration: none; }
/* ================= "DELETE BASKET AFTER CHECKOUT" SWITCH (cart totals) =================
The script adds it only when the basket has the store's select; the select is hidden only while the switch exists. */
body.ex-cart.csw-on:has(.csw-onetime) .costcentre:has(> select[name="update-is-onetime"]) { display: none !important; }
.csw-onetime {
display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; /*! padding-top: 16px; */
/*! border-top: 1px solid var(--csw-hairline); */ color: var(--csw-text-body); font-size: 13px; line-height: 1.3; text-align: left;
}
.csw-onetime-label { flex: 1 1 auto; min-width: 0; }
.csw-onetime-value { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--csw-blue); }
.csw-onetime .csw-switch {
position: relative; flex: none; width: 36px; height: 20px; margin: 0; padding: 0; border: 0; border-radius: 999px;
background: #c5ccd0; cursor: pointer; transition: background-color 0.15s;
}
.csw-onetime .csw-switch[aria-checked="true"] { background: var(--csw-orange); }
.csw-onetime .csw-switch:focus-visible { outline: 2px solid var(--csw-blue); outline-offset: 2px; }
.csw-switch-knob {
position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s;
}
.csw-onetime .csw-switch[aria-checked="true"] .csw-switch-knob { transform: translateX(16px); }
@media (prefers-reduced-motion: reduce) { .csw-onetime .csw-switch, .csw-switch-knob { transition: none; } }
/* ================= CART SIDEBAR: totals, Save / Checkout, coupon (as the mockup) ================= */
body.ex-cart.csw-on .shopping-cart .softgraybackground { background-color: var(--csw-surface-muted); border-radius: var(--csw-radius); }
body.ex-cart.csw-on .shopping-cart table td { border: none; }
body.ex-cart.csw-on .items-list .show-more-info,
body.ex-cart.csw-on .cart-header-actions { display: none; }
body.ex-cart.csw-on .cartheader_container { margin-bottom: 10px; }
/* totals box first, the coupon under it */
body.ex-cart.csw-on .carttotals_container .cart-resume { display: flex; flex-direction: column; margin-top: 0; }
body.ex-cart.csw-on .carttotals_container .cart-resume .promotion_discount { order: 2; margin-top: 16px; }
/* totals: rows, the line, Order total, then the switch and the two buttons side by side */
body.ex-cart.csw-on .carttotals_container .cart-totals { display: flex !important; flex-wrap: wrap; gap: 0 12px; }
body.ex-cart.csw-on .carttotals_container .cart-totals > :is(table, .csw-onetime, .content_loading) { flex: 0 0 100%; width: 100%; }
body.ex-cart.csw-on .carttotals_container .cart-totals > table { margin: 0 0 4px; border-collapse: collapse; }
body.ex-cart.csw-on .carttotals_container .cart-totals > table td { padding: 6px 0; font-size: 14px; line-height: 1.4; color: var(--csw-text-body); background: none; }
body.ex-cart.csw-on .carttotals_container .cart-totals > table tr.devider td { padding: 0; /*! height: 0; */ /*! border-top: 1px solid var(--csw-text-muted); */ }
body.ex-cart.csw-on .carttotals_container .cart-totals > table tr.devider + tr td { padding-top: 16px; padding-bottom: 10px; }
body.ex-cart.csw-on .carttotals_container .cart-totals > table tr.cart-order-total td { font-size: 18px; font-weight: 700; color: var(--csw-blue); }
body.ex-cart.csw-on .carttotals_container .cart-totals .btn { width: calc(50% - 6px); margin: 0; }
body.ex-cart.csw-on .carttotals_container .cart-totals a { border-color: var(--csw-orange); background-color: var(--csw-orange); color: #fff; }
body.ex-cart.csw-on .carttotals_container .cart-totals a:is(:hover, :focus) { border-color: var(--csw-orange-deep); background-color: var(--csw-orange-deep); color: #fff; }
body.ex-cart.csw-on .carttotals_container .cart-totals a i { color: #fff; }
/* coupon: muted field, outline button, one row */
body.ex-cart.csw-on .carttotals_container input.coupon_code {
height: auto; padding: 11px 14px; border-color: transparent; border-radius: 5px; box-shadow: none;
background-color: var(--csw-surface-muted); color: var(--csw-blue);
}
body.ex-cart.csw-on .carttotals_container input.coupon_code:focus { border-color: var(--csw-blue); box-shadow: none; }
body.ex-cart.csw-on .carttotals_container button.coupon_apply { padding-block: 11px; top: 0 !important; }
body.ex-cart.csw-on .carttotals_container .promotion_discount > .row { display: flex; }
body.ex-cart.csw-on .carttotals_container .promotion_discount > .row::before,
body.ex-cart.csw-on .carttotals_container .promotion_discount > .row::after { display: none; }
body.ex-cart.csw-on .carttotals_container .promotion_discount > .row > * { width: auto; }
body.ex-cart.csw-on .carttotals_container .promotion_discount > .row > :first-child { flex-grow: 1; }
`;
const has = (c) => c === "*" || Boolean(document.body?.classList.contains(c));
const forAudience = isBrowser && (AUDIENCE.everyone || AUDIENCE_CLASSES.some(has));
const on = (feature) => forAudience && PAGES[feature].some(has);
const RUN_CART_GROUPS = on("cartGroups");
const RUN_GRID_TILES = on("gridTiles");
const RUN_PRODUCT_PAGE = on("productPage");
const RUN_ALTERNATIVES = on("alternatives") || RUN_GRID_TILES || RUN_PRODUCT_PAGE;
if (isBrowser && ((!RUN_CART_GROUPS && !RUN_GRID_TILES && !RUN_PRODUCT_PAGE && !RUN_ALTERNATIVES) || window.__cswLoaded)) return;
if (isBrowser) {
document.body.classList.add("csw-on"); // heatons.css scopes its page-level cart rules to this
if (RUN_PRODUCT_PAGE) document.body.classList.add("csw-pdp"); // …and the product page rules to this
if (INLINE_CSS && !document.getElementById("heatons-inline-css")) {
const style = document.createElement("style");
style.id = "heatons-inline-css";
style.textContent = INLINE_CSS;
(document.head || document.documentElement).appendChild(style); // last in : after the store's own CSS
}
}
/* ==========================================================================
* CORE — shared by both features
* ========================================================================== */
const log = (...args) => console.warn("[csw]", ...args);
const esc = (s) =>
String(s ?? "").replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
// Lead time (item_lead_time / tile data-leadtime) → delivery band, exactly as EvoX defines them. Anything not
// listed, or a failed lookup, means "Contact Us for Availability".
const LEAD_TIME_LABELS = {
1: "Next Day Delivery",
2: "1-2 Day Delivery",
3: "3-5 Day Delivery",
4: "4 Day Delivery",
5: "5-8 Day Delivery",
6: "6-8 Day Delivery",
7: "7-10 Day Delivery",
8: "8-10 Day Delivery",
10: "10-14 Day Delivery",
14: "14-18 Day Delivery",
15: "15-20 Day Delivery",
21: "21-28 Day Delivery",
28: "28-36 Day Delivery",
49: "42-49 Day Delivery",
63: "63 Day Delivery",
99: "Made to Order",
901: "Next Day Delivery",
902: "1-2 Day Delivery",
904: "4-6 Day Delivery",
905: "5-7 Working Days Delivery",
907: "7-10 Working Days Delivery",
915: "15-20 Working Days Delivery",
};
// 9xx codes are 900 + days; Made to Order (99) always last
const leadTimeDays = (lt) => (lt === 99 ? Infinity : lt > 900 ? lt - 900 : lt);
const tierFor = (days) => (days <= 2 ? "fast" : days <= 10 ? "medium" : "slow");
const tierOf = (lt) => tierFor(leadTimeDays(lt));
// "Next Day", "1-2 Day", "5-7 Working Days", "Made to Order" — for tight spaces
const shortLeadTimeLabel = (lt) => LEAD_TIME_LABELS[lt]?.replace(/ Delivery$/, "").replace(/(\d) Day$/, "$1 Days");
// Stock rows as the store gives them ({ location_name, quantity }): one card line each, and the Contact Us rule —
// Local and Group both at or below 0 (no Local/Group in the data: not out of stock).
function warehouseMarkup(w) {
const qty = Number(w.quantity) || 0;
const shortName = String(w.location_name || "").replace(/\s*Stock$/i, "");
return (
`` +
` ${esc(shortName)} ${qty} `
);
}
function outOfStockEverywhere(warehouses) {
const relevant = (warehouses || []).filter((w) => /local|group/i.test(String(w.location_name || "")));
return relevant.length > 0 && relevant.every((w) => (Number(w.quantity) || 0) <= 0);
}
// Styles: heatons.css (theme colours, icons, the delivery card, both features). This file only sets state.
// ---------- The store's own ajax ----------
const form = (pairs) => pairs.map(([k, v]) => encodeURIComponent(k) + "=" + encodeURIComponent(v ?? "")).join("&");
async function storePost(path, pairs, timeoutMs) {
const res = await fetch(path, {
method: "POST",
signal: timeoutMs ? AbortSignal.timeout(timeoutMs) : undefined,
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"X-CSRF-TOKEN": document.querySelector('meta[name="csrf-token"]')?.content || "",
},
body: form(pairs),
});
if (!res.ok) throw Object.assign(new Error(`${path}: HTTP ${res.status}`), { status: res.status });
const data = await res.json().catch(() => undefined);
return { data, redirected: res.redirected };
}
// One /api/products/{catalog item id} lookup per product per page, shared: the cart takes item_lead_time,
// the popover takes the category. Resolves { product, available }: `available` is false when the store answers
// with a non-success status (e.g. "warning" for a switched-off product) but still sends the product. A failed
// lookup is forgotten, so the next ask retries. An error marked `final` is the store's own answer that there's
// nothing to show (no product, or a 4xx): asking again won't change it.
const productInfoCache = new Map();
function productInfo(id) {
id = String(id); // $mini_cart has strings, tiles give numbers: one key either way
if (!productInfoCache.has(id)) {
const p = storePost(`/api/products/${id}`, [["compare", "1"]], 15000).then(
({ data }) => {
if (!data?.product) throw Object.assign(new Error(`/api/products/${id}: status ${data?.status}`), { final: true });
return { product: data.product, available: data.status === "success" };
},
(err) => {
if (err.status >= 400 && err.status < 500 && err.status !== 408 && err.status !== 429) err.final = true;
throw err;
},
);
p.catch(() => productInfoCache.delete(id));
productInfoCache.set(id, p);
}
return productInfoCache.get(id);
}
// Live stock rows for [{ sku, itemId, uom, template, inventoryV2 }], as the store's own pages ask for them
async function liveInventoryRows(entries) {
const pairs = entries.map((e) => ["products[]", e.sku]);
entries.forEach((e, i) =>
pairs.push(
[`productData[${i}][item_id]`, e.itemId],
[`productData[${i}][sku]`, e.sku],
[`productData[${i}][uom]`, e.uom],
[`productData[${i}][template_item]`, e.template ?? ""],
[`productData[${i}][inventory_v2]`, e.inventoryV2 ?? ""],
),
);
const { data } = await storePost(`/ajax/live-inventory?_=${Date.now()}`, pairs, 15000);
if (data?.status !== "success" || !Array.isArray(data.data)) throw new Error(`live-inventory: status ${data?.status}`);
return data.data;
}
// Remove a cart line through its own Remove button, so EvoX runs its normal removal path (server call, Vue table,
// totals, mini cart). Resolves true once the line has left the page, false if it's still there after timeoutMs.
async function removeCartLine(itemId, timeoutMs = 15000) {
const sel = `table.items-list tr.item_${itemId}`;
const btn = document.querySelector(`${sel} .delete-btn`);
if (!btn) return !document.querySelector(sel);
btn.click();
const started = Date.now();
while (document.querySelector(sel)) {
if (Date.now() - started > timeoutMs) return false;
await sleep(100);
}
return true;
}
// Add to basket the way the store's addcart() does, then what it does next: updateminicart(), the cart page's
// table (EvoX's Vue 1 component) and `cart-total-update`. Throws when the store didn't add it (redirected to a
// login page, not JSON, or a non-success status). No timeout: abandoning an add the store then completes would
// invite a duplicate. Returns { data, reload }: reload is true on the cart page when the table can't redraw in place.
async function addToCart(product, qty, context) {
const { data, redirected } = await storePost("/cart/addcart", [
["product", JSON.stringify(product)],
["qty", qty],
]);
if (redirected || !data || typeof data !== "object") throw new Error("addcart: not added (redirected or not JSON)");
if ("status" in data && !/^(200|success|ok|true)$/i.test(String(data.status)))
throw new Error("addcart: " + (data.message || data.status));
let reload = false;
if (typeof window.updateminicart === "function") {
try {
window.updateminicart(data, false, "add-item");
} catch (e) {
log("updateminicart", e);
}
}
const vm = document.querySelector(".shopping-cart")?.__vue__;
if (vm && Array.isArray(data.minicart_items)) {
try {
// Lines the table already has pass through as they are; only new ones go through transformCartItems
const known = new Set((vm.items || []).map((i) => i.session_cart_id));
vm.updateItemsInTheCart({
...data,
minicart_items: data.minicart_items.map(({ item_obj, created_at, updated_at, ...i }) =>
known.has(i.session_cart_id)
? i
: vm.transformCartItems([
{
...i,
created_at,
quote_id: i.session_id,
item_shipping_type: i.item_shipping_type ?? 3,
product_labels: i.product_labels ?? "",
},
])[0],
),
});
if (data.minicart_totals) vm.totals = { ...vm.totals, ...data.minicart_totals };
// The store runs Vue 1: $nextTick(fn) needs a callback and returns nothing (the promise form is Vue 2.1+)
await new Promise((resolve) => vm.$nextTick(resolve));
} catch (e) {
log("cart table update", e);
reload = context === "cart";
}
} else {
reload = context === "cart";
}
document.dispatchEvent(new CustomEvent("cart-total-update"));
return { data, reload };
}
/* ==========================================================================
* FEATURE: search alternatives — settings and the pure parts (tested in node)
* ========================================================================== */
const CONFIG = Object.assign(
{
api: "https://api.heymojo.dev/alternatives/v1/eu/stores/1655/products/",
track: true, // send shopper counts (opened / nothing shown / added) to the server for the admin
searchTimeoutMs: 30000,
searchConcurrency: 3, // store search pages fetched at once
pollDelaysMs: [5000, 10000, 15000], // wait before each re-ask while picks are pending (its length = number of re-asks)
runCapMs: 60000, // searching, then checking, each get this long
removeTimeoutMs: 15000, // Swap: how long to wait for the original line to leave the cart
maxCandidates: 40,
showMax: 4,
showAllMax: 20,
stockCheckMax: 40, // live stock asked for the top N ranked before showing (0 everywhere: dropped)
closeMaxRatio: 3, // close matches may cost up to max(3×, +£5); good and fallback up to max(2×, +£5)
packRatioLimit: 20, // pack sizes this far apart count different things: compare shelf prices
},
(isBrowser && window.cswAlternativesConfig) || {},
);
const S = {
title: "Alternatives for",
inStock: "in stock",
queued: "Waiting for the previous search to finish",
step1: "Preparing your search",
step2: "Searching the store",
step3: "Checking suitability",
checking: "Still checking… more may appear",
empty: "No in-stock alternatives right now.",
stillChecking: "Still checking alternatives for this item. Try again in a minute.",
added: "Added",
add: "Add to basket",
addAlso: "Add {sku} to basket as well",
swap: "Swap",
swapping: "Swapping…",
swapTitle: "Replace {orig} in your basket with this",
swapPartial: "Added. We couldn't remove {orig} — please remove it from your basket.",
adding: "Adding…",
failed: "Try again",
cannotAdd: "Not available to add",
showAll: "Show all {n}",
showFewer: "Show fewer",
showMore: "Show more",
loadingMore: "Searching…",
srSearching: "Searching the store",
srResults: "alternatives in stock",
browse: "Or browse similar products in", // while searching / still checking
browseMore: "Not quite right? Browse", // under the alternatives
browseCta: "Browse {name}", // nothing found: a button
};
const money = (n) => "£" + (Number.isFinite(n) ? n.toFixed(2) : "—");
const toPrice = (v) => Number(String(v ?? "").replace(/[^\d.]/g, ""));
// A positive whole number (max 12 digits) as a string, or "": the picks server rejects any list with a bad id
const idOf = (v) => {
const str = String(v ?? "").trim();
return /^[1-9]\d{0,11}$/.test(str) ? str : "";
};
/* ---------- Step 0: the product, from the cart line or the product tile ---------- */
const validProduct = (p) =>
[p.productId, p.catalogId, p.supplierId, p.price].every((n) => Number.isFinite(n) && n > 0) && p.sku && p.title ? p : null;
// The cart page's own copy of the basket, as rendered with the page (the delivery groups read it too)
function cartDataLine(productId) {
try {
const lines = JSON.parse(document.getElementById("cartdata")?.value || "{}").store_cart || [];
return lines.find((o) => Number(o.item_id) === productId) || null;
} catch {
return null;
}
}
function readProduct(link) {
if (link.closest(".cartproductlines_container")) {
const line = link.closest("tr.item");
const cls = [...(line?.classList ?? [])].find((c) => /^item_\d+$/.test(c));
const productId = Number(cls?.slice(5));
const entry = (Array.isArray(window.$mini_cart) ? window.$mini_cart : []).find((o) => Number(o.item_id) === productId);
return validProduct({
productId,
catalogId: Number(entry?.item_catalog_id),
supplierId: Number(entry?.item_supplier_id),
price: toPrice(entry?.item_price || line?.querySelector(".item_line_price")?.textContent), // unit price, not the line total
title: String(entry?.item_name ?? line?.querySelector("td.name a.bolder")?.textContent ?? "").trim(),
sku: String(link.dataset.cswSku ?? "").trim(),
// Swap replaces the line: same quantity, same line reference
qty: Math.max(1, parseInt(line?.querySelector("input.quantity")?.value || entry?.qty, 10) || 1),
lineRef: String(line?.querySelector("input.ref")?.value || entry?.line_ref || "").trim(),
// for /api/products/{id} → the category; $mini_cart may lack it after a basket change, #cartdata has it
catalogItemId: Number(entry?.item_catalog_item_id || cartDataLine(productId)?.item_catalog_item_id) || null,
context: "cart",
});
}
// Grid tile: the shopper's price is the price label (data-native-price is the RRP); catalog id from its $t_item
const tile = link.closest(".product[data-item-id]");
if (!tile) return null;
const sku = String(link.dataset.cswSku || tile.dataset.sku || "").trim();
const card = parseCards(tile.innerHTML).get(sku);
return validProduct({
productId: Number(tile.dataset.itemId),
catalogId: Number(card?.item_catalog_id),
supplierId: Number(tile.dataset.supplierId || card?.item_supplier_id),
price: toPrice(tile.querySelector(".price-label[data-value]")?.dataset.value || tile.dataset.nativePrice),
title: String(tile.dataset.itemName || card?.item_name || "").trim(),
sku,
category: categoryLink(tile.querySelector(".product-category a")),
context: "grid",
});
}
// A category link the popover can offer: { name, url }, or null
// The popover's "Browse " link opens the category with in-stock products only (&in_stock_only=true)
function categoryLink(a) {
const url = a?.href || a?.url;
const name = String(a?.textContent || a?.title || a?.name || "").trim();
if (!url || !name || !/^(https?:\/\/|\/)/.test(url)) return null;
try {
const u = new URL(url, "https://www.heatons.co.uk");
u.searchParams.set("in_stock_only", "true");
return { name, url: /^\//.test(url) ? u.pathname + u.search + u.hash : u.href };
} catch {
return { name, url };
}
}
/* ---------- HeyMojo API: plain GETs (no headers, no credentials → no CORS preflight) ---------- */
// Timed out so a hung request can't hold up the queue (still no headers: no preflight)
async function apiGet(path, timeoutMs) {
const res = await fetch(CONFIG.api + path, { signal: AbortSignal.timeout(timeoutMs) });
if (res.status !== 200) throw Object.assign(new Error("HTTP " + res.status), { status: res.status });
return res.json();
}
async function getPhrases(p) {
const data = await apiGet(`${p.productId}/phrases?catalogId=${p.catalogId}&supplierId=${p.supplierId}`, 20000); // first call generates phrases
const queries = Array.isArray(data?.queries) ? data.queries.filter((q) => typeof q === "string" && q.trim()).slice(0, 6) : [];
if (!queries.length) throw new Error("phrases: empty answer");
return { queries, seed: data.seed === true };
}
async function getPicks(p, candidates, seed) {
const c = candidates.map((x) => `${x.item}:${x.catalogId}:${x.supplierId}`).join(","); // `:` and `,` stay raw
const data = await apiGet(
`${p.productId}/picks?catalogId=${p.catalogId}&supplierId=${p.supplierId}&c=${c}${seed ? "&seed=1" : ""}`,
15000,
);
const ids = (a) => (Array.isArray(a) ? a.map(Number).filter(Number.isFinite) : null);
const approved = ids(data?.approved),
pending = ids(data?.pending);
if (!approved || !pending) throw new Error("picks: malformed answer");
const match = new Map(); // level per approved id: 3 close, 2 good, 1 fallback; missing counts as good
for (const [id, level] of Object.entries(data.match || {})) if ([1, 2, 3].includes(level)) match.set(Number(id), level);
return { approved, pending, match };
}
/* ---------- Step 2: reading a store search page ---------- */
// The balanced [...] or {...} starting at s[start], string-aware; null if unbalanced
function extractBalanced(s, start) {
let depth = 0,
quote = "",
escaped = false;
for (let k = start; k < s.length; k++) {
const ch = s[k];
if (quote) {
if (escaped) escaped = false;
else if (ch === "\\") escaped = true;
else if (ch === quote) quote = "";
} else if (ch === '"' || ch === "'") quote = ch;
else if (ch === "[" || ch === "{") depth++;
else if ((ch === "]" || ch === "}") && --depth === 0) return s.slice(start, k + 1);
}
return null;
}
// $evodata.products.list is an array — or, with exactly one result, that product as a bare object
function parseProductsList(html) {
const marker = "$evodata.products.list = ";
const i = html.indexOf(marker);
if (i < 0) return [];
const from = i + marker.length;
const offset = html.slice(from, from + 6).search(/[[{]/);
const text = offset < 0 ? null : extractBalanced(html, from + offset);
if (!text) return [];
let data;
try {
data = JSON.parse(text);
} catch {
return [];
}
const arr = Array.isArray(data) ? data : data && typeof data === "object" ? (data.sku ? [data] : Object.values(data)) : [];
return arr.filter((p) => p && typeof p === "object" && p.sku);
}
// A `$t_item. = ;` value: JSON, or a simple 'single-quoted' string. Anything else is skipped —
// page text is never run as code.
function readValue(s, i) {
const ch = s[i];
let raw, next;
if (ch === '"' || ch === "'") {
let k = i + 1;
while (k < s.length && s[k] !== ch) k += s[k] === "\\" ? 2 : 1;
raw = s.slice(i, k + 1);
next = k + 1;
} else if (ch === "[" || ch === "{") {
raw = extractBalanced(s, i);
next = raw ? i + raw.length : s.length;
} else {
const end = s.indexOf(";", i);
raw = end < 0 ? null : s.slice(i, end).trim();
next = end < 0 ? s.length : end;
}
if (!raw || raw === "undefined") return [undefined, next];
const single = raw.match(/^'([^'\\]*)'$/);
if (single) return [single[1], next];
try {
return [JSON.parse(raw), next];
} catch {
return [undefined, next];
}
}
// Per SKU, the `$t_item` object of that product's card script — what the store posts to /cart/addcart
function parseCards(html) {
const map = new Map();
const at = (re) => [...html.matchAll(re)].map((m) => m.index);
const skus = [...html.matchAll(/\$t_item\.item_sku\s*=\s*"([^"]+)"\s*;/g)];
const shared = [...at(/\$t_item\s*=\s*\{/g), ...skus.map((m) => m.index)];
const starts = [...shared, ...at(/