/* Glo Little Luxury — commerce chrome shared by cart, checkout and account.
 *
 * Loaded on all three so they open with the same header band. Page-specific
 * rules live in glo-cart-checkout.css and glo-account.css.
 *
 * Nothing here styles cart contents, totals, form fields or payment — those are
 * WooCommerce's markup and are handled in the page stylesheets. */

/* ---------- Header band ---------- */
.glo-commerce-head {
  background: var(--glo-cream);
  border-bottom: 1px solid var(--glo-border);
}
.glo-commerce-head__inner { padding-top: 34px; padding-bottom: 30px; }

.glo-commerce-head__title {
  font-family: var(--glo-font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--glo-ink);
  margin: 0;
}
.glo-commerce-head__sub {
  font-family: var(--glo-font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--glo-ink-soft);
  margin: 8px 0 0;
  max-width: 52ch;
}

/* ---------- Step rail ----------
   Numbered because this genuinely is a sequence of three pages — bag, then
   details, then the confirmation screen — not because numbers look tidy. The
   connector is drawn on the marker's ::after so it never outruns the last step. */
.glo-steps {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}
.glo-step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--glo-font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--glo-stone);
  padding-right: 14px;
}
.glo-step__num {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--glo-border);
  background: var(--glo-surface);
  color: var(--glo-stone);
}
.glo-step:not(:last-child) .glo-step__label::after {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--glo-border);
  vertical-align: middle;
  margin-left: 14px;
}
.glo-step--done { color: var(--glo-teal-ink); }
.glo-step--done .glo-step__num {
  background: var(--glo-teal-bright);
  border-color: var(--glo-teal-bright);
  color: #fff;
}
.glo-step--now { color: var(--glo-ink); font-weight: 600; }
.glo-step--now .glo-step__num {
  border-color: var(--glo-teal-bright);
  color: var(--glo-teal-ink);
  background: var(--glo-teal-50);
  box-shadow: 0 0 0 3px var(--glo-teal-50);
}

/* ---------- Free-delivery meter ----------
   Reads the cart subtotal WooCommerce already computed; it never appears when
   there is no cart to measure, so it cannot show an empty or invented bar. */
.glo-meter { margin-top: 20px; max-width: 460px; }
.glo-meter__text {
  font-family: var(--glo-font-body);
  font-size: 13px;
  color: var(--glo-ink-mid);
  margin: 0 0 7px;
}
.glo-meter__text .amount, .glo-meter__text bdi {
  font-weight: 700;
  color: var(--glo-ink);
  white-space: nowrap;
}
.glo-meter__track {
  height: 5px;
  border-radius: 999px;
  background: var(--glo-linen);
  overflow: hidden;
}
.glo-meter__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--glo-teal-bright);
  transition: width .4s ease;
}
.glo-meter--free .glo-meter__fill,
.glo-meter--qualified .glo-meter__fill { background: var(--glo-success); }
.glo-meter--free .glo-meter__text { color: var(--glo-success); font-weight: 600; }
.glo-meter--qualified .glo-meter__text { color: var(--glo-ink-mid); }
.glo-meter--qualified { max-width: 560px; }

@media (prefers-reduced-motion: reduce) {
  .glo-meter__fill { transition: none; }
}

/* ---------- Trust row ---------- */
.glo-trustwrap { padding-top: 8px; padding-bottom: 48px; }
.glo-trustrow {
  list-style: none;
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--glo-border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.glo-trustrow__item { display: flex; flex-direction: column; gap: 3px; }
.glo-trustrow__title {
  font-family: var(--glo-font-body);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--glo-ink);
}
.glo-trustrow__body {
  font-family: var(--glo-font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--glo-ink-soft);
}

@media (max-width: 720px) {
  .glo-commerce-head__inner { padding-top: 24px; padding-bottom: 22px; }
  .glo-steps { gap: 4px 0; margin-top: 18px; }
  .glo-step { font-size: 12.5px; padding-right: 10px; }
  .glo-step:not(:last-child) .glo-step__label::after { width: 14px; margin-left: 10px; }
  .glo-trustrow { grid-template-columns: 1fr; gap: 14px; }
  .glo-trustwrap { padding-bottom: 32px; }
}

/* ---------- Focus header (checkout + order confirmed) ----------
   Rendered by header.php instead of the full brand header on checkout pages. */
.glo-header--focus { background: var(--glo-bg); border-bottom: 1px solid var(--glo-border); }
.glo-header--focus__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.glo-header--focus__label {
  font-family: var(--glo-font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--glo-ink);
}
.glo-header--focus__help {
  justify-self: end;
  font-family: var(--glo-font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--glo-teal-ink);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.glo-header--focus__help:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 480px) {
  .glo-header--focus__label { display: none; }
  .glo-header--focus__bar { grid-template-columns: 1fr 1fr; }
}

/* ---------- Status chip above the title (order confirmed) ---------- */
.glo-commerce-head__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: var(--glo-teal-50);
  font-family: var(--glo-font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--glo-teal-ink);
}
.glo-commerce-head__tick {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--glo-success);
}
.glo-commerce-head__tick::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- One left edge for band and page ----------
   The page body sits inside #primary, which already carries the site gutter.
   The .glo-wrap inside it added a second one, so above phone width the cards
   started 48px right of the header band's title. */
@media (min-width: 601px) {
  #primary .glo-cartwrap,
  #primary .glo-checkoutwrap,
  #primary .glo-thankswrap { padding-left: 0; padding-right: 0; }
  /* #main inside #primary carries the gutter a second time (glo-site.css gives
     both the same padding). #primary's padding alone now sets the edge. */
  .woocommerce-cart #primary #main.site-main,
  .woocommerce-checkout #primary #main.site-main,
  .woocommerce-account #primary #main.site-main { padding-left: 0; padding-right: 0; }
}

/* ---------- Link on the right of the band (Sign out, Back to orders) ---------- */
.glo-commerce-head__inner.has-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
}
.glo-commerce-head__inner.has-action > * { grid-column: 1; }
.glo-commerce-head__inner.has-action > .glo-commerce-head__action {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
}
.glo-commerce-head__action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: -10px;
  font-family: var(--glo-font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--glo-teal-ink);
  text-decoration: none;
  white-space: nowrap;
}
.glo-commerce-head__action:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) {
  .glo-commerce-head__inner.has-action { grid-template-columns: minmax(0, 1fr); }
  .glo-commerce-head__inner.has-action > .glo-commerce-head__action {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin: 6px 0 -12px;
  }
}
