/**
 * menu-drawer.css — mobile slide-out menu (the custom mdr-* drawer).
 *
 * Rebuilds the panel positioning + row styling that used to come from Shopify's
 * component-menu-drawer.css. That file was only ever referenced via a
 * //muzzybrand.com/cdn/shop/t/44/... <link>, which stopped resolving once the
 * domain moved off Shopify, so on the live site the drawer had no panel CSS and
 * never appeared. Hand-maintained; enqueued for mirror views in inc/setup.php.
 *
 * Reveal is driven by mirror-runtime.js, which adds .menu-opening to the
 * <details> (and html.mdr-open) while the drawer is open.
 */

@media screen and (max-width: 989px) {

  /* ---- While open: pin the header on top and lock the page behind it ---- */
  html.mdr-open,
  html.mdr-open body {
    overflow: hidden;
  }

  html.mdr-open #shopify-section-sections--20755254968488__header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    margin: 0;
    background: #fff;
  }

  /* The announcement bar tucks away so only the header sits above the drawer. */
  html.mdr-open .announcement-bar-section {
    display: none;
  }

  /* ---- The off-canvas panel ----
     Shopify's component-menu-drawer.css still loads (from muzzybrand.com) and,
     being later in the document, its .menu-drawer rules win on source order:
     position:absolute + a height that depends on JS-set CSS variables we don't
     have, so the panel collapses to 0 and never shows. The #menu-drawer ID
     outranks every Dawn class selector, so these rules take over cleanly. */
  #menu-drawer {
    display: block; /* override the UA details:not([open]) hide so the panel can slide */
    position: fixed;
    top: var(--mdr-header-h, 64px);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    z-index: 25;
    background: #f8edff;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0.28s ease;
    padding-bottom: 2rem;
    filter: none;
    border: 0;
  }

  details.menu-drawer-container.menu-opening > #menu-drawer,
  details.menu-drawer-container[open] > #menu-drawer {
    transform: translateX(0);
    visibility: visible;
  }

  /* Neutralise Dawn's fixed-height / grid wrappers so the drawer flows as one
     scrollable column (banner -> rows -> account), matching the design. */
  #menu-drawer .menu-drawer__inner-container {
    position: static;
    height: auto;
  }

  #menu-drawer .menu-drawer__navigation-container {
    display: block;
    height: auto;
    overflow: visible;
  }

  #menu-drawer .menu-drawer__navigation {
    padding: 0;
  }

  /* ---- List scaffolding ---- */
  .mdr-menu {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mdr-item {
    margin: 0;
  }

  /* ---- Top-level rows: Shop / Pre Order / Our Story / Gift A Doll / More ---- */
  .mdr-acc-header,
  .mdr-plain-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 18px;
    border-bottom: 1px solid rgba(17, 21, 28, 0.07);
    color: #11151c;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mdr-acc-header::-webkit-details-marker {
    display: none;
  }

  .mdr-acc-header::marker {
    content: "";
  }

  .mdr-acc-header:active,
  .mdr-plain-link:active {
    background: rgba(194, 71, 255, 0.05);
  }

  .mdr-acc-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #11151c;
    line-height: 1.1;
  }

  /* Down chevron on collapsible rows; rotates when its accordion is open. */
  .mdr-chevron {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: #c247ff;
    transition: transform 0.25s ease;
  }

  .mdr-accordion[open] > .mdr-acc-header .mdr-chevron {
    transform: rotate(180deg);
  }

  /* Right-pointing arrow on the plain (non-collapsible) links. */
  .mdr-arrow {
    flex-shrink: 0;
    color: rgba(17, 21, 28, 0.28);
  }

  /* Expanded body of a top-level accordion. */
  .mdr-accordion > .mdr-acc-body {
    padding-bottom: 8px;
  }

  /* ---- More Links sub-list ---- */
  .mdr-sub-list {
    list-style: none;
    margin: 0;
    padding: 2px 0 6px;
  }

  .mdr-sub-list li {
    margin: 0;
  }

  .mdr-leaf {
    display: block;
    padding: 11px 20px 11px 22px;
    font-family: 'Baloo 2', sans-serif;
    font-size: 14.5px;
    color: #3a3a44;
    text-decoration: none;
  }

  .mdr-leaf:active {
    color: #c247ff;
    background: rgba(194, 71, 255, 0.05);
  }

  /* ---- Account / utility row removed: hide the "Log in" + social block ---- */
  #menu-drawer .menu-drawer__utility-links {
    display: none;
  }

  /* ---- The compact desktop picker (header icon row) must not also render
     here — it's a second copy of the same control, not a mobile one. ---- */
  .header__icons--localization {
    display: none;
  }

  /* ---- Country / currency picker: own block, sits where the (hidden)
     utility-links row used to, at the very bottom of the drawer. ---- */
  #menu-drawer .menu-drawer__country-picker {
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(17, 21, 28, 0.07);
    background: #fff;
  }

  .menu-drawer__country-picker-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #11151c;
    margin-bottom: 8px;
  }

  .menu-drawer__country-picker-select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid rgba(194, 71, 255, 0.35);
    border-radius: 10px;
    background: #fff;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    font-size: 14.5px;
    color: #11151c;
    -webkit-appearance: none;
    appearance: none;
  }

  .menu-drawer__country-picker-select:active,
  .menu-drawer__country-picker-select:focus {
    border-color: #c247ff;
    outline: none;
  }
}

/* Drawer is desktop-hidden; the mega-menu nav takes over at >=990px. */
@media screen and (min-width: 990px) {
  header-drawer {
    display: none;
  }

  /* ---- Desktop shipping/country picker: a bare, compact select (no
     globe/visible label — see muzzy_country_picker_html()'s $compact mode)
     sitting inline in the header icon row (icons are ~4.4rem tall) via the
     empty .desktop-localization-wrapper slot. Sized to content and kept
     understated so it reads as part of the icon row, not a form field. ---- */
  .header__icons--localization {
    display: flex;
    align-items: center;
    height: 4.4rem;
  }

  .header__icons--localization .menu-drawer__country-picker {
    display: flex;
    align-items: center;
  }

  .header__icons--localization .menu-drawer__country-picker-select {
    width: auto;
    padding: 4px 8px;
    border: 1px solid rgba(17, 21, 28, 0.15);
    border-radius: 7px;
    background: transparent;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.4;
    color: #11151c;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

  .header__icons--localization .menu-drawer__country-picker-select:hover,
  .header__icons--localization .menu-drawer__country-picker-select:focus {
    border-color: #c247ff;
    outline: none;
  }
}
