/* ==========================================================================
   Smart Electrical — se-flyout.css (design/CartDrawer.dc.html)

   Salient isolation (build plan §8):
   - every rule is scoped under .se-flyout (plus the html scroll-lock class
     and the Salient-suppression block below) — no Salient classes used;
   - enqueued at wp_enqueue_scripts priority 999 so it prints after the
     theme's stylesheets; Salient's style-non-critical.css prints from
     wp_footer AFTER us, so rules win on specificity (two+ class selectors),
     never on order;
   - !important appears ONLY where Salient's own JS/CSS forces a value first
     (inline display from its fadeIn/fadeOut, themed overlay z-indexes).

   Tokens carry local fallbacks because this stylesheet loads on every
   front-end page, while SE_Assets only inlines the :root token block on the
   cart, checkout and account screens; where that block is present it wins.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Salient cart suppression — the dropdown mini-cart and its add-to-cart
   notification must never surface again. Salient shows them with inline
   styles (jQuery fadeIn), hence !important (Salient used force first).
   -------------------------------------------------------------------------- */
#header-outer .cart-outer .widget_shopping_cart,
#header-outer .cart-notification,
.nectar-slide-in-cart,
.nectar-slide-in-cart-bg {
  display: none !important;
}

/* Scroll lock while the drawer is open. Salient manages body overflow for
   its own overlays, so the lock must out-rank it. */
html.se-flyout-lock,
html.se-flyout-lock body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Keep a wheel that reaches the end of the drawer inside the drawer: without
   this the page behind it takes over the scroll. */
.se-flyout,
.se-flyout .se-flyout__panel,
.se-flyout .se-flyout__body {
  overscroll-behavior: contain;
}

/* --------------------------------------------------------------------------
   1. Shell: overlay + panel
   -------------------------------------------------------------------------- */
.se-flyout {
  --sef-brand:      var(--se-brand, #303192);
  --sef-brand-dark: var(--se-brand-dark, #26277a);
  --sef-teal:       var(--se-teal, #303192);
  --sef-teal-text:  var(--se-teal-text, #303192);
  --sef-teal-tint:  var(--se-teal-tint, #ECEDF7);
  --sef-teal-tint2: var(--se-teal-tint-2, #F5F6FC);
  --sef-ink:        var(--se-ink, #202020);
  --sef-ink-soft:   var(--se-ink-soft, #212529);
  --sef-body:       var(--se-body, #4a4f56);
  --sef-sand:       var(--se-sand, #F4F3EF);
  --sef-paper:      var(--se-paper, #FAFAF8);
  --sef-line:       var(--se-line-soft, #EEEEEE);
  --sef-line-input: var(--se-line-input, #cccccc);
  --sef-error:      var(--se-error, #B3261E);
  --sef-error-bg:   var(--se-error-bg, #FDECEA);
  --sef-radius:     var(--se-radius-md, 4px);
  --sef-display:    var(--se-font-display, 'Open Sans', Helvetica, Arial, sans-serif);
  --sef-font:       var(--se-font-body, 'Manrope', system-ui, sans-serif);

  position: fixed;
  inset: 0;
  /* Above Salient's header (sticky header sits ~1000; its overlays use
     four-digit z-indexes with !important in places). */
  z-index: 100000 !important;
  display: flex;
  justify-content: flex-end;
  font-family: var(--sef-font);
  color: var(--sef-ink-soft);
  font-size: 14px;
  line-height: 1.5;
}
.se-flyout[hidden] { display: none; }

.se-flyout .se-flyout__overlay {
  position: absolute;
  inset: 0;
  background: var(--se-overlay, rgba(32, 32, 32, 0.45));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.se-flyout.is-open .se-flyout__overlay { opacity: 1; }

.se-flyout .se-flyout__panel {
  position: relative;
  /* The design prototype specified 440px; widened on request, and still
     min() so it goes full-bleed on phones. */
  width: min(100%, 520px);
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 40px -20px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  outline: none;
}
.se-flyout.is-open .se-flyout__panel { transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .se-flyout .se-flyout__overlay,
  .se-flyout .se-flyout__panel { transition: none; }
}

.se-flyout.is-busy .se-flyout__contents { opacity: 0.55; pointer-events: none; }

/* The fragment fills the panel. */
.se-flyout .se-flyout__contents {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  transition: opacity 0.15s ease;
}

/* Visually-hidden live region (appended to body, announced on updates). */
.se-flyout__announce {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   2. Header
   -------------------------------------------------------------------------- */
.se-flyout .se-flyout__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--sef-line);
  flex: none;
}
.se-flyout .se-flyout__title {
  margin: 0;
  font-family: var(--sef-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  color: var(--sef-ink);
}
.se-flyout .se-flyout__count {
  font-family: var(--sef-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--sef-body);
}
.se-flyout .se-flyout__close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--sef-line-input);
  border-radius: var(--sef-radius);
  background: #ffffff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--sef-ink);
  padding: 0;
}
.se-flyout .se-flyout__close:hover { border-color: var(--sef-ink); }
.se-flyout .se-flyout__close:focus-visible,
.se-flyout button:focus-visible,
.se-flyout a:focus-visible,
.se-flyout input:focus-visible {
  outline: 2px solid var(--se-teal-deep, #1d1e5e);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Body: lines, empty state, error notice
   -------------------------------------------------------------------------- */
.se-flyout .se-flyout__body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.se-flyout .se-flyout__error {
  margin: 14px 22px 0;
  background: var(--sef-error-bg);
  border-left: 3px solid var(--sef-error);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sef-ink);
}

.se-flyout .se-flyout__empty {
  padding: 48px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.se-flyout .se-flyout__empty b { font-size: 17px; color: var(--sef-ink); }
.se-flyout .se-flyout__empty span { font-size: 14px; color: var(--sef-body); }
.se-flyout .se-flyout__shop {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  padding: 0 22px;
  border-radius: var(--sef-radius);
  background: var(--sef-teal);
  color: #fff !important; /* Salient themes anchors with !important */
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.se-flyout .se-flyout__shop:hover { background: var(--se-teal-dark, #26277a); }

.se-flyout .se-flyout__lines { padding: 4px 22px; }

.se-flyout .se-flyout__line {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 10px 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--sef-line);
  align-items: start;
}

.se-flyout .se-flyout__thumb {
  width: 68px;
  height: 68px;
  background: var(--sef-sand);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
}
.se-flyout .se-flyout__thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.se-flyout .se-flyout__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--sef-body);
  min-width: 0;
}
.se-flyout .se-flyout__name { font-size: 15px; color: var(--sef-ink); font-weight: 700; }
/* Labelled line specs, as on the cart page. */
.se-flyout .se-flyout__specs {
  margin: 1px 0 2px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  font-size: 12.5px;
  line-height: 1.4;
}
.se-flyout .se-flyout__specs dt { margin: 0; color: var(--sef-muted, #6b7077); white-space: nowrap; }
.se-flyout .se-flyout__specs dd { margin: 0; color: var(--sef-ink, #202020); font-weight: 600; }
.se-flyout .se-flyout__linetotal { font-size: 15px; color: var(--sef-ink); font-weight: 700; }

.se-flyout .se-flyout__qtyrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.se-flyout .se-flyout__stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--sef-line-input);
  border-radius: var(--sef-radius);
  overflow: hidden;
  background: #ffffff;
}
.se-flyout .se-flyout__stepper button {
  width: 32px;
  min-height: 32px;
  border: 0;
  background: #ffffff;
  cursor: pointer;
  font-size: 15px;
  color: var(--sef-ink);
  padding: 0;
}
.se-flyout .se-flyout__stepper button:hover { background: var(--sef-paper); }
.se-flyout .se-flyout__stepper input {
  width: 64px;
  min-height: 32px;
  border: 0;
  border-left: 1px solid var(--sef-line);
  border-right: 1px solid var(--sef-line);
  text-align: center;
  font: inherit;
  font-weight: 700;
  color: var(--sef-ink);
  padding: 0 4px;
  background: #ffffff;
  appearance: textfield;
  -moz-appearance: textfield;
}
.se-flyout .se-flyout__stepper input::-webkit-outer-spin-button,
.se-flyout .se-flyout__stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.se-flyout .se-flyout__remove {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--sef-body);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  min-height: 32px;
}
.se-flyout .se-flyout__remove:hover { color: var(--sef-error); }

/* --------------------------------------------------------------------------
   4. Footer: totals, checkout, trust line
   -------------------------------------------------------------------------- */
.se-flyout .se-flyout__foot {
  border-top: 1px solid var(--sef-line);
  padding: 14px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #ffffff;
  flex: none;
}

.se-flyout .se-flyout__totals {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  font-size: 13px;
  color: var(--sef-body);
  background: var(--sef-sand);
  padding: 12px 14px;
  border-radius: var(--sef-radius);
}
.se-flyout .se-flyout__totals dt { margin: 0; font-weight: 500; }
.se-flyout .se-flyout__totals dd { margin: 0; text-align: right; color: var(--sef-ink); font-weight: 600; }

.se-flyout .se-flyout__grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.se-flyout .se-flyout__grand > span:first-child {
  /* One line, and set at the same size as the amount opposite it — a 15px
     label against a 24px figure read as a caption rather than its pair. */
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.se-flyout .se-flyout__grand b {
  font-family: var(--sef-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--sef-ink);
}
.se-flyout .se-flyout__grand small { font-size: 12px; color: var(--sef-body); }
.se-flyout .se-flyout__grand-amount {
  font-family: var(--sef-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--sef-ink);
}

.se-flyout .se-flyout__checkout {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--sef-radius);
  background: var(--sef-brand);
  color: #ffffff !important; /* Salient themes anchors with !important */
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.se-flyout .se-flyout__checkout:hover { background: var(--sef-brand-dark); }

.se-flyout .se-flyout__cartlink {
  align-self: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--sef-body) !important;
  text-decoration: underline;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.se-flyout .se-flyout__cartlink:hover { color: var(--sef-teal-text) !important; }

/* The trust items, each with its own icon. A list rather than one run of
   text so the icons pair with their label and the line wraps as whole items
   on narrow panels instead of orphaning an icon. */
.se-flyout .se-flyout__trust {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--sef-body);
}
.se-flyout .se-flyout__trust li {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  margin: 0;
}
.se-flyout .se-flyout__trust svg { color: var(--sef-teal-text); flex: none; }

/* ---------------------------------------------------------------------------
 * "Customers also buy" — the upsell carousel, from design/CartDrawer.dc.html.
 * Horizontal scroll-snap rather than a JS slider: it stays usable by touch,
 * trackpad and keyboard, and the arrows just nudge scrollLeft.
 * ------------------------------------------------------------------------- */
.se-flyout .se-flyout__ups {
  border-top: 1px solid var(--sef-line-soft, #eeeeee);
  background: var(--sef-paper, #fafaf8);
  padding: 12px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.se-flyout .se-flyout__ups-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
}
.se-flyout .se-flyout__ups-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--sef-body, #4a4f56);
}
.se-flyout .se-flyout__ups-nav { display: flex; gap: 6px; }
.se-flyout .se-flyout__ups-btn {
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--sef-line-input, #cccccc);
  border-radius: 4px;
  background: #ffffff;
  color: var(--sef-ink, #202020);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.se-flyout .se-flyout__ups-btn:hover { border-color: var(--sef-ink, #202020); }
.se-flyout .se-flyout__ups-btn:disabled { opacity: 0.35; cursor: default; }
.se-flyout .se-flyout__ups-btn:focus-visible {
  outline: 2px solid var(--sef-teal, #303192);
  outline-offset: 2px;
}

.se-flyout .se-flyout__ups-track {
  margin: 0;
  padding: 0 22px 4px;
  list-style: none;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 22px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.se-flyout .se-flyout__ups-track::-webkit-scrollbar { display: none; }
.se-flyout .se-flyout__ups-item {
  flex: 0 0 calc(100% - 64px);
  scroll-snap-align: start;
  margin: 0;
  /* Salient sets list-style: disc on li, which beats list-style: none on the
     ul — the bullets showed through on the carousel. Reset on the item too. */
  list-style: none;
  display: block;
}
.se-flyout .se-flyout__ups-item::marker { content: none; }
.se-flyout .se-flyout__ups-card {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--sef-line-soft, #eeeeee);
  border-radius: 4px;
  background: #ffffff;
  color: var(--sef-ink, #202020);
  text-decoration: none;
}
.se-flyout .se-flyout__ups-card:hover { border-color: var(--sef-ink, #202020); }
.se-flyout .se-flyout__ups-card:focus-visible {
  outline: 2px solid var(--sef-teal, #303192);
  outline-offset: 2px;
}
.se-flyout .se-flyout__ups-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: var(--sef-sand, #f4f3ef);
  display: block;
}
.se-flyout .se-flyout__ups-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.se-flyout .se-flyout__ups-name,
.se-flyout .se-flyout__ups-why {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.se-flyout .se-flyout__ups-name { font-size: 14px; }
.se-flyout .se-flyout__ups-why { font-size: 12px; color: var(--sef-body, #4a4f56); }
.se-flyout .se-flyout__ups-from { font-size: 12px; font-weight: 700; }
.se-flyout .se-flyout__ups-cta {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sef-teal-text, #303192);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .se-flyout .se-flyout__ups-track { scroll-behavior: auto; }
}

/* ==========================================================================
   Header cart bubble

   Salient ships the count hidden and reveals it from its own cart script —
   which this drawer unbinds, so the bubble never appeared. Show it whenever
   there is something in the cart, and keep it hidden at zero rather than
   displaying a "0" badge.
   ========================================================================== */
#header-outer a.cart-contents .cart-wrap span { visibility: hidden; }
#header-outer a.cart-contents.se-has-items .cart-wrap span,
body.se-cart-has-items #header-outer a.cart-contents .cart-wrap span { visibility: visible !important; }
