@import url("/mmp/brand/tokens.css");

/*
 * Make My Page's theme, linked after the core styles (see src/site/README.md).
 * Maps the storefront's design tokens onto the MMP brand kit (public/mmp/brand/tokens.css) so the
 * shared header, footer, product, cart, checkout and inquiry pages match MMP's own pages.
 * Every rule targets storefront classes only; the admin uses its own .admin / .a-* styles.
 */
:root:root {
  --color-background: var(--mmp-paper);
  --color-foreground: var(--mmp-ink);
  --color-foreground-rgb: 13 18 51;
  --color-surface: var(--mmp-tint);
  --color-border: var(--mmp-ink);
  --color-input-border: var(--mmp-line);
  --color-muted: var(--mmp-ink-soft);
  --color-subdued: rgb(13 18 51 / 0.55);

  --color-primary-button-text: #ffffff;
  --color-primary-button-background: var(--mmp-primary);
  --color-primary-button-border: var(--mmp-primary);
  --color-primary-button-hover-background: var(--mmp-primary-deep);
  --color-primary-button-hover-border: var(--mmp-primary-deep);

  /* Orange CTA always carries ink text: white on it fails contrast (2.85:1). */
  --color-secondary-button-text: var(--mmp-ink);
  --color-secondary-button-background: var(--mmp-accent);
  --color-secondary-button-hover-background: #e85a0c;

  --color-badge-sale: var(--mmp-sun);

  --font-body: var(--mmp-font-body);
  --font-heading: var(--mmp-font-display);

  --radius: 14px;

  /* Same container as MMP's own pages (home.module.css .wrap): 72rem, 16px gutters, 32px from 720px. */
  --page-width: 72rem;
  --narrow-page-width: 72rem;
  --gutter: 16px;
}
@media (min-width: 720px) {
  :root:root { --gutter: 32px; }
}

/* Low specificity on purpose: beats the core heading defaults (linked later), while any page's own
   class-based heading styles, like the showcase demos', still win. */
body :where(h1, h2, h3) {
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- 1. Buttons: bold, sentence-case pills like MMP's own pages ---------- */
:root:root .button {
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
}
:root:root .button--secondary { color: var(--color-secondary-button-text); }
:root:root .button:focus-visible,
:root:root .icon-button:focus-visible,
:root:root .cart-line__remove:focus-visible,
:root:root .footer a:focus-visible,
:root:root .footer button:focus-visible {
  outline: 3px solid var(--mmp-primary);
  outline-offset: 2px;
}
:root:root .footer a:focus-visible,
:root:root .footer button:focus-visible { outline-color: var(--mmp-sun); }

/* Smaller buttons on the cart and checkout get the same voice. */
:root:root .upsell__add,
:root:root .checkout__promo-row button,
:root:root .email-signup button {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}
:root:root .product-card__quick-add {
  min-height: 36px;
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}
:root:root .email-signup button { background: var(--mmp-primary); }
:root:root .email-signup button:hover { background: var(--mmp-primary-deep); }
:root:root .email-signup { border-color: var(--mmp-line); }
:root:root .checkout__promo-row input { border-radius: 999px; padding-inline: 16px; }

/* Labels read as sentence case too, not small uppercase tracking. */
:root:root .field label,
:root:root .field .testimonial-product__label {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}
/* 16px inputs: easier to read, and iOS no longer zooms in on focus. Long placeholders end in "…". */
:root:root .field input,
:root:root .field textarea,
:root:root .field select {
  font-size: 1rem;
  border-color: #b9bcd1;
  text-overflow: ellipsis;
}
:root:root .field textarea { white-space: pre-wrap; overflow-wrap: break-word; }
:root:root .field input:focus,
:root:root .field textarea:focus,
:root:root .field select:focus { outline: 2px solid var(--mmp-primary); }

/* ---------- 2. Containers line up with the MMP page bodies ---------- */
/* .page-width already uses --page-width and --gutter (set above). The checkout has its own bands. */
/* MMP's own .wrap is 72rem of content plus its gutters, so the shared header, footer and storefront
   containers measure the same way and every left edge lines up. */
:root:root .page-width { box-sizing: content-box; width: auto; }
:root:root .checkout__header-inner,
:root:root .checkout__footer-inner,
:root:root .checkout__main { max-width: 72rem; }
:root:root .checkout { background: var(--mmp-paper); }
:root:root .checkout__summary { background: var(--mmp-tint); }

/* ---------- 3. Footer: its own dark band, AA links, 44px tap targets ---------- */
:root:root .footer {
  background: var(--mmp-ink);
  color: #ffffff;
  border-top: 4px solid var(--mmp-accent);
  padding-block: 32px;
}
:root:root .footer a,
:root:root .footer button { color: #ffffff; }
:root:root .footer__menu { gap: 4px 24px; }
:root:root .footer__menu a { font-weight: 600; }
:root:root .footer__legal { color: rgb(255 255 255 / 0.8); font-size: 0.875rem; gap: 4px 20px; }
:root:root .footer__legal a,
:root:root .footer__legal button {
  color: rgb(255 255 255 / 0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
}
:root:root .footer__menu a,
:root:root .footer__legal a,
:root:root .footer__legal button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: inherit;
  font-weight: inherit;
}
:root:root .footer__menu a { font-weight: 600; }
:root:root .footer__legal button { border: 0; background: none; padding: 0; cursor: pointer; }
/* CookieSettingsLink sets text-decoration inline; underline it like the other legal links. */
:root:root .footer__legal button[data-cookie-settings] { text-decoration: underline !important; }
:root:root .footer a:hover,
:root:root .footer button:hover { color: var(--mmp-sun); }
@media (max-width: 719px) {
  :root:root .footer__inner { flex-direction: column; gap: 16px; }
  :root:root .footer__menu { flex-direction: column; gap: 0; }
  :root:root .footer__legal { flex-direction: column; align-items: flex-start; gap: 0; }
  :root:root .footer__legal span { padding-block: 4px; }
}

/* ---------- 4. Header and cart drawer: 44px targets, larger thumbnails ---------- */
:root:root .header { border-bottom-color: var(--mmp-line); }
:root:root .header__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}
:root:root .header__actions { gap: 4px; }
:root:root .icon-button {
  width: 44px;
  height: 44px;
  color: inherit;
}
:root:root .icon-button:hover { background: var(--mmp-tint); }
:root:root .cart-count {
  top: 2px;
  right: 0;
  background: var(--mmp-accent);
  color: var(--mmp-ink);
  font-weight: 700;
}
:root:root .header__actions .icon-button:last-child { margin-right: -8px; }

:root:root .drawer { background: var(--mmp-paper); }
:root:root .drawer__header { padding-block: 12px; }
:root:root .drawer__header h2,
:root:root .drawer__header h3 { margin: 0; }
:root:root .drawer__header .icon-button { margin-right: -10px; }
:root:root .drawer__body { padding-block: 8px 20px; }
:root:root .cart-line {
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-block: 16px;
}
:root:root .cart-line img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--mmp-line);
  background: var(--mmp-tint);
}
:root:root .cart-line a { font-weight: 700; line-height: 1.3; }
:root:root .cart-line > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-weight: 700;
}
:root:root .cart-line__remove {
  min-height: 44px;
  min-width: 44px;
  padding: 0 4px;
  margin-right: -4px;
  color: var(--mmp-ink-soft);
  font-size: 0.875rem;
  font-weight: 500;
  text-underline-offset: 3px;
}
:root:root .cart-line__remove:hover { color: var(--mmp-ink); }
:root:root .cart-line .quantity { border-color: #b9bcd1; }
:root:root .cart-total { font-size: 1.0625rem; margin-bottom: 14px; }
:root:root .upsell__item {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  border-radius: 12px;
}
:root:root .upsell__image { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
:root:root .upsell__title { font-weight: 700; }

/* ---------- 5. Inquiry form: two-column option groups from 640px ---------- */
:root:root .inquiry-form__choice {
  align-items: flex-start;
  min-height: 48px;
  padding: 12px 14px;
  border-color: #b9bcd1;
  line-height: 1.35;
}
:root:root .inquiry-form__choice span { min-width: 0; overflow-wrap: anywhere; }
:root:root .inquiry-form .inquiry-form__choice input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--mmp-primary);
}
:root:root .inquiry-form__choice:has(input:checked) {
  border-color: var(--mmp-primary);
  background: var(--mmp-tint);
  box-shadow: inset 0 0 0 1px var(--mmp-primary);
}
:root:root .inquiry-form__choice:has(input:focus-visible) {
  outline: 2px solid var(--mmp-primary);
  outline-offset: 2px;
}
@media (min-width: 640px) {
  :root:root .inquiry-form__choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root:root .inquiry-form__choices > .inquiry-form__help { grid-column: 1 / -1; }
}
:root:root .inquiry-form__required { color: #b3261e; }

/* ---------- 6. Newsletter: a slim band in the page container, heading left, signup right ---------- */
:root:root .newsletter {
  background: var(--mmp-paper);
  border-top: 1px solid var(--mmp-line);
}
:root:root .newsletter__inner {
  box-sizing: content-box;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  grid-template-columns: minmax(0, 1fr);
}
:root:root .newsletter__content {
  padding: 36px 0;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
:root:root .newsletter__content h2 {
  font-family: var(--mmp-font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.2;
}
:root:root .newsletter__content form { flex: 1 1 22rem; max-width: 30rem; }
:root:root .email-signup {
  max-width: none;
  border: 1px solid var(--mmp-line);
  background: #ffffff;
}
:root:root .email-signup:focus-within { border-color: var(--mmp-primary); box-shadow: 0 0 0 1px var(--mmp-primary); }
:root:root .email-signup input { color: var(--mmp-ink); padding: 13px 20px; }
:root:root .email-signup input:focus { outline: none; }
:root:root .email-signup button {
  min-width: 52px;
  background: var(--mmp-accent);
  color: var(--mmp-ink);
  border-radius: 999px;
  margin: 4px;
  padding: 0 18px;
}
:root:root .email-signup button:hover { background: #e85a0c; }
:root:root .email-signup button:focus-visible { outline: 2px solid var(--mmp-primary); outline-offset: 2px; }
