/* Shop helpers of every page (docs/17 R19): the floating compare bar (js/elbuz_compare.js), the pre-order status
   (js/elbuz_preorder.js) and the header picker of a profile field (js/elbuz_profile.js). Tokens only. */

/* ---- compare bar: fixed at the bottom centre, a dark plate with up to 4 photos ---- */
.et-cmpbar {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 1040; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.75rem; width: min(100% - 1.5rem, 54rem); padding: 0.5rem 0.5rem 0.5rem 1rem;
  border-radius: var(--et-radius); background: var(--et-footer-bg, var(--et-text)); color: var(--et-footer-text, var(--et-bg));
  box-shadow: var(--et-shadow-lg, 0 20px 50px -20px rgb(0 0 0 / 0.5));
}
.et-cmpbar[hidden] { display: none; }
.et-cmpbar__t { display: grid; gap: 0.125rem; margin: 0; font-size: var(--et-text-sm); white-space: nowrap; }
.et-cmpbar__title { font-weight: 700; }
.et-cmpbar__count { font-family: var(--et-font-mono); font-size: var(--et-text-xs); opacity: 0.75; }
.et-cmpbar__list { display: flex; gap: 0.375rem; flex: 1; min-width: 0; margin: 0; padding: 0.375rem 0.25rem; overflow-x: auto; list-style: none; }
.et-cmpbar__item { position: relative; flex: none; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: var(--et-radius-sm); background: color-mix(in srgb, var(--et-footer-text, var(--et-bg)) 12%, transparent); }
.et-cmpbar__item.is-empty { background: none; box-shadow: inset 0 0 0 var(--et-border-width) color-mix(in srgb, var(--et-footer-text, var(--et-bg)) 25%, transparent); }
.et-cmpbar__item img { width: 2.75rem; height: 2.75rem; object-fit: contain; border-radius: var(--et-radius-xs); background: var(--et-surface); }
.et-cmpbar__rm {
  position: absolute; top: -0.375rem; right: -0.375rem; display: grid; place-items: center; width: 1.375rem; height: 1.375rem;
  border: 0; border-radius: 50%; background: var(--et-surface); color: var(--et-text); font-size: 0.9rem; line-height: 1; cursor: pointer;
}
.et-cmpbar__rm::after { content: ""; position: absolute; inset: -0.6rem; } /* a 44 px touch target */
.et-cmpbar__act { display: flex; align-items: center; gap: 0.5rem; }
.et-cmpbar__clear { min-height: 2.75rem; padding: 0 0.5rem; border: 0; background: none; color: inherit; font: inherit; font-size: var(--et-text-sm); text-decoration: underline; text-underline-offset: 3px; opacity: 0.8; cursor: pointer; }
.et-cmpbar__clear:hover { opacity: 1; }
.et-cmpbar__open { white-space: nowrap; }
.et-cmpbar :focus-visible { outline: 2px solid var(--et-accent); outline-offset: 2px; }
/* the bar must not cover the mobile buy bar and the floating tools */
html.et-has-cmpbar:has(.et-mobile-buybar) .et-cmpbar { bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
@media (max-width: 575.98px) {
  .et-cmpbar { gap: 0.5rem; padding-left: 0.625rem; }
  .et-cmpbar__t { display: none; }
  .et-cmpbar__clear { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .et-cmpbar:not([hidden]) { animation: et-cmpbar-in var(--et-motion-medium, 0.26s) var(--et-motion-ease, ease); }
  @keyframes et-cmpbar-in { from { opacity: 0; transform: translate(-50%, 1rem); } }
}

/* ---- pre-order: a badge, the arrival date, the product page box ---- */
.et-card__badge--pre { background: var(--et-pre, var(--et-warning)); color: var(--et-on-status, #111); }
.et-card__preorder { margin: 0.25rem 0 0; font-size: var(--et-text-xs); color: var(--et-text-secondary); }
.et-preorder { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.5rem 0; }
.et-preorder__badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.625rem; border-radius: var(--et-radius-xs); background: var(--et-pre, var(--et-warning)); color: var(--et-on-status, #111); font-size: var(--et-text-sm); font-weight: 700; }
.et-preorder__date { font-size: var(--et-text-sm); color: var(--et-text-secondary); }
.is-preorder.et-buybox__cart-btn, .et-card .is-preorder[data-cart] { background: var(--et-pre, var(--et-warning)); border-color: var(--et-pre, var(--et-warning)); color: var(--et-on-status, #111); }

/* ---- header picker of a profile field ("My device") ---- */
.et-profile-pick { display: inline-flex; align-items: center; gap: 0.5rem; width: auto; padding: 0.25rem 0.75rem 0.25rem 0.375rem; border: 0; border-radius: var(--et-radius-sm); background: var(--et-surface-2); color: var(--et-text); font: inherit; cursor: pointer; }
.et-profile-pick:hover { background: var(--et-surface-3, var(--et-surface-2)); }
.et-profile-pick img { width: 1.75rem; height: 1.75rem; object-fit: contain; }
.et-profile-pick img[hidden] { display: none; }
.et-profile-pick span { display: grid; line-height: 1.15; text-align: start; }
.et-profile-pick small { font-size: var(--et-text-xs); color: var(--et-text-muted); }
.et-profile-pick b { max-width: 12ch; overflow: hidden; font-size: var(--et-text-sm); text-overflow: ellipsis; white-space: nowrap; }
.et-profile-pick.is-set { box-shadow: inset 0 0 0 calc(var(--et-border-width) * 1.5) var(--et-accent); }
@media (max-width: 767.98px) { .et-profile-pick span { display: none; } .et-profile-pick { padding: 0.25rem; } }
.et-pick { width: min(100% - 2rem, 32rem); max-height: 85dvh; padding: 0; border: 0; border-radius: var(--et-radius); background: var(--et-surface); color: var(--et-text); box-shadow: var(--et-shadow-lg, 0 20px 50px -20px rgb(0 0 0 / 0.5)); }
.et-pick::backdrop { background: rgb(0 0 0 / 0.45); }
.et-pick__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 0.5rem 1.25rem; }
.et-pick__head h2 { margin: 0; font-size: var(--et-text-xl); }
.et-pick__close { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: var(--et-radius-sm); background: var(--et-surface-2); color: var(--et-text); font-size: 1.25rem; cursor: pointer; }
.et-pick__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.5rem; padding: 0.5rem 1.25rem 1rem; }
.et-pick__list label { position: relative; display: grid; justify-items: center; gap: 0.375rem; margin: 0; padding: 0.75rem 0.5rem; border-radius: var(--et-radius-sm); background: var(--et-surface-2); text-align: center; font-size: var(--et-text-sm); font-weight: 600; cursor: pointer; }
.et-pick__list input { position: absolute; opacity: 0; }
.et-pick__list img { width: 3.5rem; height: 3.5rem; object-fit: contain; }
.et-pick__list label:has(input:checked) { box-shadow: inset 0 0 0 calc(var(--et-border-width) * 2) var(--et-accent); background: var(--et-surface); }
.et-pick__list label:has(input:focus-visible) { outline: 2px solid var(--et-text); outline-offset: 2px; }
.et-pick__clear { margin: 0 1.25rem 1.25rem; min-height: 2.75rem; padding: 0; border: 0; background: none; color: var(--et-text-muted); font: inherit; font-size: var(--et-text-sm); text-decoration: underline; cursor: pointer; }
