/* =======================================================================
   Shemify — Products Session 4 (Phase 2b / Session 4.6)
   -----------------------------------------------------------------------
   Glass-theme styles for:
     • Auto-fill banner (catalog match confirmation, Session 4.6)
     • Image strip (primary + extras, drag-reorder)
     • Unified name-field catalog search dropdown (Session 4.6)
     • Batch-mode toggle + drawer + save-all validation modal
     • First-vote toast
   Tokens: see app/design-tokens.css (gold #C8A04C, --r, --r-sm, --r-lg,
   --spring, --glass-card, etc.). Never raw hex here — all via vars.
   ======================================================================= */


/* ========================= AUTO-FILL BANNER ========================== */
/* Session 4.6: replaces the old per-field chip suggestion slot. Compact
   single-row pill that reads "✓ Auto-filled from catalog · {name}" with
   a trailing "Clear and enter manually" link-button. Appears ABOVE the
   product-modal form whenever a catalog match auto-populates fields. */

.s4-autofill-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(74,222,128,.10) 0%, rgba(74,222,128,.035) 100%),
    var(--glass-card);
  border-radius: var(--r-sm);
  box-shadow:
    inset 0 0 0 1px rgba(74,222,128,.18),
    0 2px 10px rgba(0,0,0,.18),
    0 0 20px rgba(74,222,128,.04);
  position: relative;
  overflow: hidden;
  animation: s4-autofill-in .35s var(--spring) both;
}
@keyframes s4-autofill-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.s4-autofill-banner[hidden] { display: none; }
.s4-autofill-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green) 0%, #35B368 100%);
  color: var(--void);
  box-shadow:
    0 0 0 3px rgba(74,222,128,.12),
    0 0 14px rgba(74,222,128,.35),
    inset 0 1px 0 rgba(255,255,255,.2);
}
.s4-autofill-icon svg {
  width: 12px; height: 12px;
  stroke: currentColor;
  fill: none;
}
.s4-autofill-text {
  flex: 1;
  font-size: 12.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.s4-autofill-text strong {
  color: var(--ink);
  font-weight: 600;
}
.s4-autofill-clear {
  padding: 5px 10px;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .18s var(--spring);
  white-space: nowrap;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.s4-autofill-clear:hover {
  color: var(--ink);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.s4-autofill-clear:active { transform: scale(.97); }


/* ========================== IMAGE STRIP ============================== */
/* Multi-image tiles above the single file input. First is primary. Drag
   to reorder. Existing catalog images show a "Catalog" source chip. */

#s4-image-strip {
  margin: 10px 0 14px;
}
.s4-img-strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.s4-img-strip-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.s4-img-strip-hint {
  font-size: 10.5px;
  color: var(--ink-4);
}
.s4-img-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.s4-img-tile {
  position: relative;
  width: 84px; height: 84px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--raised);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.06),
    0 2px 8px rgba(0,0,0,.25);
  cursor: grab;
  transition: transform .2s var(--spring), box-shadow .2s var(--spring);
}
.s4-img-tile:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(200,160,76,.25),
    0 6px 18px rgba(0,0,0,.35);
}
.s4-img-tile.dragging {
  opacity: .55;
  cursor: grabbing;
  transform: scale(.97);
}
.s4-img-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.s4-img-badge {
  position: absolute;
  top: 4px; left: 4px;
  padding: 2px 7px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--void);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(200,160,76,.35), inset 0 1px 0 rgba(255,255,255,.3);
}
.s4-img-src-chip {
  position: absolute;
  bottom: 4px; left: 4px;
  padding: 2px 7px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-glow);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.25);
}
.s4-img-rm {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(6,6,8,.7);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all .18s var(--spring);
  opacity: 0;
}
.s4-img-tile:hover .s4-img-rm { opacity: 1; }
.s4-img-rm:hover {
  background: rgba(248,113,113,.24);
  color: var(--red);
}
.s4-img-rm svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.4; fill: none; }
.s4-img-primary-btn {
  position: absolute;
  bottom: 4px; right: 4px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(6,6,8,.7);
  backdrop-filter: blur(6px);
  border: none;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  cursor: pointer;
  opacity: 0;
  transition: all .18s var(--spring);
}
.s4-img-tile:hover .s4-img-primary-btn { opacity: 1; }
.s4-img-primary-btn:hover {
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.4), 0 0 10px rgba(200,160,76,.15);
}
.s4-img-add {
  width: 84px; height: 84px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255,255,255,.02);
  border: 2px dashed rgba(255,255,255,.1);
  border-radius: var(--r-sm);
  color: var(--ink-3);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  transition: all .22s var(--spring);
}
.s4-img-add svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.s4-img-add:hover {
  border-color: var(--gold);
  background: rgba(200,160,76,.06);
  color: var(--gold-bright);
  transform: translateY(-1px);
}


/* ===================== NAME-FIELD SEARCH DROPDOWN ==================== */
/* Session 4.6: the separate catalog search input has been removed. The
   product-name field (#settings-product-name) doubles as a catalog search
   — typing 3+ chars opens this dropdown anchored below the field. Pattern
   mirrors the category combobox (sfy_products_v2.js Section 8.11). */

.s4-search-dd.s4-name-search-dd {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
  background: var(--elevated);
  border-radius: var(--r);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.08),
    0 8px 32px rgba(0,0,0,.5),
    0 16px 48px rgba(0,0,0,.3);
  backdrop-filter: blur(20px);
  padding: 6px;
}
.s4-search-dd {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
  background: var(--elevated);
  border-radius: var(--r);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.08),
    0 8px 32px rgba(0,0,0,.5);
  backdrop-filter: blur(20px);
  padding: 6px;
}
.s4-search-dd[hidden] { display: none; }
.s4-search-item {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .15s var(--spring);
}
.s4-search-item:hover,
.s4-search-item-sel {
  background: rgba(200,160,76,.08);
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.16);
}
.s4-search-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.s4-search-item-meta {
  display: flex;
  gap: 10px;
  font-size: 10.5px;
}
.s4-search-item-brand { color: var(--ink-2); }
.s4-search-item-bc {
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}


/* ===================== BATCH MODE — TOGGLE BUTTON ==================== */
/* Lives in the Products page topbar. Count badge shows when items > 0.
   Active state (batchMode=true) gets a golden gradient. */

.s4-batch-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .22s var(--spring);
}
.s4-batch-toggle svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
}
.s4-batch-toggle.s4-batch-toggle-active {
  background: linear-gradient(180deg, rgba(200,160,76,.2) 0%, rgba(200,160,76,.08) 100%);
  color: var(--gold-bright);
  box-shadow:
    inset 0 0 0 1px rgba(200,160,76,.3),
    0 2px 10px rgba(200,160,76,.15);
}
.s4-batch-count {
  min-width: 18px; height: 18px;
  padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--void);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(200,160,76,.35), inset 0 1px 0 rgba(255,255,255,.3);
}
.s4-batch-count[hidden] { display: none; }


/* ==================== BATCH MODE — SIDE DRAWER ======================= */
/* Portal to body. Slides in from right. z-index above page shell but
   below modal (saveall modal uses z-index 1000+). */

#s4-batch-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 92vw;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(30,30,40,.85) 0%, rgba(10,10,14,.95) 100%),
    var(--base);
  backdrop-filter: blur(24px) saturate(1.5);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.06),
    -8px 0 40px rgba(0,0,0,.5),
    -40px 0 80px rgba(0,0,0,.3);
  transform: translateX(100%);
  transition: transform .44s cubic-bezier(.34, 1.2, .64, 1);
}
#s4-batch-drawer.open { transform: translateX(0); }
#s4-batch-drawer[hidden] { display: none; }
.s4-batch-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 24px 16px;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.05);
}
.s4-batch-drawer-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.s4-batch-drawer-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  text-shadow: 0 0 24px rgba(200,160,76,.06);
}
.s4-batch-drawer-sub {
  font-size: 11.5px;
  color: var(--ink-3);
}
.s4-batch-drawer-close {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04);
  border: none;
  border-radius: 50%;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .18s var(--spring);
}
.s4-batch-drawer-close:hover {
  background: rgba(255,255,255,.08);
  color: var(--ink);
  transform: rotate(90deg);
}
.s4-batch-drawer-close svg { fill: none; stroke: currentColor; }
.s4-batch-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}
.s4-batch-drawer-foot {
  display: flex;
  gap: 10px;
  padding: 16px 20px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.s4-batch-drawer-foot > button { flex: 1; }

/* empty state */
.s4-batch-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-3);
}
.s4-batch-empty-icon {
  margin-bottom: 12px;
  opacity: .45;
}
.s4-batch-empty-icon line,
.s4-batch-empty-icon rect {
  stroke: currentColor;
  fill: none;
}
.s4-batch-empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 3px;
}
.s4-batch-empty-sub {
  font-size: 11.5px;
  color: var(--ink-4);
}

/* batch row */
.s4-batch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: var(--glass-card);
  border-radius: var(--r-sm);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.04),
    0 2px 6px rgba(0,0,0,.2);
  transition: all .2s var(--spring);
}
.s4-batch-row:hover {
  background: rgba(255,255,255,.04);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.08),
    0 4px 12px rgba(0,0,0,.3);
}
.s4-batch-row-main {
  flex: 1;
  min-width: 0;
}
.s4-batch-row-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.s4-batch-row-name-em {
  font-style: italic;
  color: var(--ink-4);
  font-weight: 400;
}
.s4-batch-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ink-3);
  align-items: center;
}
.s4-batch-row-bc { font-variant-numeric: tabular-nums; color: var(--ink-4); }
.s4-batch-row-price {
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.s4-batch-row-cat { color: var(--ink-2); }
.s4-batch-row-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.s4-batch-row-edit,
.s4-batch-row-rm {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .18s var(--spring);
}
.s4-batch-row-edit:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.s4-batch-row-rm:hover { background: rgba(248,113,113,.12); color: var(--red); }
.s4-batch-row-edit svg,
.s4-batch-row-rm svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* status pills */
.s4-batch-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 999px;
  white-space: nowrap;
}
.s4-batch-pill-green {
  color: var(--green);
  background: var(--green-glow);
  box-shadow: inset 0 0 0 1px rgba(74,222,128,.2);
}
.s4-batch-pill-amber {
  color: var(--amber);
  background: var(--amber-glow);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.22);
}
.s4-batch-pill-red {
  color: var(--red);
  background: var(--red-glow);
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.2);
}
.s4-batch-pill-blue {
  color: var(--blue);
  background: var(--blue-glow);
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.2);
}
.s4-batch-pill-ink {
  color: var(--ink-2);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}


/* ===================== SAVE-ALL VALIDATION MODAL ===================== */
/* Uses portal + backdrop-blur like existing modals. Shell scales down
   behind it for parallax depth. */

#s4-saveall-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s var(--spring);
}
#s4-saveall-modal.open { opacity: 1; pointer-events: auto; }
.s4-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0);
  transition:
    background .36s var(--spring),
    backdrop-filter .36s var(--spring);
}
#s4-saveall-modal.open .s4-modal-backdrop {
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(16px);
}
.s4-modal-panel {
  position: relative;
  width: 90vw;
  max-width: 460px;
  background: linear-gradient(180deg, var(--floating) 0%, var(--elevated) 100%);
  border-radius: var(--r-xl);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.08),
    0 8px 32px rgba(0,0,0,.5),
    0 40px 80px rgba(0,0,0,.3),
    0 0 60px rgba(200,160,76,.05);
  transform: translateY(24px) scale(.96);
  filter: blur(4px);
  opacity: 0;
  transition:
    transform .55s cubic-bezier(.34, 1.4, .64, 1),
    filter .36s var(--spring),
    opacity .36s var(--spring);
}
#s4-saveall-modal.open .s4-modal-panel {
  transform: translateY(0) scale(1);
  filter: blur(0);
  opacity: 1;
}
.s4-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 24px 4px;
}
.s4-modal-head h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0;
  text-shadow: 0 0 24px rgba(200,160,76,.06);
}
.s4-modal-close {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04);
  border: none;
  border-radius: 50%;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .18s var(--spring);
}
.s4-modal-close:hover {
  background: rgba(255,255,255,.08);
  color: var(--ink);
  transform: rotate(90deg);
}
.s4-modal-close svg { fill: none; stroke: currentColor; stroke-width: 2; }
.s4-modal-body { padding: 12px 24px 8px; }
.s4-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 20px;
}
.s4-saveall-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.s4-saveall-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.02);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.s4-saveall-row > b {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.s4-saveall-sub {
  flex: 1;
  font-size: 11.5px;
  color: var(--ink-3);
}
.s4-saveall-note {
  margin: 0;
  padding: 10px 12px;
  background: var(--amber-glow);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.15);
  color: var(--amber);
  font-size: 11.5px;
  line-height: 1.4;
}


/* ============================ TOASTS ================================= */
/* Position fixed top-right. Spring-in from right. Auto-dismiss. Distinct
   from existing Shemify toast system (.sfy-s4-* prefix isolates them). */

.sfy-s4-toast {
  position: fixed;
  top: 80px; right: 24px;
  z-index: 10000;
  max-width: 360px;
  padding: 12px 16px;
  background: var(--elevated);
  backdrop-filter: blur(16px);
  border-radius: var(--r);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.08),
    0 8px 32px rgba(0,0,0,.4),
    0 0 1px rgba(255,255,255,.06);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(20px);
  transition:
    opacity .4s cubic-bezier(.34, 1.4, .64, 1),
    transform .4s cubic-bezier(.34, 1.4, .64, 1);
  pointer-events: none;
}
.sfy-s4-toast.in {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.sfy-s4-toast-success {
  box-shadow:
    inset 0 0 0 1px rgba(74,222,128,.2),
    0 8px 32px rgba(0,0,0,.4),
    0 0 24px rgba(74,222,128,.08);
}
.sfy-s4-toast-success::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(74,222,128,.5);
  vertical-align: middle;
}
.sfy-s4-toast-info::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px rgba(96,165,250,.5);
  vertical-align: middle;
}
.sfy-s4-toast-error {
  box-shadow:
    inset 0 0 0 1px rgba(248,113,113,.22),
    0 8px 32px rgba(0,0,0,.4),
    0 0 24px rgba(248,113,113,.08);
}
.sfy-s4-toast-error::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px rgba(248,113,113,.5);
  vertical-align: middle;
}
.sfy-s4-toast-warning {
  box-shadow:
    inset 0 0 0 1px rgba(251,191,36,.2),
    0 8px 32px rgba(0,0,0,.4),
    0 0 24px rgba(251,191,36,.06);
}
.sfy-s4-toast-warning::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px rgba(251,191,36,.5);
  vertical-align: middle;
}


/* =========================== RESPONSIVE ============================== */
/* At tablet breakpoint, drawer consumes full width; image tiles shrink
   slightly. Retain Glass aesthetic. */

@media (max-width: 640px) {
  #s4-batch-drawer { width: 100vw; max-width: 100vw; }
  .s4-img-tile, .s4-img-add { width: 72px; height: 72px; }
  .s4-autofill-banner {
    padding: 9px 12px;
    gap: 8px;
  }
  .s4-autofill-clear {
    padding: 4px 8px;
    font-size: 10.5px;
  }
  .sfy-s4-toast {
    right: 12px; left: 12px; max-width: unset;
    top: 70px;
  }
}


/* =========================== LIGHT MODE ============================== */
/* Glass-theme tokens handle most colors via vars. Explicit overrides for
   situations where a raw rgba goes wrong on light bg. */

html.light .s4-autofill-banner,
html[data-theme="light"] .s4-autofill-banner {
  background:
    linear-gradient(180deg, rgba(34,150,72,.08) 0%, rgba(34,150,72,.03) 100%),
    var(--glass-card);
  box-shadow:
    inset 0 0 0 1px rgba(34,150,72,.22),
    0 2px 10px rgba(0,0,0,.06),
    0 0 18px rgba(34,150,72,.04);
}
html.light .s4-autofill-icon,
html[data-theme="light"] .s4-autofill-icon {
  background: linear-gradient(135deg, #2E9E53 0%, #1F8A42 100%);
  color: #FAFAF8;
}
html.light .s4-batch-row:hover,
html[data-theme="light"] .s4-batch-row:hover {
  background: rgba(0,0,0,.03);
}
html.light #s4-batch-drawer,
html[data-theme="light"] #s4-batch-drawer {
  background:
    linear-gradient(180deg, rgba(250,250,248,.92) 0%, rgba(240,240,236,.95) 100%),
    var(--base);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.05),
    -8px 0 40px rgba(0,0,0,.12),
    -40px 0 80px rgba(0,0,0,.08);
}
