/* Product bar. Items highlight like Shopify's navigation; MeAero Theme and MeriStoreBoost Pro keep their
   names as links and open a submenu from the button beside them (help-language.js). The panel fades and
   rises with the theme's popover timing (opacity 140 ms, 4px rise 160 ms) and closes the same way. */
.product-nav {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  padding: 6px max(16px, calc((100vw - 1200px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.product-nav > a,
.nav-item > a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  color: #303030;
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}
:where(:root:not([data-pointer='touch'])) :is(.product-nav > a, .nav-item > a, .nav-toggle):hover {
  background-color: var(--surface-hover);
}
/* The product the visitor is in (help-language.js marks it). */
:is(.product-nav > a, .nav-item > a)[aria-current='page'] {
  color: var(--ink);
  background-color: #eaf1ed;
}
.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 40px;
  margin-inline-start: -4px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}
.nav-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: rotate 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.nav-item[data-open] .nav-toggle {
  color: #303030;
  background-color: var(--surface-hover);
}
.nav-item[data-open] .nav-toggle svg {
  rotate: 180deg;
}
.nav-panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  width: max-content;
  min-width: 240px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 8px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-popover);
  visibility: hidden;
  opacity: 0;
  translate: 0 4px;
  transition:
    opacity 140ms ease-out,
    translate 160ms ease-out,
    visibility 0s linear 160ms;
}
/* Covers the gap above the panel, so a pointer moving down from the name never leaves the menu. */
.nav-panel::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 100%;
  height: 8px;
}
.nav-item[data-open] .nav-panel {
  visibility: visible;
  opacity: 1;
  translate: none;
  transition-delay: 0s;
}
/* Topics and guides sit side by side on wide screens. */
.nav-panel:has(> .nav-panel-group + .nav-panel-group) {
  width: min(500px, calc(100vw - 32px));
}
.nav-panel-group {
  flex: 1 1 220px;
  min-width: 0;
}
.nav-panel-heading {
  margin: 6px 8px 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-secondary);
}
.nav-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-panel li {
  margin: 0;
}
.nav-panel a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-control);
  color: #303030;
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
  transition: background-color 120ms ease;
}
:where(:root:not([data-pointer='touch'])) .nav-panel a:hover {
  background-color: var(--surface-hover);
}
.nav-panel a[aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
}
@media (pointer: coarse) {
  .product-nav > a,
  .nav-item > a,
  .nav-toggle {
    min-height: 44px;
  }
  .nav-toggle {
    width: 36px;
  }
}

/* Help home: article cards are white Polaris cards that firm up and lift a little under the pointer. */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
  margin: 16px 0;
}
.article-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    translate 200ms ease;
}
:where(:root:not([data-pointer='touch'])) .article-grid article:hover {
  border-color: #cfcfcf;
  box-shadow: 0 8px 18px -10px rgb(26 26 26 / 0.3);
}
@media (prefers-reduced-motion: no-preference) {
  :where(:root:not([data-pointer='touch'])) .article-grid article:hover {
    translate: 0 -2px;
  }
}
.article-grid h2 {
  font-size: 16px;
  margin-bottom: 8px;
}
.article-grid h2 a {
  text-decoration: none;
}
:where(:root:not([data-pointer='touch'])) .article-grid h2 a:hover {
  text-decoration: underline;
}
.article-grid p {
  margin: 6px 0;
  font-size: 14px;
}

/* Support form, laid out like Shopify's forms: one white card, labels above fields, only optional fields
   marked, help and errors below the field, actions at the end. */
.support-page {
  max-width: 760px;
}
.support-page p {
  overflow-wrap: anywhere;
}
.support-meta {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.support-meta p {
  margin: 4px 0;
}
.support-card {
  display: grid;
  gap: 18px;
  min-width: 0;
  margin: 24px 0 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
/* A floated legend sits inside the card as its title instead of breaking the border. */
.support-card legend {
  float: left;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 650;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.field-row:has(> .field[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
.field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}
.support-page label {
  margin: 0;
  font-size: 14px;
  font-weight: 550;
}
.field-optional {
  font-weight: 400;
  color: var(--text-secondary);
}
.support-page :is(input, select, textarea),
#article-search {
  font: inherit;
  font-size: 15px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-control);
  background: #fdfdfd;
  color: #303030;
  transition:
    border-color 160ms ease-out,
    background-color 160ms ease-out;
}
.support-page select {
  appearance: none;
  padding-inline-end: 36px;
  background: #fdfdfd url(/assets/select-chevron.svg) no-repeat right 10px center / 16px;
}
.support-page textarea {
  min-height: 160px;
  line-height: 1.5;
  resize: vertical;
}
:where(:root:not([data-pointer='touch'])) .support-page :is(input, select, textarea):hover:not(:focus, :disabled),
:where(:root:not([data-pointer='touch'])) #article-search:hover:not(:focus) {
  border-color: #616161;
}
.support-page :is(input, select, textarea):focus,
#article-search:focus {
  border-color: var(--ink);
  background-color: #fff;
}
/* help-support.js marks a field that needs attention; the rule comes after hover and focus with their
   weight, so the red border stays while the visitor fixes it. */
.support-page :is(input, select, textarea)[aria-invalid='true']:not(:disabled) {
  border-color: #c70a24;
  background-color: #fff7f7;
}
.field-help {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #8e0b21;
  animation: help-error-in 160ms ease-out;
}
.field-error::before {
  content: '!';
  content: '!' / '';
  flex: 0 0 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  background: #c70a24;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
@keyframes help-error-in {
  from {
    opacity: 0;
    translate: 0 -2px;
  }
}
.field-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.field-count {
  margin: 0 0 0 auto;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.field-count[data-near-limit] {
  color: #8a6116;
}

/* Attachment drop zone: the native file input covers the zone, so a click anywhere opens the file picker and
   a dropped file lands in the same input. help-support.js shows the chosen file below. */
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 104px;
  padding: 16px;
  border: 1px dashed var(--input-border);
  border-radius: var(--radius-control);
  background: #fdfdfd;
  text-align: center;
  transition:
    border-color 160ms ease-out,
    background-color 160ms ease-out;
}
.support-page .dropzone input[type='file'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone-prompt {
  display: grid;
  justify-items: center;
  gap: 6px;
  pointer-events: none;
}
.dropzone-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--radius-control);
  background: #fff;
  box-shadow: var(--bevel-secondary);
  color: #303030;
  font-size: 14px;
  font-weight: 550;
}
.dropzone-hint {
  font-size: 13px;
  color: var(--text-secondary);
}
:where(:root:not([data-pointer='touch'])) .dropzone:hover {
  border-color: #616161;
  background-color: #fafafa;
}
.dropzone[data-dragover] {
  border-style: solid;
  border-color: var(--ink);
  background-color: #f1f6f3;
}
.dropzone[data-has-file] {
  border-style: solid;
}
.dropzone:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.dropzone:has(input[aria-invalid='true']) {
  border-color: #c70a24;
  background-color: #fff7f7;
}
.dropzone:has(input:disabled) {
  opacity: 0.55;
}
.dropzone-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  margin: 0;
  font-size: 14px;
}
.dropzone-file [data-file-name] {
  font-weight: 550;
  overflow-wrap: anywhere;
}
.dropzone-file [data-file-size] {
  color: var(--text-secondary);
}
.dropzone-file button {
  min-height: 32px;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Actions: the privacy note beside Shopify's primary button. */
.support-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.support-actions .field-help {
  flex: 1 1 280px;
}
.support-page button[type='submit'] {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-inline-start: auto;
  padding: 8px 20px;
  border: 0;
  border-radius: var(--radius-control);
  background: #303030;
  color: #fff;
  box-shadow: var(--bevel-primary);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 300ms ease,
    box-shadow 300ms ease,
    scale 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.support-page button[type='submit']:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
:where(:root:not([data-pointer='touch'])) .support-page button[type='submit']:not(:disabled):hover {
  background-color: #1a1a1a;
  box-shadow:
    var(--bevel-primary),
    0 12px 22px -12px rgb(26 26 26 / 0.55);
}
@media (prefers-reduced-motion: no-preference) {
  :where(:root:not([data-pointer='touch'])) .support-page button[type='submit']:not(:disabled):hover {
    scale: 1.03;
    --rest-scale: 1.03;
  }
}
/* Shopify's loading button: while a request is on its way the button keeps its size and colour, and after
   200 ms its label gives way to a turning mark, so a fast answer never flashes. */
#theme-support[aria-busy='true'] button[type='submit']:disabled {
  cursor: progress;
  opacity: 1;
  color: transparent;
  transition:
    background-color 300ms ease,
    box-shadow 300ms ease,
    scale 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0s linear 200ms;
}
#theme-support[aria-busy='true'] button[type='submit']::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation:
    help-busy-reveal 1ms linear 200ms both,
    help-busy-turn 700ms linear 200ms infinite;
}
@keyframes help-busy-reveal {
  from {
    visibility: hidden;
  }
}
@keyframes help-busy-turn {
  to {
    rotate: 1turn;
  }
}

/* Result banner, after Shopify's Banner: an icon and the message on the outcome's colour, rising in like
   the theme's popovers; a success draws its check. Focus lands here only so the message is read out; it
   is not a control, so it draws no ring. With no message the box keeps no size but stays a live region. */
#support-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  border-radius: var(--radius-card);
  font-size: 14px;
  line-height: 1.5;
}
#support-status:focus {
  outline: none;
}
#support-status[data-tone] {
  padding: 12px 16px;
  background: var(--status-bg);
  box-shadow: inset 0 0 0 1px var(--status-line);
  animation: help-status-in 160ms ease-out both;
}
#support-status[data-tone='info'] {
  --status-bg: #eaf4ff;
  --status-line: #cfe3fd;
  --status-icon: #00527c;
}
#support-status[data-tone='success'] {
  --status-bg: #cdfee1;
  --status-line: #b4f0cf;
  --status-icon: #29845a;
}
#support-status[data-tone='warning'] {
  --status-bg: #fff1e3;
  --status-line: #ffd6a4;
  --status-icon: #b28400;
}
#support-status[data-tone='error'] {
  --status-bg: #fee9e8;
  --status-line: #fed3d1;
  --status-icon: #c70a24;
}
.status-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: none;
  stroke: var(--status-icon, currentColor);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#support-status:not([data-tone]) .status-icon,
.status-mark {
  display: none;
}
[data-tone='success'] .status-mark-success,
:is([data-tone='error'], [data-tone='warning']) .status-mark-alert,
[data-tone='info'] .status-mark-info {
  display: inline;
}
[data-tone='success'] .status-mark-success {
  stroke-dasharray: 10;
  animation: help-check-draw 360ms cubic-bezier(0.65, 0, 0.35, 1) 120ms both;
}
@keyframes help-check-draw {
  from {
    stroke-dashoffset: 10;
  }
}
@keyframes help-status-in {
  from {
    opacity: 0;
    translate: 0 4px;
  }
}
.support-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .support-page :is(input, select, textarea, button),
  #article-search,
  .dropzone,
  .product-nav > a,
  .nav-item > a,
  .nav-toggle,
  .nav-toggle svg,
  .nav-panel,
  .nav-panel a,
  .article-grid article {
    transition: none;
  }
  #support-status[data-tone],
  .field-error,
  [data-tone='success'] .status-mark-success {
    animation: none;
  }
  #theme-support[aria-busy='true'] button[type='submit']::after {
    animation: help-busy-reveal 1ms linear 200ms both;
  }
}
@media (max-width: 640px) {
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .support-page button[type='submit'] {
    width: 100%;
    margin-inline-start: 0;
  }
}
@media (max-width: 600px) {
  .product-nav {
    padding: 4px 8px;
  }
  /* On a phone a submenu spans the bar instead of hanging off its item. */
  .nav-item {
    position: static;
  }
  .nav-panel,
  .nav-panel:has(> .nav-panel-group + .nav-panel-group) {
    inset-inline: 8px;
    top: calc(100% + 4px);
    width: auto;
    max-width: none;
  }
  .support-card {
    padding: 16px;
  }
  .support-page {
    padding: 24px 16px;
  }
}

/* Meri Options & Promotions guide, policy, terms and support pages (help-mop.mjs). They reuse the guide
   layout and cards; only the date line, the translation notice and the app's UI names are their own. */
.mop-doc .intro .eyebrow,
.mop-support .eyebrow {
  margin: 0;
}
.mop-updated {
  font-size: 14px;
  color: var(--text-secondary);
}
.mop-translation a {
  white-space: nowrap;
}
.ui-name {
  font-weight: 600;
}
.ui-english {
  color: var(--text-secondary);
}
.mop-doc section,
.mop-support section {
  overflow-wrap: anywhere;
}
.mop-support section h2 {
  font-size: 18px;
  margin-bottom: 12px;
}
