/* m-global.css — DKY-style mobile layout, Impulse brand. Loaded after impulse-design-system.css.
   Owns the global chrome: type, buttons, announcement bar, header, menu drawer, footer.
   Phone rules sit under max-width: 768px (the site's breakpoint); desktop keeps its layout. */

/* --- Type ---------------------------------------------------------------- */
:root {
  --fontBody: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --chromeHeaderH: 58px;
}
body, button, input, select, textarea { font-family: var(--fontBody); }
body { color: var(--brandInk); -webkit-font-smoothing: antialiased; }

/* --- Buttons --------------------------------------------------------------- */
.btn { border-radius: 10px; }
.btn--primary { background: var(--brandNavy); color: #fff; border: 1px solid var(--brandNavy); }
.btn--primary:hover { background: var(--brandNavySoft); border-color: var(--brandNavySoft); color: #fff; }
/* Outlined, but on a white fill so it still reads when it sits on a photo. */
.btn--secondary { background: #fff; color: var(--brandNavy); border: 1.5px solid var(--brandNavy); }
.btn--secondary:hover { background: var(--brandSurface); color: var(--brandNavy); }
.btn:focus-visible { outline: 2px solid var(--brandOrange); outline-offset: 2px; }

/* --- Drawer-only blocks never show on desktop ------------------------------ */
.drawer-head, .drawer-search, .drawer-list, .nav-scrim, .announce-bar__chev { display: none; }

/* --- Footer: sign-up row and accordions (shared desktop + phone) ----------- */
.footer-signup { margin: 1.25rem 0 0; max-width: 360px; }
.footer-signup__lead { margin: 0 0 0.5rem; color: #fff; font-size: 0.9375rem; font-weight: 600; line-height: 1.45; }
.footer-signup__row { display: flex; align-items: stretch; border-bottom: 1px solid rgb(255 255 255 / 55%); }
.footer-signup__row input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0; border: 0; background: transparent;
  color: #fff; font-size: 1rem; outline: none;
}
.footer-signup__row input::placeholder { color: rgb(255 255 255 / 70%); }
.footer-signup__row:focus-within { border-bottom-color: var(--brandOrange); }
.footer-signup__btn {
  flex: 0 0 auto; min-height: 48px; min-width: 44px; padding: 0 0 0 1rem; border: 0; background: none;
  color: #fff; font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
}
.footer-acc > summary { list-style: none; }
.footer-acc > summary::-webkit-details-marker { display: none; }
.footer-bottom .footer-social { margin-top: 0; }

@media (min-width: 769px) {
  /* Desktop shows every column open; the summary is just a heading there. */
  .footer-acc > summary { pointer-events: none; }
  .footer-compliance > summary { display: none; }
}

/* ========================================================================== */
@media (max-width: 768px) {
  /* --- Announcement bar: black, 13px, one message with chevrons ------------ */
  .announce-bar { position: relative; background: #000; color: #fff; font-size: 0.8125rem; font-weight: 500; }
  .announce-bar .announce-bar__inner { padding: 0.6rem 2.75rem; min-height: 40px; align-items: center; }
  .announce-bar__chev {
    display: grid; place-items: center; position: absolute; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; color: #fff; opacity: 0.9; pointer-events: none;
  }
  .announce-bar__chev--prev { left: 0.6rem; }
  .announce-bar__chev--next { right: 0.6rem; }

  /* --- Header: menu left, logo centred, account + bag right ---------------- */
  .site-header { padding: 0; min-height: 0; border-bottom: 1px solid var(--brandLine); background: #fff; }
  .site-header .page-width.site-header__inner {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center; gap: 0; height: var(--chromeHeaderH); padding: 0 0.375rem;
  }
  .site-header .nav-toggle {
    display: inline-grid; place-items: center; justify-self: start; grid-column: 1;
    width: 48px; height: 48px; color: var(--brandInk); border-radius: 10px;
  }
  .site-header .nav-toggle > span { display: none; }
  .site-header .site-logo { grid-column: 2; justify-self: center; overflow: visible; display: inline-flex; align-items: center; min-height: 48px; }
  .site-header .site-logo img, .site-header .site-logo .site-logo__img { height: 34px; max-height: 34px; width: auto; max-width: 150px; }
  .site-header .header-actions { grid-column: 3; justify-self: end; gap: 0; }
  .site-header .header-actions .nav-icon { width: 44px; height: 48px; min-width: 44px; color: var(--brandInk); }
  .site-header .header-actions .nav-icon--search,
  .site-header .header-actions .nav-icon--wishlist { display: none; }
  .site-header .header-actions .nav-icon--profile { display: inline-flex; }
  .site-header .header-actions .nav-svg { width: 24px; height: 24px; }
  .site-header .header-actions .nav-count {
    top: 6px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--brandOrange); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 18px;
  }

  /* --- Drawer: slides in from the left ------------------------------------ */
  .has-nav-open, .has-nav-open body { overflow: hidden; }
  .has-nav-open .site-header { z-index: 100; }
  .site-header .site-nav {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 2;
    display: flex; flex-direction: column; width: min(88vw, 380px); height: 100dvh;
    max-height: none; opacity: 1; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border: 0; box-shadow: 8px 0 30px rgb(26 26 46 / 18%);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateX(-102%); visibility: hidden;
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
  }
  .site-header .site-nav.is-open { transform: none; visibility: visible; transition: transform 0.28s ease; }
  .nav-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1; background: rgb(26 26 46 / 45%); }
  @media (prefers-reduced-motion: reduce) {
    .site-header .site-nav, .site-header .site-nav.is-open { transition: none; }
  }

  .drawer-head {
    display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; flex: 0 0 auto;
    height: var(--chromeHeaderH); padding: 0 0.375rem; border-bottom: 1px solid var(--brandLine);
  }
  .drawer-close {
    display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0;
    border: 0; border-radius: 10px; background: none; color: var(--brandInk); cursor: pointer;
  }
  .drawer-head__logo { grid-column: 2; justify-self: center; height: 28px; width: auto; }

  .drawer-search {
    display: flex; align-items: center; gap: 0.6rem; flex: 0 0 auto;
    margin: 1rem 1.25rem 0.25rem; padding: 0 0.9rem; min-height: 48px;
    border: 1px solid var(--brandLine); border-radius: 10px; background: var(--brandSurface); color: var(--brandMuted);
  }
  .drawer-search:focus-within { border-color: var(--brandNavy); background: #fff; }
  .drawer-search input {
    flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 0; border: 0; background: transparent;
    color: var(--brandInk); font-size: 1rem; outline: none; -webkit-appearance: none; appearance: none;
  }
  .drawer-search input::placeholder { color: var(--brandMuted); }

  /* Big rows, shared by curated links, CMS links and account links. */
  .drawer-list, .site-header .site-nav__list {
    display: block; list-style: none; margin: 0; padding: 0 1.25rem; flex: 0 0 auto;
  }
  .drawer-list--primary > li, .site-header .site-nav__list > li { margin: 0; border-bottom: 1px solid var(--brandLine); }
  .drawer-list--primary > li > a,
  .drawer-group > summary,
  .site-header .site-nav__list > li > a,
  .site-header .nav-account-trigger {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    min-height: 56px; padding: 0; margin: 0;
    color: var(--brandInk); font-size: 1.125rem; font-weight: 500; text-decoration: none; cursor: pointer;
  }
  .site-header .site-nav__desk-only { display: none; }

  .drawer-group > summary { list-style: none; }
  .drawer-group > summary::-webkit-details-marker { display: none; }
  .drawer-group > summary svg { flex: 0 0 auto; color: var(--brandMuted); transition: transform 0.2s ease; }
  .drawer-group[open] > summary svg { transform: rotate(180deg); }
  .drawer-group ul { list-style: none; margin: 0; padding: 0 0 0.6rem 0.75rem; }
  .drawer-group li { margin: 0; }
  .drawer-group a {
    display: flex; align-items: center; min-height: 48px;
    color: var(--brandMuted); font-size: 1rem; text-decoration: none;
  }

  /* Account dropdown flattens into the drawer. */
  .site-header .nav-account-trigger { justify-content: flex-start; gap: 0.6rem; background: none; border: 0; }
  .site-header .nav-account-label { max-width: none; }
  .site-header .nav-account-menu {
    position: static; min-width: 0; margin: 0; padding: 0 0 0.6rem 0.75rem;
    border: 0; border-radius: 0; box-shadow: none; background: none;
  }
  .site-header .nav-account-menu a, .site-header .nav-account-menu button[role="menuitem"] {
    display: flex; align-items: center; min-height: 48px; padding: 0 !important;
    color: var(--brandMuted); font-size: 1rem;
  }
  .site-header .nav-account-menu a:hover { background: none; }

  .drawer-list--secondary {
    margin-top: auto; padding: 0.75rem 1.25rem 1.25rem; background: var(--brandSurface);
    border-top: 1px solid var(--brandLine);
  }
  .drawer-list--secondary li { margin: 0; }
  .drawer-list--secondary a {
    display: flex; align-items: center; gap: 0.75rem; min-height: 50px;
    color: var(--brandInk); font-size: 1rem; text-decoration: none; overflow-wrap: anywhere;
  }
  .drawer-list--secondary svg { flex: 0 0 auto; color: var(--brandNavy); }

  /* --- Footer: blurb, sign-up, accordions on brand navy ------------------- */
  .site-footer { background: var(--brandNavy); color: #fff; font-size: 0.9375rem; }
  .site-footer .footer-top { display: block; padding: 2.25rem 1.25rem 0.5rem; }
  .footer-brand { text-align: center; padding-bottom: 1.5rem; }
  .footer-brand__logo { display: inline-flex; align-items: center; min-height: 48px; }
  .footer-brand__logo img { height: 40px; margin: 0 auto; }
  .site-footer .footer-about { margin: 1rem auto 0; max-width: 34ch; color: rgb(255 255 255 / 85%); font-size: 0.9375rem; line-height: 1.6; }
  .footer-signup { margin: 1.5rem auto 0; max-width: none; text-align: left; }
  .footer-signup__lead { text-align: center; }
  .site-footer .footer-contact { align-items: center; margin-top: 1rem; gap: 0; }
  .site-footer .footer-contact a { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9375rem; }

  .site-footer .footer-nav { display: block; border-top: 1px solid rgb(255 255 255 / 22%); }
  .footer-acc { border-bottom: 1px solid rgb(255 255 255 / 22%); }
  .footer-acc > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    min-height: 56px; cursor: pointer;
  }
  .footer-acc > summary::after {
    content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin-right: 4px;
    border-right: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: translateY(-3px) rotate(45deg); transition: transform 0.2s ease;
  }
  .footer-acc[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
  .site-footer .footer-acc > summary h4 {
    margin: 0; color: #fff; font-size: 1.0625rem; font-weight: 500; letter-spacing: 0; text-transform: none;
  }
  .footer-acc__body { padding: 0 0 1rem; }
  .site-footer .footer-col a {
    display: flex; align-items: center; min-height: 44px; margin: 0;
    color: rgb(255 255 255 / 85%); font-size: 0.9375rem;
  }

  .site-footer .footer-compliance {
    margin: 0 1.25rem; padding: 0; border-top: 0;
    color: rgb(255 255 255 / 80%); font-size: 0.875rem; line-height: 1.6;
  }
  .footer-compliance .footer-acc__body p { margin: 0 0 0.6rem; }
  /* Inline links in the legal copy: padded so each still has a ~44px tap area. */
  .footer-compliance a { display: inline-block; padding: 0.8rem 0; margin: -0.6rem 0; text-decoration: underline; text-underline-offset: 2px; }

  .site-footer .footer-bottom {
    flex-direction: column; align-items: center; gap: 1rem; text-align: center;
    padding: 1.75rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    border-top: 0; color: rgb(255 255 255 / 75%); font-size: 0.8125rem;
  }
  .footer-bottom .footer-social { justify-content: center; gap: 0.5rem; }
  .footer-bottom .footer-social a { width: 44px; height: 44px; }
  .footer-credit a { min-height: 44px; }
}

/* Official payment marks (includes/pay_logos.html), used on the homepage
   trust section, product page and cart. White chips keep each brand's own
   colours legible on any background. */
.pay-logos { margin-top: 0.75rem; }
.pay-logos__row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.pay-logo {
  display: inline-grid; place-items: center; width: 46px; height: 32px;
  background: #fff; border: 1px solid var(--brandLine); border-radius: 6px;
}
.pay-logos__secured {
  display: flex; align-items: center; gap: 0.35rem; margin: 0.5rem 0 0;
  color: var(--brandMuted); font-size: 0.8125rem;
}
.sales-point__icon { display: inline-grid; place-items: center; margin-bottom: 0.5rem; color: var(--brandNavy); }
.pdp__promises + .pay-logos { display: flex; justify-content: center; }
.pay-logo svg { width: 32px; height: 22px; }
.pay-logo--dark { background: var(--brandNavy); border-color: var(--brandNavy); }
.pay-logo--dark img { display: block; width: 36px; height: auto; }

/* Sign-in sheet (base.html + js/auth-sheet.js). Bottom sheet on phones,
   centred dialog on wider screens. */
.auth-sheet { position: fixed; inset: 0; z-index: 120; }
.auth-sheet[hidden] { display: none; }
.has-auth-sheet, .has-auth-sheet body { overflow: hidden; }
.auth-sheet__scrim { position: absolute; inset: 0; background: rgb(26 26 46 / 50%); opacity: 0; transition: opacity 0.2s ease; }
.auth-sheet.is-open .auth-sheet__scrim { opacity: 1; }
.auth-sheet__panel {
  position: absolute; inset: auto 0 0; display: flex; flex-direction: column;
  max-height: 92dvh; background: #fff; border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 34px rgb(26 26 46 / 22%);
  transform: translateY(100%); transition: transform 0.22s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.auth-sheet.is-open .auth-sheet__panel { transform: translateY(0); }
.auth-sheet__grip { width: 40px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: var(--brandLine); }
.auth-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 0.25rem 0.5rem 0.25rem 1.25rem; }
.auth-sheet__head h2 { margin: 0; font-size: 1.2rem; }
.auth-sheet__close { display: grid; place-items: center; width: 48px; height: 48px; border: 0; background: none; color: var(--brandInk); cursor: pointer; }
.auth-sheet__offer {
  margin: 0 1.25rem 0.75rem; padding: 0.7rem 0.85rem; border-radius: 10px;
  background: var(--brandSurface); border: 1px dashed var(--brandOrange); font-size: 0.9rem; color: var(--brandInk);
}
.auth-sheet__body { overflow-y: auto; padding: 0 1.25rem 1.25rem; -webkit-overflow-scrolling: touch; }
.auth-sheet__loading { margin: 2rem 0; text-align: center; color: var(--brandMuted); }
/* The mounted form card drops its page-card framing inside the sheet. */
.auth-sheet__body .account-card { margin: 0; padding: 0; border: 0; box-shadow: none; max-width: none; background: none; }
.auth-sheet__body input:not([type="checkbox"]):not([type="radio"]) { font-size: 16px; min-height: 48px; }
.auth-sheet__body .btn { min-height: 50px; }
@media (min-width: 769px) {
  .auth-sheet__panel {
    inset: 50% auto auto 50%; width: min(440px, calc(100vw - 2rem)); max-height: 86vh;
    border-radius: 16px; transform: translate(-50%, -46%); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .auth-sheet.is-open .auth-sheet__panel { transform: translate(-50%, -50%); opacity: 1; }
  .auth-sheet__grip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-sheet__panel, .auth-sheet__scrim { transition: none; }
}

/* Navbar: one "Sign in" entry with an icon, instead of two text links. */
.nav-signin__link { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; }
@media (min-width: 769px) {
  .nav-signin__link {
    padding: 0 1rem; border: 1px solid var(--brandInk); border-radius: 999px;
    font-weight: 600; text-decoration: none;
  }
  .nav-signin__link:hover { background: var(--brandInk); color: #fff; }
}

/* Sign-in sheet: keep it to field, consent, button, one link row. */
.auth-sheet #phone-hint, .auth-sheet #phone-name-hint { display: none; }
.auth-sheet .phone-auth__consent { font-size: 0.8125rem; line-height: 1.45; color: var(--brandMuted); align-items: flex-start; gap: 0.6rem; }
.auth-sheet .phone-auth__consent input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--brandNavy); }
.auth-sheet [data-phone-status]:empty { display: none; }
.auth-sheet .account-card__links { margin: 0.75rem 0 0; text-align: center; font-size: 0.875rem; color: var(--brandMuted); }
.auth-sheet .account-card__links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--brandNavy); }
.auth-sheet .pdp-field { margin-bottom: 0.75rem; }
.auth-sheet .pdp-field label { font-size: 0.875rem; font-weight: 600; }
.phone-auth__alt a { padding: 0 0.15rem; }

/* Post-delivery review page (customers/order_review.html). */
.order-review { max-width: 560px; }
.order-review h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.order-review__sub, .order-review__note { color: var(--brandMuted); font-size: 0.9rem; }
.order-review__item { margin: 1rem 0; padding: 1rem; border: 1px solid var(--brandLine); border-radius: 12px; }
.order-review__name { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; padding: 0; }
.order-review__name img { border-radius: 8px; object-fit: cover; background: var(--productMat); }
/* Five large stars; row-reverse so "4" also lights 1–3 with pure CSS. */
.order-review__stars { display: inline-flex; flex-direction: row-reverse; gap: 0.25rem; margin: 0.75rem 0 0.5rem; }
.order-review__stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.order-review__stars label { font-size: 2.25rem; line-height: 1; color: var(--brandLine); cursor: pointer; padding: 0 0.1rem; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.order-review__stars input:checked ~ label, .order-review__stars label:hover, .order-review__stars label:hover ~ label { color: #e8a317; }
.order-review__stars input:focus-visible + label { outline: 2px solid var(--brandNavy); border-radius: 6px; }
.order-review textarea { width: 100%; font-size: 16px; padding: 0.6rem; border: 1px solid var(--brandLine); border-radius: 10px; }
.order-review__done { color: #1b7a3a; font-weight: 600; margin: 0.5rem 0 0; }
.checkout-field__help { margin: 0.3rem 0 0; font-size: 0.8125rem; color: var(--brandMuted); }
