/* Smarterbuys Store: the cookie banner and the "Cookie settings" dialog (markup: the analytics module; this
   stylesheet: the design module, since 18 Nov).
   Colours, radii, shadows and fonts are the design tokens (tokens.css); each has a fallback so the banner still
   draws on a page that does not load them. Mint, lime and coral are fills only: text is always navy or white.
   The banner is a sheet at the foot of a phone and a strip or bar at the foot of anything wider, never a wall: the
   page behind it stays usable.
   Phone first, in four regions: 1 the shared rules and the phone (the default), 2 additions from 700px,
   3 additions from 1200px, 4 what depends on the pointer, on motion and on print. */

/* ===== 1 SHARED AND PHONE (default: every width up to 699.98px) ===== */

.consent-banner, .consent-dialog {
  --c-navy: var(--navy, #18124C); --c-ink: var(--ink, #100B34); --c-slate: var(--slate, #292449);
  --c-mint: var(--mint, #3BF7CA); --c-lime: var(--lime, #C3E041); --c-coral: var(--coral, #FF6765);
  --c-muted: var(--muted, #5A5670); --c-hair: var(--hair, #EFECE3); --c-page: var(--page, #FBF8F3);
  --c-control: var(--control, #8B86A0);
  --c-display: var(--font-display, "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif);
  --c-body: var(--font-body, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  --c-pop: var(--shadow-pop, 0 4px 10px rgba(16, 11, 52, .08), 0 28px 70px rgba(16, 11, 52, .22));
  font-family: var(--c-body); color: var(--c-navy); -webkit-text-size-adjust: 100%;
}
.consent-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.consent-icon { display: block; flex: none; }

/* ---------------------------------------------------------------------------------------------- buttons */
/* One button for every choice: the same height, width, weight and shape, so refusing is as easy as accepting. */
.consent-btn {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; min-height: 48px; margin: 0; padding: 0 14px;
  border: 2px solid var(--c-navy); border-radius: 999px; background: var(--c-navy); color: #fff;
  font: 700 .9375rem/1.2 var(--c-body); text-align: center; white-space: nowrap; cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms, transform 120ms; -webkit-tap-highlight-color: transparent;
}
.consent-btn:active { transform: scale(.98); }
.consent-btn--choose, .consent-btn--line { background: #fff; color: var(--c-navy); }
.consent-btn:focus-visible, .consent-dialog__close:focus-visible, .consent-banner a:focus-visible, .consent-dialog a:focus-visible,
.consent-cat__more summary:focus-visible { outline: 3px solid var(--c-navy); outline-offset: 2px; }

/* ---------------------------------------------------------------------------------------------- the banner */
.consent-banner { position: fixed; z-index: 65; }
.consent-banner[hidden] { display: none; }
.consent-banner__card {
  position: relative; overflow: hidden; padding: 26px 24px 20px; border-radius: 22px; background: #fff;
  box-shadow: 0 0 0 1px rgba(16, 11, 52, .06), var(--c-pop); animation: consent-rise 280ms cubic-bezier(.2, .7, .2, 1) both;
}
.consent-banner__card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--c-mint), var(--c-lime) 55%, var(--c-coral)); }
.consent-banner__head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.consent-banner__badge { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--c-ink); color: var(--c-mint); box-shadow: 0 6px 18px rgba(59, 247, 202, .35); }
.consent-banner__title { margin: 0; font: 700 1.3125rem/1.2 var(--c-display); letter-spacing: -.01em; color: var(--c-ink); }
.consent-banner__text { margin: 0 0 16px; font-size: .9375rem; line-height: 1.55; color: var(--c-slate); }
.consent-banner__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.consent-banner__foot { margin: 14px 0 0; font-size: .8125rem; line-height: 1.5; color: var(--c-muted); }
.consent-banner__foot a, .consent-dialog__note a { color: var(--c-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: 4px; }
/* "Choose" is a link to the "Cookie settings" on the same page (#cookie-settings): the script opens them as a
   dialog; without the script the link shows them by itself (:target, below), so all three choices work from the
   first paint. The dialog's close is a link too (to an address that names nothing: the settings go away and the
   page stays where it was). */
a.consent-btn, a.consent-dialog__close { text-decoration: none; }

/* The banner gives way to anything the shopper has opened or must press: it steps away while a sheet or the
   search is open (at every width), so it can never cover "Show 13 products" or a search result. */
.consent-banner { transition: transform 200ms cubic-bezier(.2, .7, .2, 1), visibility 0s linear 0s; }
:where(html.sheet-open, html.search-open) .consent-banner { transform: translateY(calc(100% + 32px)); visibility: hidden; transition: transform 200ms cubic-bezier(.2, .7, .2, 1), visibility 0s linear 200ms; }
/* (keyboard focus is never left behind the banner: base.css adds --consent-h, its measured height, to the
   page's scroll padding) */

/* The phone: a short sheet at the very bottom, over the tab bar on browse pages and standing directly on the
   action bar when one is showing (--act-now, base.css), so it never covers "Add to basket", "Apply" or "Call now".
   The badge is not drawn; the title runs on into the sentence, which stays whole; the three buttons stay equal,
   48px high and on one row; the foot line is cut down to its link (the sentence is repeated in the dialog that
   "Choose" opens). */
.consent-banner { left: 0; right: 0; bottom: var(--act-now, 0px); width: auto; }
.consent-banner__card { max-height: 72vh; max-height: 72dvh; overflow-y: auto; padding: 14px max(16px, var(--safe-r, 0px)) calc(10px + var(--safe-b, env(safe-area-inset-bottom, 0px))) max(16px, var(--safe-l, 0px)); border-radius: 20px 20px 0 0; font-size: .8125rem; line-height: 1.4; box-shadow: 0 -1px 0 rgba(16, 11, 52, .06), 0 -18px 50px rgba(16, 11, 52, .2); }
:where(html:has(.actbar:not([hidden]):not(.is-away))) .consent-banner__card { padding-bottom: 10px; border-radius: 20px; }
.consent-banner__card::before { height: 4px; }
.consent-banner__head { display: inline; margin: 0; }
.consent-banner__badge { display: none; }
.consent-banner__title { display: inline; margin: 0 .3em 0 0; font-size: 1rem; line-height: 1.4; }
.consent-banner__text { display: inline; margin: 0; font-size: .8125rem; line-height: 1.4; }
.consent-banner__actions { gap: 6px; margin-top: 10px; }
.consent-btn { min-height: 48px; padding: 0 6px; font-size: .875rem; }
.consent-banner__foot { margin-top: 2px; font-size: 0; line-height: 0; text-align: center; }
.consent-banner__foot a { display: inline-flex; align-items: center; min-height: 32px; font-size: .8125rem; line-height: 1.2; }
/* ---------------------------------------------------------------------------------------------- the dialog */
.consent-dialog {
  width: min(680px, calc(100vw - 32px)); max-width: none; max-height: min(88vh, 820px); margin: auto; padding: 0; border: 0;
  border-radius: 28px; background: var(--c-page); color: var(--c-navy); box-shadow: var(--c-pop); overflow: hidden;
}
.consent-dialog:not([open]) { display: none; }
.consent-dialog::backdrop { background: rgba(16, 11, 52, .56); }
.consent-dialog[open] { animation: consent-pop 240ms cubic-bezier(.2, .7, .2, 1) both; }
.consent-dialog[open]::backdrop { animation: consent-fade 240ms ease-out both; }
.consent-dialog__form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(88vh, 820px); margin: 0; }
.consent-dialog__head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 28px 20px 18px 28px; background: #fff; border-bottom: 1px solid var(--c-hair); }
.consent-dialog__head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--c-mint), var(--c-lime) 55%, var(--c-coral)); }
.consent-dialog__eyebrow { margin: 0 0 4px; font: 700 .75rem/1.2 var(--c-body); letter-spacing: .09em; text-transform: uppercase; color: var(--c-muted); }
.consent-dialog__title { margin: 0; font: 700 1.625rem/1.15 var(--c-display); letter-spacing: -.015em; color: var(--c-ink); }
.consent-dialog__close { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -4px 0 0; padding: 0; border: 0; border-radius: 50%; background: var(--well, #F4F0E7); color: var(--c-navy); cursor: pointer; transition: background 150ms, color 150ms; }
.consent-dialog__scroll { overflow-y: auto; overscroll-behavior: contain; padding: 20px 28px 22px; }
.consent-dialog__intro { margin: 0 0 16px; font-size: 1rem; line-height: 1.55; color: var(--c-slate); }
.consent-dialog__note { margin: 16px 0 0; font-size: .875rem; line-height: 1.55; color: var(--c-muted); }
.consent-dialog__foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px 28px 20px; background: #fff; border-top: 1px solid var(--c-hair); }

.consent-cats { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.consent-cat { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; padding: 16px 16px 12px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px var(--c-hair); }
.consent-cat__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--c-ink); }
.consent-cat__icon--necessary { background: var(--panel, #F7F4FB); box-shadow: inset 0 0 0 1px #E6E0F2; }
.consent-cat__icon--preferences { background: var(--c-lime); }
.consent-cat__icon--analytics { background: var(--c-mint); }
.consent-cat__icon--advertising { background: var(--c-coral); }
.consent-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.consent-cat__title { font: 700 1.125rem/1.2 var(--c-display); color: var(--c-ink); cursor: pointer; }
.consent-cat__always { flex: none; display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--c-ink); color: #fff; font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.consent-cat__text { margin: 2px 0 4px; font-size: .9375rem; line-height: 1.55; color: var(--c-slate); }
.consent-cat__more summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: .875rem; font-weight: 600; color: var(--c-navy); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; list-style: none; border-radius: 6px; }
.consent-cat__more summary::-webkit-details-marker { display: none; }
.consent-cat__more summary .consent-icon { transition: transform 200ms; }
.consent-cat__more[open] summary .consent-icon { transform: rotate(180deg); }
.consent-cat__more ul { margin: 0 0 8px; padding: 12px 14px 12px 30px; border-radius: 12px; background: var(--c-page); font-size: .8125rem; line-height: 1.55; color: var(--c-slate); }
.consent-cat__more li + li { margin-top: 4px; }

/* the switch: a real checkbox (role="switch") laid over its track, 56 x 44 to press */
.consent-switch { position: relative; flex: none; display: inline-grid; place-items: center; width: 56px; height: 44px; }
.consent-switch__input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.consent-switch__track { position: relative; display: block; width: 54px; height: 32px; border: 2px solid var(--c-control); border-radius: 999px; background: #fff; transition: background 180ms, border-color 180ms; }
.consent-switch__thumb { position: absolute; top: 3px; left: 3px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c-control); transition: transform 180ms cubic-bezier(.2, .7, .2, 1), background 180ms; }
.consent-switch__thumb::after { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid var(--c-navy); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform 180ms; }
.consent-switch__input:checked + .consent-switch__track { background: var(--c-navy); border-color: var(--c-navy); }
.consent-switch__input:checked + .consent-switch__track .consent-switch__thumb { transform: translateX(22px); background: var(--c-mint); }
.consent-switch__input:checked + .consent-switch__track .consent-switch__thumb::after { transform: rotate(45deg) scale(1); }
.consent-switch__input:focus-visible + .consent-switch__track { outline: 3px solid var(--c-navy); outline-offset: 3px; }

/* The phone: "Cookie settings" is a sheet from the bottom. */
.consent-dialog { width: 100vw; max-height: 94vh; max-height: 94dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
.consent-dialog__form { max-height: 94vh; max-height: 94dvh; }
.consent-dialog__head { padding: 24px 12px 14px 16px; }
.consent-dialog__title { font-size: 1.375rem; }
.consent-dialog__scroll { padding: 16px 16px 18px; }
.consent-dialog__intro { font-size: .9375rem; }
.consent-dialog__foot { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
.consent-dialog__foot .consent-btn--save { grid-column: 1 / -1; }
.consent-cat { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px 12px 10px 14px; }
.consent-cat__icon { width: 40px; height: 40px; border-radius: 12px; }
.consent-cat__title { font-size: 1.0625rem; }
.consent-cat__text { font-size: .875rem; }

/* Without the script: "Choose", the footer's "Cookie settings" and the cookies page's button all go to
   #cookie-settings, and the settings show as the script's dialog does (a sheet on a phone, centred from 700px),
   over the page and the banner, with the same switches and the same three buttons. A choice is a plain post to
   /api/consent (the same route, cookie and record as the banner's own buttons; back to the same page, where the
   address no longer names the settings); the close link leaves without changing anything. */
.no-js .consent-dialog:target { display: block; position: fixed; inset: 0; z-index: 90; box-shadow: 0 0 0 100vmax rgba(16, 11, 52, .56), var(--c-pop); }
html.no-js:has(.consent-dialog:target) { overflow: hidden; }

@keyframes consent-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes consent-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes consent-fade { from { opacity: 0; } to { opacity: 1; } }

/* ===== 2 TABLET AND UP ===== */
/* TABLET_DESKTOP_SPEC WA9: a strip at the foot of the window (words left, the three equal buttons right in one
   row); one slim bar on WIDE windows and on a phone on its side. It stands on top of any bar at the foot (the
   action bar, the compare tray), never over it. */
@media (min-width: 700px) {
  .consent-banner { left: 0; right: 0; bottom: max(var(--act-now, 0px), var(--tray-now, 0px)); width: auto; }
  .consent-banner__card { display: grid; grid-template-columns: minmax(0, 1fr) 372px; align-items: center; gap: 2px 20px; max-height: none; overflow: visible; padding: 14px var(--gutter, 24px) 10px; border-radius: 20px 20px 0 0; font-size: inherit; line-height: 1.4; }
  :where(html:has(.actbar:not([hidden]):not(.is-away))) .consent-banner__card { padding-bottom: 10px; border-radius: 20px 20px 0 0; }
  .consent-banner__head { display: flex; grid-column: 1; align-items: center; margin: 0 0 2px; gap: 10px; }
  .consent-banner__badge { display: grid; width: 32px; height: 32px; box-shadow: none; }
  .consent-banner__badge svg { width: 20px; height: 20px; }
  .consent-banner__title { display: block; max-width: none; margin: 0; font-size: 1.0625rem; line-height: 1.25; }
  .consent-banner__text { display: block; grid-column: 1; margin: 0; font-size: .8125rem; line-height: 1.4; }
  .consent-banner__foot { grid-column: 1; margin: 0; font-size: .75rem; line-height: 1.35; text-align: left; }   /* the whole sentence again, not only its link */
  .consent-banner__foot a { display: inline; min-height: 0; font-size: inherit; line-height: inherit; }
  .consent-banner__actions { grid-column: 2; grid-row: 1 / span 3; gap: 8px; margin: 0; }
  .consent-btn { min-height: 48px; padding: 0 14px; font-size: .9375rem; }
  /* the cookie settings: a centred dialog */
  .consent-dialog { width: min(680px, calc(100vw - 32px)); max-height: min(88vh, 820px); margin: auto; border-radius: 28px; }
  .consent-dialog__form { max-height: min(88vh, 820px); }
  .consent-dialog__head { padding: 28px 20px 18px 28px; }
  .consent-dialog__title { font-size: 1.625rem; }
  .consent-dialog__scroll { padding: 20px 28px 22px; }
  .consent-dialog__intro { font-size: 1rem; }
  .consent-dialog__foot { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px 28px 20px; }
  .consent-dialog__foot .consent-btn--save { grid-column: auto; }
  .consent-cat { grid-template-columns: 46px minmax(0, 1fr); gap: 14px; padding: 16px 16px 12px; }
  .consent-cat__icon { width: 46px; height: 46px; border-radius: 14px; }
  .consent-cat__title { font-size: 1.125rem; }
  .consent-cat__text { font-size: .9375rem; }
}
/* one slim bar, the words running on from the title: WIDE windows, an upright window 700px or wider that is 800px
   high or less (a split or resized window, a foldable: the taller strip covered "Add to basket", Apply and the
   slide's credit panel), and a phone on its side. (Not a LANDSCAPE window 700 to 999px wide and up to 800px high:
   there the strip covers the slide's credit panel whole, where the slim bar would cut it between the monthly
   figure and its APR.) */
@media (min-width: 1000px), (min-width: 700px) and (max-height: 520px), (min-width: 700px) and (max-height: 800px) and (orientation: portrait) {
  .consent-banner__card { display: block; padding: 12px calc(max(var(--gutter, 32px), (100vw - var(--wrap, 1280px)) / 2) + 392px) 8px max(var(--gutter, 32px), calc((100vw - var(--wrap, 1280px)) / 2)); border-radius: 0; font-size: .8125rem; line-height: 1.35; }
  :where(html:has(.actbar:not([hidden]):not(.is-away))) .consent-banner__card { padding-bottom: 8px; border-radius: 0; }
  .consent-banner__card::before { height: 4px; }
  .consent-banner__head { float: left; margin: 0 10px 0 0; gap: 8px; }
  .consent-banner__badge { display: none; }
  .consent-banner__title { font-size: .875rem; line-height: 1.35; }
  .consent-banner__text, .consent-banner__foot { display: inline; margin: 0; font-size: .8125rem; line-height: 1.35; }
  .consent-banner__text::after { content: " "; }
  /* the foot is cut to its link here (as on a phone; the sentence is in the dialog "Choose" opens) and the badge
     is not drawn: with them the bar was four lines (90px) from 1000 to 1365px wide, not three (73px) */
  .consent-banner__foot { font-size: 0; }
  .consent-banner__foot a { font-size: .8125rem; }
  .consent-banner__actions { position: absolute; right: max(var(--gutter, 32px), calc((100vw - var(--wrap, 1280px)) / 2)); top: 50%; width: 372px; transform: translateY(-50%); }
}

/* a phone on its side (700px or wider, 520px high or less), and any window from 700 to 999px wide that is 800px
   high or less: narrower equal buttons, so the words take fewer lines */
@media (min-width: 700px) and (max-height: 520px), (min-width: 700px) and (max-width: 999.98px) and (max-height: 800px) and (orientation: portrait) {
  .consent-banner__card { padding-right: calc(var(--gutter, 24px) + 332px); }
  .consent-banner__actions { right: var(--gutter, 24px); width: 316px; }
  .consent-btn { padding: 0 8px; }
}
@media (min-width: 700px) and (max-width: 999.98px) and (max-height: 800px) and (min-height: 520.02px) and (orientation: portrait) {
  .consent-banner__card { padding-top: 10px; padding-bottom: 6px; }
  :where(html:has(.actbar:not([hidden]):not(.is-away))) .consent-banner__card { padding-bottom: 6px; }
}

/* ===== 3 DESKTOP ===== */
@media (min-width: 1200px) {
  .consent-btn { min-height: 44px; }
}

/* ===== 4 CAPABILITY AND MODES ===== */
@media (hover: hover) and (pointer: fine) {
  .consent-btn:hover { background: var(--c-slate); border-color: var(--c-slate); }
  .consent-btn--choose:hover, .consent-btn--line:hover { background: var(--c-navy); border-color: var(--c-navy); color: #fff; }
  .consent-banner__foot a:hover, .consent-dialog__note a:hover { text-decoration-thickness: 2px; }
  .consent-dialog__close:hover { background: var(--c-navy); color: #fff; }
  .consent-switch__input:hover + .consent-switch__track { border-color: var(--c-navy); }
}
@media (prefers-reduced-motion: reduce) {
  .consent-banner__card, .consent-dialog[open], .consent-dialog[open]::backdrop { animation: none; }
  .consent-btn, .consent-switch__track, .consent-switch__thumb, .consent-switch__thumb::after, .consent-cat__more summary .consent-icon, .consent-dialog__close { transition: none; }
}
@media print { .consent-banner, .consent-dialog { display: none !important; } }
