/*
  Maido Customs Pure PHP Rebuild - Stage 3S
  Mobile hero image + cart icon + very small header icon sizing tune.
  This is an override layer on top of Stage 3R.
*/

:root {
  --maido-stage3s-mobile-hero-fallback: url('/image/catalog/imgs/banner-mble-1.png');
}

/* Add/size the shopping cart icon beside the login/account icon. */
html body .maido-stage3s-cart-icon {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 38px !important;
  color: #050505 !important;
  text-decoration: none !important;
  flex: 0 0 auto !important;
}

html body .maido-stage3s-cart-svg {
  width: 29px !important;
  height: 31px !important;
  display: block !important;
}

html body .maido-stage3s-cart-count {
  position: absolute !important;
  right: -9px !important;
  top: -5px !important;
  min-width: 18px !important;
  height: 18px !important;
  border: 1px solid #aeb3b9 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #777 !important;
  font: 600 10px/16px Arial, sans-serif !important;
  text-align: center !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.12) !important;
}

html body .maido-stage3s-cart-icon:hover {
  opacity: .75 !important;
}

/* Increase the small right-side header icons very slightly, as requested. */
html body.has-hero-header .site-header--hero .header-actions {
  gap: clamp(16px, 1.35vw, 22px) !important;
}

html body.has-hero-header .site-header--hero .header-icon,
html body.has-hero-header .site-header--hero .maido-stage3r-envelope-contact,
html body.has-hero-header .site-header--hero .maido-stage3s-cart-icon {
  transform: scale(1.06) !important;
  transform-origin: center center !important;
}

/* Keep desktop dropdowns compact; avoid wasted whitespace from earlier overrides. */
html body .maido-stage3k-menu-panel,
html body.has-hero-header .maido-stage3k-menu-panel {
  min-width: 218px !important;
  width: 218px !important;
  max-width: min(72vw, 260px) !important;
}

html body .maido-stage3k-row,
html body .maido-stage3k-view-all {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 13px !important;
}

html body .maido-stage3k-menu-panel a,
html body .maido-stage3k-menu-panel .maido-stage3k-category-link,
html body .maido-stage3k-view-all,
html body .maido-stage3k-menu-panel span {
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.05 !important;
}

html body .maido-stage3k-level-1 > .maido-stage3k-has-children > .maido-stage3k-tree,
html body .maido-stage3k-level-1 > .maido-stage3k-has-children > ul,
html body .maido-stage3k-level-1 > .maido-stage3k-has-children > .maido-stage3k-level-2 {
  min-width: 210px !important;
  width: 210px !important;
  max-width: min(72vw, 250px) !important;
}

html body .maido-stage3k-level-2 .maido-stage3k-row,
html body .maido-stage3k-level-3 .maido-stage3k-row {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 13px !important;
}

/* Mobile/shrunk hero: use the requested mobile-view image when it exists. */
@media (max-width: 980px) {
  html body.maido-stage3k-home .landing-hero,
  html body.has-hero-header .landing-hero {
    background-image: var(--maido-stage3s-mobile-hero-image, var(--maido-stage3s-mobile-hero-fallback)) !important;
    background-size: cover !important;
    background-position: center center !important;
  }

  /* On mobile, keep Contact inside the hamburger menu so the header does not become crowded. */
  html body .maido-stage3r-envelope-contact {
    display: none !important;
  }

  html body.has-hero-header .site-header--hero .header-actions {
    gap: 15px !important;
  }

  html body.has-hero-header .site-header--hero .header-icon,
  html body.has-hero-header .site-header--hero .maido-stage3s-cart-icon {
    transform: scale(1.08) !important;
  }

  html body.has-hero-header .site-header--hero .menu-toggle {
    width: 50px !important;
    height: 50px !important;
    align-items: center !important;
  }

  html body.has-hero-header .site-header--hero .menu-toggle span {
    width: 38px !important;
    height: 4px !important;
    min-height: 4px !important;
    border-radius: 999px !important;
  }

  html body .maido-stage3s-cart-icon {
    width: 34px !important;
    height: 38px !important;
  }

  html body .maido-stage3s-cart-svg {
    width: 29px !important;
    height: 31px !important;
  }

  html body .maido-stage3s-cart-count {
    right: -8px !important;
    top: -4px !important;
  }

  /* Prevent the mobile hero heading from running out of the screen. */
  html body.maido-stage3k-home .landing-hero h1,
  html body.maido-stage3k-home .landing-hero__title,
  html body.has-hero-header .landing-hero h1,
  html body.has-hero-header .landing-hero__title {
    font-size: clamp(17px, 4.45vw, 22px) !important;
    letter-spacing: -.045em !important;
    white-space: normal !important;
    max-width: calc(100vw - 44px) !important;
  }
}

@media (max-width: 560px) {
  html body.has-hero-header .site-header--hero .container.header-grid,
  html body.has-hero-header .site-header--hero .container.header-grid--landing {
    grid-template-columns: 56px 1fr auto !important;
  }

  html body.has-hero-header .site-header--hero .header-actions {
    gap: 13px !important;
  }

  html body.has-hero-header .site-header--hero .header-icon,
  html body.has-hero-header .site-header--hero .maido-stage3s-cart-icon {
    transform: scale(1.06) !important;
  }
}
