/* Demo layout.
   - Colors / shadows: Polaris tokens (--p-*) from @shopify/polaris-tokens.
   - Spacing, radii, and customer-account type scale: --x-* from shopify-account-x-tokens.css
     (parsed from your saved Account vendors CSS; rem values scaled to this page’s 16px root). */

/* Polaris icons: SVG sprites sourced from @shopify/polaris-icons (bundled in icons/polaris-symbols.svg) */
.polaris-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  fill: currentColor;
  pointer-events: none;
}
.polaris-icon use {
  pointer-events: none;
}
.search-field .polaris-icon {
  color: var(--p-color-icon-secondary);
}
.field-floating__icon .polaris-icon {
  display: block;
}
.calendar-nav .polaris-icon {
  display: block;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Restore 16px rem root after linked Shopify base (62.5%); keeps demo spacing predictable. */
html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  /* Let document height follow content (embedded previews sometimes assume a fixed viewport). */
  height: auto;
  max-height: none;
  overflow-y: visible;
  /* Shared shell: topbar outer width = inner column width + 2rem each side (see .revert-topbar). */
  --revert-layout-max: 75rem;
  --revert-layout-pad-x: var(--x-spacing-large-200);
  --revert-topbar-pad-x: 2rem;
}

body {
  margin: 0;
  font-family: var(--p-font-family-sans);
  font-size: var(--p-text-body-md-font-size);
  line-height: var(--p-text-body-md-font-line-height);
  font-weight: var(--p-font-weight-regular);
  letter-spacing: var(--p-font-letter-spacing-normal);
  color: var(--p-color-text);
  background: var(--p-color-bg);
  min-height: 100vh;
  height: auto;
  max-height: none;
  overflow-x: clip;
  overflow-y: auto;
}

/* ——— Demo banner (below top bar): centered, width = content + inner padding ——— */
.shopify-demo-banner {
  display: flex;
  margin-top: 1%;
  margin-bottom: 0.5%;
  justify-content: center;
  padding: var(--x-spacing-small-400) var(--revert-layout-pad-x);
  background: var(--p-color-bg);
}

.shopify-demo-banner__inner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  max-width: min(100%, var(--revert-layout-max));
  padding: 0.55rem 0.75rem;
  border-radius: var(--p-border-radius-200);
  border: 1px solid color-mix(in srgb, #ca8a04 22%, transparent);
  background: #fffbeb;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.shopify-demo-banner__icon {
  flex-shrink: 0;
  color: #a16207;
}

.shopify-demo-banner p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: rgba(26, 26, 26, 0.82);
}

strong,
b {
  font-weight: var(--p-font-weight-bold);
}

a {
  color: var(--p-color-text-link);
  text-decoration: none;
}
a:hover {
  color: var(--p-color-text-link-hover);
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ——— Revert dark top bar ——— */
.revert-topbar {
  --revert-topbar-fg: rgba(255, 255, 255, 0.92);
  --revert-topbar-muted: rgba(255, 255, 255, 0.52);
  --revert-topbar-edge: rgba(255, 255, 255, 0.1);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  z-index: 150;
  font-family: "Plus Jakarta Sans", var(--p-font-family-sans), system-ui, sans-serif;
  background:
    radial-gradient(120% 140% at 12% -20%, rgba(0, 0, 0, 0.22), transparent 45%),
    radial-gradient(90% 100% at 100% 0%, rgba(96, 96, 96, 0.12), transparent 42%),
    linear-gradient(168deg, #0c0c0f 0%, #858585 42%, #0a0a0d 100%);
  border-bottom: 1px solid var(--revert-topbar-edge);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 2px 40px rgba(0, 0, 0, 0.45);
    border-radius: 0 0 24px 24px;
  /* Outer width matches .app-main content width + horizontal padding (2rem each side, border-box). */
  box-sizing: border-box;
  width: 100%;
  max-width: calc(
    var(--revert-layout-max) - var(--revert-layout-pad-x) * 10
  );
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--revert-topbar-pad-x);
}

/* ——— Shopify-style admin top bar ——— */
:root {
  --shopify-admin-topbar-h: 2.5rem; /* ~40px */
}

:root {
  --shopify-admin-topbar-h: 2.75rem; /* ~44px */
}

.shopify-admin-topbar {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  z-index: 160;
  height: 100%;
  background: #fff;
  border-bottom: 1px solid rgba(26, 26, 26, 0.12);
  box-sizing: border-box;
}

.shopify-admin-topbar__inner {
  height: 100%;
  padding: 1rem 3rem 1rem 3rem;
  max-width: var(--revert-layout-max);
  display: flex;
  align-items: center;
  margin: 0 auto;
  justify-content: space-between;
}

.shopify-admin-topbar__left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.shopify-admin-topbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shopify-admin-topbar__brand,
.shopify-admin-topbar__profile,
.shopify-admin-topbar__orders {
  font-size: 0.8125rem; /* ~13px */
  font-weight: 500;
  line-height: 1;
  color: rgba(26, 26, 26, 0.88);
  cursor: pointer;
}

.shopify-admin-topbar__brand {
  margin-right: 3rem;
  margin-left: 1rem;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
}

.shopify-admin-topbar__orders {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.shopify-admin-topbar__avatar {
  border: none;
  background: transparent;
  color: rgba(26, 26, 26, 0.88);
  padding: 0;
  height: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.shopify-admin-topbar__avatar-text {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(26, 26, 26, 0.12);
  background: rgba(26, 26, 26, 0.04);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  height: calc(var(--shopify-admin-topbar-h) - 0.6rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shopify-admin-topbar__avatar-caret {
  color: rgba(26, 26, 26, 0.7);
}

.shopify-admin-topbar__brand {
  font-size: 0.875rem;
  font-weight: 700;
}

.shopify-admin-topbar__link {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: rgba(26, 26, 26, 0.82);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  cursor: default;
}

.shopify-admin-topbar__link-text {
  white-space: nowrap;
}

.shopify-admin-topbar__menu {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: rgba(26, 26, 26, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: default;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
}

.shopify-admin-topbar__caret {
  color: rgba(26, 26, 26, 0.65);
}

.shopify-admin-topbar__menu-text {
  white-space: nowrap;
  font-size: 0.8125rem;
  line-height: 1;
}

.revert-topbar__inner {
  max-width: none;
  margin: 0;
  padding: 1.15rem 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.revert-topbar__cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.75rem;
  width: 100%;
  max-width: 48rem;
}

@media (min-width: 720px) {
  .revert-topbar__cluster {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
}

.revert-topbar__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-decoration: none;
  color: var(--revert-topbar-fg);
  transition: opacity 0.2s ease;
}

.revert-topbar__brand:hover {
  opacity: 0.88;
  text-decoration: none;
}

.revert-topbar__logo {
  height: 44px;
  width: auto;
  max-width: min(280px, 72vw);
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.352);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.35);
}

.revert-topbar__end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.revert-topbar__tagline {
  margin: 0;
  max-width: 100rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: white;
  text-align: center;
}

@media (max-width: 719px) {
  .revert-topbar__tagline {
    max-width: 20rem;
  }
}

.revert-topbar__install {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 1.45rem;
  border-radius: var(--p-border-radius-200);
  color: var(--revert-topbar-fg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  cursor: pointer;
  transition:
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.18s ease;
}

.revert-topbar__install:hover {
  border-color: rgba(255, 255, 0, 0.75);
  background: rgba(248, 242, 56, 0.1);
  box-shadow:
    0 0 0 1px rgba(248, 245, 56, 0.2) inset,
    0 0 28px rgba(248, 235, 56, 0.18);
  transform: translateY(-1px);
}

.revert-topbar__install:active {
  transform: translateY(0);
}

.revert-topbar__install:focus-visible {
  outline: 2px solid rgba(252, 255, 59, 0.95);
  outline-offset: 3px;
}

/* 50 / 50 columns — matches saved page layout intent (not 65/35) */
.app-main {
  max-width: var(--revert-layout-max);
  margin: 0 auto;
  padding: var(--x-spacing-base) var(--revert-layout-pad-x) var(--x-spacing-large-300);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--x-spacing-base);
  align-items: start;
  min-height: 0;
  overflow: visible;
}

.app-main__primary,
.app-main__secondary {
  min-width: 0;
}

/* Right column: light grey panel (reference contrast vs white cards) */
.app-main__secondary {
  /*background: color-mix(in srgb, var(--p-color-bg-surface-secondary) 42%, var(--p-color-bg) 58%);*/
  border-radius: var(--x-border-radius-large);
  padding: var(--x-spacing-base);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* One sticky unit: Buy again + summary card keep fixed gap while scrolling */
.sidebar-sticky-cluster {
  position: sticky;
  top: calc(var(--shopify-admin-topbar-h) + 0.5rem);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  /* Don’t stretch to full column height (grid row) — sticky needs content-sized box */
  align-self: flex-start;
}

.sidebar-sticky-cluster > .btn-outline {
  align-self: flex-end;
  margin-bottom: 0.7rem;
}

/* Sticky install CTA below the right sidebar card (reuses top bar button style). */
.sidebar-install-cta {
  --revert-topbar-fg: rgba(255, 255, 255, 0.92);
  --revert-topbar-muted: rgba(255, 255, 255, 0.52);
  --revert-topbar-edge: rgba(255, 255, 255, 0.1);

  font-family: "Plus Jakarta Sans", var(--p-font-family-sans), system-ui, sans-serif;

  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--p-border-radius-300);
  border: 1px solid var(--revert-topbar-edge);
  background:
    radial-gradient(120% 140% at 12% -20%, rgba(0, 0, 0, 0.22), transparent 45%),
    radial-gradient(90% 100% at 100% 0%, rgba(96, 96, 96, 0.12), transparent 42%),
    linear-gradient(168deg, #0c0c0f 0%, #858585 42%, #0a0a0d 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 2px 40px rgba(0, 0, 0, 0.45);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar-install-cta__text {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.sidebar-install-cta__copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.sidebar-install-cta__text strong {
  color: var(--revert-topbar-fg);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-install-cta__text span {
  color: var(--revert-topbar-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.sidebar-install-cta__link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.sidebar-install-cta__badge {
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--revert-topbar-muted);
  white-space: nowrap;
}

.sidebar-install-cta__install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.sidebar-install-cta__shopify-icon {
  display: block;
  color: var(--revert-topbar-fg);
}

@media (max-width: 480px) {
  .sidebar-install-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar-install-cta__text {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .sidebar-install-cta__link {
    align-self: flex-end;
  }

  .sidebar-install-cta__badge {
    font-size: 0.675rem;
  }
}

@media (max-width: 960px) {
  .app-main {
    grid-template-columns: 1fr;
  }
}

/* ——— Order title row ——— */
.order-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--x-spacing-base) var(--x-spacing-large-200);
  margin-bottom: var(--x-spacing-base);
  flex-wrap: wrap;
}

.order-title-row__titles {
  min-width: 0;
}

.order-title-row__back {
  display: inline-flex;
  align-items: center;
  gap: var(--x-spacing-small-400);
  color: var(--p-color-text);
  font-family: var(--p-font-family-sans);
  font-weight: var(--x-typography-primary-weight-bold);
  font-size: var(--x-typography-size-large);
  line-height: 1.25;
  letter-spacing: var(--p-font-letter-spacing-normal);
  background: none;
  border: none;
  padding: 0;
}
.order-title-row__back:hover {
  color: var(--p-color-text-link-hover);
}

.order-title-row__meta {
  font-size: var(--x-typography-size-default);
  line-height: 1.4;
  color: var(--p-color-text-secondary);
  margin: var(--x-spacing-small-400) 0 0;
}

.btn-outline {
  padding: var(--x-spacing-small-200) var(--x-spacing-base);
  font-size: var(--x-typography-size-default);
  font-weight: var(--x-typography-primary-weight-bold);
  line-height: 1.4;
  border: var(--x-border-width-base) solid var(--p-color-border);
  border-radius: var(--x-border-radius-base);
  background: var(--p-color-bg-surface);
  color: var(--p-color-text-link);
  box-shadow: none;
}
.btn-outline:hover {
  background: var(--p-color-bg-surface-hover);
  color: var(--p-color-text-link-hover);
}

/* ——— Order edit hub (white card: timer + banner + grid) ——— */
.order-edit-hub {
  background: var(--p-color-bg-surface);
  border: var(--x-border-width-base) solid var(--p-color-border);
  border-radius: var(--x-border-radius-large);
  padding: var(--x-spacing-base);
  margin-bottom: 0;
  box-shadow: var(--p-shadow-200);
}

/* ——— Timer bar ——— */
.timer-bar {
  display: flex;
  align-items: center;
  justify-content: left;
  flex-wrap: wrap;
  column-gap: var(--x-spacing-base);
  row-gap: var(--x-spacing-small-200);
  background: #f5f5f5;
  border: var(--x-border-width-base) solid var(--p-color-border);
  border-radius: var(--x-border-radius-base);
  padding: var(--x-spacing-large-100) var(--x-spacing-base);
}

.timer-bar--hub {
  margin-bottom: var(--x-spacing-base);
}

.timer-bar__label {
  display: flex;
  align-items: center;
  gap: var(--x-spacing-small-400);
  font-size: var(--x-typography-size-default);
  font-weight: var(--x-typography-font-weight-base);
  line-height: 1.4;
  color: var(--p-color-text);
}

.timer-bar__units {
  display: flex;
  gap: var(--x-spacing-small-400);
  flex-shrink: 0;
}

.timer-unit {
  min-width: 2.5rem;
  padding: var(--x-spacing-small-200) var(--x-spacing-small-300);
  background: var(--p-color-bg-surface);
  border: var(--x-border-width-base) solid var(--p-color-border);
  border-radius: var(--x-border-radius-base);
  font-weight: var(--x-typography-primary-weight-bold);
  font-size: var(--x-typography-size-default);
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--p-color-text);
}

/* ——— Instruction row (pencil in gray well on white card — Shopify order status) ——— */
.info-banner--polaris {
  display: flex;
  align-items: flex-start;
  gap: var(--x-spacing-small-200);
  background: #f5f5f5;
  /*border: var(--x-border-width-base) solid var(--p-color-border);*/
  border-radius: var(--x-border-radius-base);
  padding: var(--x-spacing-large-100) var(--x-spacing-base);
  margin-bottom: var(--x-spacing-base);
}

.info-banner__pencil {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  padding:12px;
  background: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--p-color-text-secondary);
}

.info-banner__text {
  min-width: 0;
}

.info-banner__title {
  margin: 0 0 var(--x-spacing-small-500);
  font-size: var(--x-typography-size-default);
  font-weight: var(--x-typography-primary-weight-bold);
  color: var(--p-color-text);
  line-height: 1.4;
}

.info-banner__subtitle {
  margin: 0;
  font-size: var(--x-typography-size-default);
  color: var(--p-color-text-secondary);
  line-height: 1.4;
}

/* ——— Action grid (main bundle often uses --x-spacing-base gap) ——— */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--x-spacing-base);
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
}

.action-card {
  display: flex;
  align-items: flex-start;
  gap: var(--x-spacing-base);
  padding: var(--x-spacing-large-100) var(--x-spacing-base);
  background: var(--p-color-bg-surface);
  border: var(--x-border-width-base) solid var(--p-color-border);
  border-radius: var(--x-border-radius-base);
  text-align: left;
  box-shadow: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.action-card:hover {
  border-color: var(--p-color-border);
  background: #fdfdfd;
  box-shadow: var(--p-shadow-200);
  transition: all 0.15s ease-in-out;
}

.action-card__icon-wrap {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: var(--x-border-radius-base);
  color: var(--p-color-text-secondary);
}

.action-card__icon-wrap .polaris-icon {
  display: block;
}

.action-card__glyph {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

.action-card--danger .action-card__title {
  color: var(--p-color-text-critical);
  font-weight: var(--x-typography-primary-weight-bold);
}
.action-card--danger .action-card__icon-wrap {
  color: var(--p-color-icon-secondary);
}

.action-card__copy {
  min-width: 0;
}

.action-card__title {
  font-weight: var(--x-typography-primary-weight-bold);
  font-size: var(--x-typography-size-default);
  line-height: 1.4;
  margin: 0 0 var(--x-spacing-small-500);
  color: var(--p-color-text);
}

.action-card__hint {
  font-size: var(--x-typography-size-small);
  line-height: 1.4;
  color: var(--p-color-text-secondary);
  font-weight: var(--x-typography-font-weight-base);
  margin: 0;
}

/* ——— Card panels (edit flows) ——— */
.edit-panel {
  display: none;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-300);
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--p-shadow-200);
}

.edit-panel.is-active {
  display: block;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--p-color-bg-surface-secondary);
  border-radius: var(--p-border-radius-200);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.75rem;
  padding: var(--x-spacing-large-100) var(--x-spacing-base);
  margin-top: 0.75rem;
}

.panel-header__btns {
  display: flex;
  gap: 0.35rem;
}

.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-150);
  color: var(--p-color-text);
  padding: 0;
}
.icon-btn:hover {
  background: var(--p-color-bg-surface-secondary);
}

.panel-header__text h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}
.panel-header__text p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--p-color-text-secondary);
}

.panel-body {
  background: var(--p-color-bg-surface-secondary);
  border-radius: var(--p-border-radius-200);
  padding: 1rem;
  margin-bottom: 0.75rem;
  margin: 0 auto;
  display: block;
}

.panel-body-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.field-floating {
  position: relative;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-150);
  padding: 0.5rem 0.75rem 0.5rem;
  margin-bottom: 0.65rem;
}
.field-floating:last-child {
  margin-bottom: 0;
}
.field-floating label {
  display: block;
  font-size: 0.6875rem;
  color: var(--p-color-text-secondary);
  margin-bottom: 0.15rem;
}
.field-floating input,
.field-floating textarea,
.field-floating select {
  width: 100%;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--p-color-text);
  background: transparent;
  resize: vertical;
  min-height: 1.25rem;
  /* Wrapper uses :focus-within for the blue ring — drop native outline to avoid double border */
  outline: none;
}
.field-floating textarea {
  min-height: 5rem;
}
.field-floating:focus-within {
  border-color: var(--p-color-border-focus);
  outline: 2px solid var(--p-color-border-focus);
  outline-offset: 1px;
}

.field-floating--with-icon {
  position: relative;
  padding-left: 2.35rem;
}
.field-floating__icon {
  position: absolute;
  left: 0.65rem;
  top: 1.85rem;
  color: var(--p-color-text-secondary);
  pointer-events: none;
  display: flex;
}

.field-floating select {
  cursor: pointer;
  width: 100%;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.75rem auto;
}
.field-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 640px) {
  .field-row,
  .field-row--3 {
    grid-template-columns: 1fr;
  }
}

.field-with-flag {
  display: flex;
  align-items: stretch;
}
.field-with-flag .field-floating {
  flex: 1;
  margin-bottom: 0;
  border-radius: var(--p-border-radius-150) 0 0 var(--p-border-radius-150);
  border-right: none;
}
.field-flag {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-left: 1px solid var(--p-color-border);
  border-radius: 0 var(--p-border-radius-150) var(--p-border-radius-150) 0;
  font-size: 0.875rem;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
}

.panel-actions .btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--p-border-radius-200);
  border: 1px solid var(--p-color-border);
}

.btn-primary-solid {
  background: var(--p-color-bg-fill-emphasis);
  color: var(--p-color-text-emphasis-on-bg-fill);
  border-color: var(--p-color-bg-fill-emphasis);
}
.btn-primary-solid:hover {
  background: var(--p-color-bg-fill-emphasis-hover);
  border-color: var(--p-color-bg-fill-emphasis-hover);
}

.btn-primary-muted {
  background: var(--p-color-bg-fill-secondary);
  color: var(--p-color-text);
  border-color: var(--p-color-border);
}
.btn-primary-muted:hover {
  background: var(--p-color-bg-fill-secondary-hover);
}

.btn-secondary-outline {
  background: var(--p-color-bg-surface);
  color: var(--p-color-text-link);
  border-color: var(--p-color-border);
}
.btn-secondary-outline:hover {
  background: var(--p-color-bg-surface-secondary);
}

.btn-neutral {
  background: var(--p-color-bg-surface);
  color: var(--p-color-text-secondary);
  border-color: var(--p-color-border);
}
.btn-neutral:hover {
  background: var(--p-color-bg-surface-secondary);
  color: var(--p-color-text);
}

/* Product line in panels */
.product-edit-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-200);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 560px) {
  .product-edit-card .qty-stepper {
    flex: 1 1 100%;
    max-width: none;
  }
}

.product-edit-card__img-wrap {
  position: relative;
  flex-shrink: 0;
}

.product-edit-card__img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--p-border-radius-150);
  background: var(--p-color-bg-surface-secondary);
}

.qty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  background: var(--p-color-bg-inverse);
  color: var(--p-color-text-inverse);
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-edit-card__info {
  flex: 1;
  min-width: 0;
}
.product-edit-card__info h3 {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
}
.product-edit-card__info .meta {
  font-size: 0.8125rem;
  color: var(--p-color-text-secondary);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-150);
  padding: 0.35rem 0.5rem;
  background: var(--p-color-bg-surface);
  min-width: 120px;
}
.qty-stepper label {
  display: block;
  font-size: 0.625rem;
  color: var(--p-color-text-secondary);
  width: 100%;
}
.qty-stepper__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}
.qty-stepper__val {
  font-weight: 600;
  font-size: 1rem;
  min-width: 1.5rem;
  text-align: center;
}
.qty-stepper button {
  background: none;
  border: none;
  font-size: 1.125rem;
  padding: 0.15rem 0.35rem;
  color: var(--p-color-text);
  line-height: 1;
}
.qty-stepper button:hover {
  color: var(--p-color-text-link-hover);
}

/* Search + product list */
.search-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-150);
  padding: 0.5rem 0.75rem;
  margin: 0.75rem auto;
}
.search-field:focus-within {
  border-color: var(--p-color-border-focus);
  outline: 2px solid var(--p-color-border-focus);
  outline-offset: 1px;
}
.search-field input {
  flex: 1;
  border: none;
  font-size: 0.875rem;
  font-family: inherit;
}
.search-field input:focus {
  outline: none;
}

/* Stacked full product cards in quantity / variant / replace panels */
.panel-multi-lines {
  display: flex;
  flex-direction: column;
  gap: var(--x-spacing-base);
}

.panel-multi-lines .product-edit-card:last-child {
  margin-bottom: 0;
}

.replace-panel-hint {
  margin: 0 0 var(--x-spacing-base);
  font-size: var(--p-text-body-sm-font-size);
  color: var(--p-color-text-secondary);
  line-height: 1.45;
}

.product-edit-card__tag {
  margin: 0.35rem 0 0;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--p-color-text-secondary);
}

.product-edit-card.is-replace-target {
  border-color: var(--p-color-border-focus);
  box-shadow: 0 0 0 1px var(--p-color-border-focus);
  background: color-mix(in srgb, var(--p-color-bg-fill-info) 10%, var(--p-color-bg-surface));
}

#panel-replace #replace-panel-lines .product-edit-card {
  cursor: pointer;
}

.product-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-200);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.product-list-item:hover {
  border-color: var(--p-color-border-hover);
}
.product-list-item.is-selected {
  border-color: var(--p-color-border-focus);
  box-shadow: 0 0 0 1px var(--p-color-border-focus);
}
.product-list-item:last-child {
  margin-bottom: 0;
}
.product-list-item__thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--p-border-radius-150);
  background: var(--p-color-bg-surface-secondary);
}
.product-list-item__body {
  flex: 1;
  min-width: 0;
}
.product-list-item__body strong {
  display: block;
  font-size: 0.8125rem;
}
.product-list-item__body .product-list-item__variant,
.product-list-item__body .product-list-item__price,
.product-list-item__body > span:not(.product-list-item__variant):not(.product-list-item__price) {
  font-size: 0.75rem;
  color: var(--p-color-text-secondary);
}
.product-list-item__variant {
  display: block;
  margin-top: 0.15rem;
}
.product-list-item__price {
  display: block;
  margin-top: 0.1rem;
  font-weight: 500;
  color: var(--p-color-text);
}
.product-list-item__link {
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Custom select / dropdown */
.custom-select {
  position: relative;
}
.custom-select__trigger {
  width: 100%;
  text-align: left;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-150);
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  position: relative;
}
.custom-select__trigger.is-open,
.custom-select__trigger:focus {
  border-color: var(--p-color-border-focus);
  outline: 2px solid var(--p-color-border-focus);
  outline-offset: 1px;
}
.custom-select__trigger .lbl {
  display: block;
  font-size: 0.6875rem;
  color: var(--p-color-text-secondary);
}
.custom-select__chevron {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.custom-select__menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-150);
  box-shadow: var(--p-shadow-300);
  z-index: 20;
  max-height: 200px;
  overflow-y: auto;
}
.custom-select.is-open .custom-select__menu {
  display: block;
}
.custom-select__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
}
.custom-select__option:hover,
.custom-select__option.is-selected {
  background: var(--p-color-bg-fill-emphasis);
  color: var(--p-color-text-emphasis-on-bg-fill);
}

/* Calendar */
.calendar-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.calendar-input-row .field-floating {
  flex: 1;
  margin-bottom: 0;
}

.calendar-widget {
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-200);
  padding: 0.75rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.calendar-nav h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}
.calendar-nav button {
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--p-color-text);
}
.calendar-nav button:hover {
  color: var(--p-color-text-link-hover);
}

.calendar-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 0.6875rem;
  color: var(--p-color-text-secondary);
  text-align: center;
  margin-bottom: 0.35rem;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  border: none;
  background: transparent;
  border-radius: var(--p-border-radius-150);
  cursor: pointer;
  color: var(--p-color-text);
}
.calendar-day:hover:not(:disabled) {
  background: var(--p-color-bg-surface-secondary);
}
.calendar-day.is-out {
  color: var(--p-color-text-disabled);
}
.calendar-day.is-selected {
  border: 1px solid var(--p-color-border);
  background: var(--p-color-bg-surface-secondary);
  font-weight: 600;
}
.calendar-day:disabled {
  cursor: default;
}

/* Cancel order offer */
.offer-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--p-color-bg-surface-success);
  border: 1px solid var(--p-color-border-success);
  border-radius: var(--p-border-radius-150);
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--p-color-text-success);
  margin-bottom: 1rem;
}

.offer-card .product-edit-card {
  flex-wrap: wrap;
}
.offer-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  width: 100%;
}
.offer-actions .btn {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--p-border-radius-200);
  border: none;
}
.btn-offer-accept {
  background: var(--p-color-bg-fill-emphasis);
  color: var(--p-color-text-emphasis-on-bg-fill);
}
.btn-offer-reject {
  background: var(--p-color-bg-surface);
  color: var(--p-color-text-emphasis);
  border: 1px solid var(--p-color-border-emphasis);
}

/* Replace flow sub-back */
.sub-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  font-size: 0.8125rem;
  color: var(--p-color-text);
  margin-bottom: 0.5rem;
  padding: 0;
}
.sub-back:hover {
  color: var(--p-color-text-link-hover);
}

.replace-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.6875rem;
  color: var(--p-color-text-secondary);
}

/* ——— Recommendations (Polaris-style tabs + gray product shells) ——— */
.rec-card {
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-300);
  padding: 1rem 1rem 1.1rem;
  margin-top: 1rem;
  box-shadow: var(--p-shadow-300);
}

.rec-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.rec-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--p-color-text-secondary);
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-200);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.rec-tab.is-active {
  color: var(--p-color-text);
  background: var(--p-color-bg-surface-secondary);
  border-color: transparent;
}

.rec-tab:not(.is-active):hover {
  background: var(--p-color-bg-surface-hover);
}

.rec-tab-panels {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rec-product-shell {
  background: var(--p-color-bg-surface-secondary);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-200);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.rec-product-top {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--p-color-border);
}

.rec-product-thumb-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--p-border-radius-200);
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rec-product-headline {
  flex: 1;
  min-width: 0;
  padding-top: 0.1rem;
}

.rec-product-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--p-color-text);
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.rec-product-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.rec-product-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--p-color-text);
}

.rec-added-badge {
  display: none;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--p-color-text-inverse, #fff);
  background: var(--p-color-bg-fill-inverse, #4a4d51);
  border-radius: 999px;
}

.rec-added-badge.is-shown {
  display: inline-flex;
}

.rec-added-badge__check {
  color: inherit;
}

.rec-product-shell.is-added .rec-variant-field {
  opacity: 0.55;
  pointer-events: none;
}

.rec-product-shell.is-added .js-rec-qty-stepper {
  opacity: 0.92;
}

.rec-product-shell.is-added .js-rec-qty-stepper button {
  cursor: pointer;
}

.rec-variant-field {
  margin-bottom: 0.75rem;
}

.rec-qty-add-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.65rem;
}

@media (max-width: 520px) {
  .rec-qty-add-row {
    flex-direction: column;
  }
}

.qty-stepper--rec {
  flex: 0 0 auto;
  min-width: 7.5rem;
  max-width: 10rem;
  padding: 0.45rem 0.55rem;
}

.qty-stepper--rec .qty-stepper__col {
  width: 100%;
}

.qty-stepper--rec label {
  font-size: 0.625rem;
}

.btn-add-cart {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  background: var(--p-color-bg-fill-emphasis);
  color: var(--p-color-text-emphasis-on-bg-fill);
  border: none;
  border-radius: var(--p-border-radius-200);
  font-weight: 600;
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-add-cart:hover {
  background: var(--p-color-bg-fill-emphasis-hover);
}

.btn-add-cart.js-rec-add-cart:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--p-color-bg-fill-secondary);
  color: var(--p-color-text-secondary);
}

.btn-add-cart.js-rec-add-cart:disabled:hover {
  background: var(--p-color-bg-fill-secondary);
}

.btn-add-cart svg {
  flex-shrink: 0;
}

.btn-rec-remove {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  background: var(--p-color-bg-surface);
  color: var(--p-color-text-critical);
  border: 1px solid var(--p-color-border-critical);
  border-radius: var(--p-border-radius-200);
  font-weight: 600;
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-rec-remove:not([hidden]) {
  display: inline-flex;
}

.btn-rec-remove:hover {
  background: color-mix(in srgb, var(--p-color-text-critical) 8%, var(--p-color-bg-surface));
}

.btn-rec-remove .polaris-icon {
  color: var(--p-color-text-critical);
}

.rec-hot-placeholder {
  margin: 0;
  font-size: 0.875rem;
  color: var(--p-color-text-secondary);
  line-height: 1.45;
}

.rec-footer-actions {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  flex-wrap: wrap;
}

.rec-footer-btn {
  flex: 1;
  min-width: 8rem;
  max-width: 16rem;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--p-border-radius-200);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.rec-footer-btn--accept {
  background: var(--p-color-bg-fill-emphasis);
  color: var(--p-color-text-emphasis-on-bg-fill);
  border: none;
}

.rec-footer-btn--accept:hover {
  background: var(--p-color-bg-fill-emphasis-hover);
  color: var(--p-color-text-emphasis-on-bg-fill);
}

.rec-footer-btn--discard {
  background: var(--p-color-bg-surface);
  color: var(--p-color-text-emphasis);
  border: 1px solid var(--p-color-border-emphasis);
}

.rec-footer-btn--discard:hover {
  background: var(--p-color-bg-surface-emphasis-hover);
  color: var(--p-color-text-emphasis);
}

/* ——— Status / tracking ——— */
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-300);
  padding: 1rem;
  margin: 1rem auto;
}

.status-card__check-icon {
  color: var(--p-color-icon-success);
  flex-shrink: 0;
}

.status-card__left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.status-card__left strong {
  font-size: var(--p-text-body-md-font-size);
  line-height: var(--p-text-body-md-font-line-height);
  font-weight: var(--p-font-weight-semibold);
}

.btn-shop {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--p-color-border-emphasis);
  border-radius: var(--p-border-radius-200);
  background: var(--p-color-bg-surface);
  color: var(--p-color-text);
  font-size: var(--p-text-body-sm-font-size);
  line-height: var(--p-text-body-sm-font-line-height);
  font-weight: var(--p-font-weight-semibold);
}
.btn-shop:hover {
  background: var(--p-color-bg-surface-emphasis-hover);
}

.status-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  align-items: flex-start;
}

.status-card__date {
  margin: 0;
  font-size: var(--p-text-body-sm-font-size);
  color: var(--p-color-text-secondary);
}

/* ——— Account footer (policies / region) ——— */
.account-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 1.25rem 0 0;
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--p-color-border);
}

.account-footer__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  font-size: var(--p-text-body-sm-font-size);
  line-height: var(--p-text-body-sm-font-line-height);
  color: var(--p-color-text-secondary);
  cursor: pointer;
  font-family: inherit;
}

button.account-footer__item:hover {
  color: var(--p-color-text);
}

a.account-footer__item {
  text-decoration: none;
  color: var(--p-color-text-secondary);
}

a.account-footer__item:hover {
  color: var(--p-color-text);
  text-decoration: underline;
}

/* ——— Order details grid ——— */
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-300);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
}

.details-block h4 {
  margin: 0 0 0.35rem;
  font-family: var(--p-text-heading-xs-font-family);
  font-size: var(--p-text-heading-xs-font-size);
  font-weight: var(--p-text-heading-xs-font-weight);
  line-height: var(--p-text-heading-xs-font-line-height);
  letter-spacing: var(--p-text-heading-xs-font-letter-spacing);
  color: var(--p-color-text-secondary);
  text-transform: uppercase;
}
.details-block p {
  margin: 0;
  font-size: var(--p-text-body-sm-font-size);
  line-height: var(--p-text-body-sm-font-line-height);
}

/* ——— Sidebar ——— */
.sidebar-card {
  background: var(--p-color-bg-surface);
  border: var(--x-border-width-base) solid var(--p-color-border);
  border-radius: var(--x-border-radius-large);
  padding: var(--x-spacing-large-100) var(--x-spacing-large-200);
  position: relative;
  box-shadow: var(--p-shadow-200);
  max-width: 100%;
}

.sidebar-line {
  display: flex;
  align-items: flex-start;
  gap: var(--x-spacing-base);
  padding-bottom: var(--x-spacing-base);
  margin-bottom: var(--x-spacing-base);
  /*border-bottom: var(--x-border-width-base) solid var(--p-color-border);*/
}

.sidebar-line--primary {
  padding-bottom: var(--x-spacing-base);
  margin-bottom: var(--x-spacing-base);
  border-bottom: var(--x-border-width-base) solid var(--p-color-border);
}

.sidebar-addons-head {
  margin: 0 0 var(--x-spacing-small-500);
  font-size: var(--p-text-body-sm-font-size);
  font-weight: var(--p-font-weight-semibold);
  color: var(--p-color-text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-extra-lines {
  margin-bottom: var(--x-spacing-base);
}

.sidebar-line--extra {
  margin-bottom: var(--x-spacing-base);
  padding: var(--x-spacing-small-500) 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--p-color-border) 80%, transparent);
  animation: sidebar-line-in 0.4s ease both;
}

@keyframes sidebar-line-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-line__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
  padding-top: var(--x-spacing-small-500);
}

.btn-sidebar-remove {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--p-color-text-critical);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-sidebar-remove:hover {
  color: var(--p-color-text);
}

@keyframes sidebar-value-flash {
  0%,
  100% {
    color: inherit;
  }
  40% {
    color: var(--p-color-text-success);
  }
}

.sidebar-line__img-wrap {
  position: relative;
  flex-shrink: 0;
}

.sidebar-line__img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--x-border-radius-base);
  background: white;
  border-radius: 14px; 
  border: 1px solid #dfdfdf;
  padding: 6px 2px;
  box-shadow: var(--p-shadow-300);
}

.sidebar-line__body {
  flex: 1;
  min-width: 0;
}
.sidebar-line__body strong {
  font-family: var(--p-font-family-sans);
  font-size: var(--x-typography-size-default);
  font-weight: var(--x-typography-primary-weight-bold);
  line-height: 1.4;
  display: block;
}

.sidebar-line__variant {
  display: block;
  margin-top: var(--x-spacing-small-400);
  font-size: var(--x-typography-size-default);
  line-height: 1.4;
  color: var(--p-color-text-secondary);
}

/* [hidden] loses to display:flex / inline-flex from .sidebar-line__discount */
#sidebar-line-discount[hidden] {
  display: none !important;
}

.sidebar-line__discount {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: color-mix(in srgb, var(--p-color-text-link) 50%, var(--p-color-text-secondary) 50%);
}

.sidebar-line__discount-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.sidebar-line__aside--primary {
  flex-shrink: 0;
  padding-top: var(--x-spacing-small-500);
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.2rem;
}

#sidebar-line-price-was[hidden] {
  display: none !important;
}

/* Ensure extra line "was" price also fully disappears when hidden. */
.sidebar-line__price-was[hidden] {
  display: none !important;
}

.sidebar-line__price-was {
  font-size: 0.875rem;
  font-weight: var(--x-typography-font-weight-base);
  line-height: 1.3;
  color: var(--p-color-text-secondary);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.sidebar-line__aside--primary .sidebar-line__price {
  padding-top: 0;
}

/* Stacked prices: struck-through was (smaller grey) + current (bolder, slightly larger) */
.sidebar-line--primary.is-line-discounted .sidebar-line__price {
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.25;
  color: var(--p-color-text);
}

/* Same stacked pricing styling for extra (recently viewed) lines. */
.sidebar-line--extra.is-line-discounted .sidebar-line__price {
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.25;
  color: var(--p-color-text);
}

.sidebar-line__price {
  flex-shrink: 0;
  font-size: var(--x-typography-size-default);
  font-weight: var(--x-typography-font-weight-base);
  line-height: 1.4;
  color: var(--p-color-text);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-top: var(--x-spacing-small-500);
}

/* Outstanding payment (partially paid order) */
.sidebar-payment-due-banner {
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-300);
  padding: 1rem 1rem 0.85rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--p-shadow-200);
}

#sidebar-payment-due-banner[hidden] {
  display: none !important;
}

.sidebar-payment-due-banner__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.sidebar-payment-due-banner__amount-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sidebar-payment-due-banner__sum {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--p-color-text);
}

.sidebar-payment-due-banner__label {
  font-size: 0.8125rem;
  color: var(--p-color-text);
}

.sidebar-payment-due-banner__pay {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  min-height: 2.25rem;
  border-radius: var(--p-border-radius-200);
}

.sidebar-payment-due-banner__note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--p-color-text-secondary);
}

/* Refund notice (matches customer-account pattern: amount + status + note) */
.sidebar-refund-banner {
  background: var(--p-color-bg-surface);
  border: 1px solid var(--p-color-border);
  border-radius: var(--p-border-radius-300);
  padding: 1rem 1rem 0.85rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--p-shadow-200);
}

#sidebar-refund-banner[hidden] {
  display: none !important;
}

.sidebar-refund-banner__amount-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.55rem;
}

.sidebar-refund-banner__sum {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--p-color-text);
}

.sidebar-refund-banner__label {
  font-size: 0.8125rem;
  color: var(--p-color-text);
}

.sidebar-refund-banner__note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--p-color-text-secondary);
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--x-typography-size-default);
  line-height: 1.25;
  margin-bottom: var(--x-spacing-large-100);
}

/* Primary Total row (GBP + amount), then optional Paid / Refunded ledger below */
.sidebar-row--total-main {
  margin-top: var(--x-spacing-base);
  padding-top: var(--x-spacing-base);
  font-weight: 600;
  font-size: var(--x-typography-size-large);
  line-height: 1.3;
  align-items: center;
}

.sidebar-total-main__wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sidebar-total-main__ccy {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--p-color-text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-total-main__amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: var(--p-font-letter-spacing-normal);
  font-size: inherit;
}

/* [hidden] loses to .sidebar-row { display: flex } without !important */
#sidebar-ledger-row[hidden] {
  display: none !important;
}

/* [hidden] loses to .sidebar-row { display: flex } without !important */
#sidebar-discount-row[hidden] {
  display: none !important;
}

.sidebar-row--ledger span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--p-color-text-secondary);
}

#sidebar-subtotal.is-value-flash,
#sidebar-grand-total.is-value-flash {
  animation: sidebar-value-flash 0.55s ease;
}

/* Add product panel: same recommendation rows as order page */
#add-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

#add-list #rec-panel-recent {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

#add-list .rec-product-shell {
  margin-bottom: 0;
}

/* Main zone visibility */
#main-zone.is-hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--p-color-bg-inverse);
  color: var(--p-color-text-inverse);
  padding: 0.65rem 1.25rem;
  border-radius: var(--p-border-radius-200);
  font-size: 0.875rem;
  z-index: 200;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
