/* ==========================================================================
   AKASHOP - phone & tablet fixes
   Loaded last, so it wins over the theme defaults.
   Breakpoints follow Dawn: < 750px phone, < 990px "mobile header".
   ========================================================================== */

/* --- Header ------------------------------------------------------------- */
@media screen and (max-width: 989px) {
  .header {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 1.2rem !important;
    min-height: 52px !important;
    box-sizing: border-box !important;
  }
  .header__left-group {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.2rem !important;
    flex: 0 0 auto !important;
    z-index: 3 !important;
  }
  header-drawer {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .header__icons--left {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .header__heading {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    z-index: 2 !important;
    pointer-events: auto !important;
    max-width: calc(100% - 180px) !important;
  }
  .header__heading-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .header__heading-logo-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
  }
  .header__heading-logo {
    max-height: 3.6rem !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
  }
  .header__icons:not(.header__icons--left) {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 3 !important;
  }
  .header__icon {
    height: 4.4rem !important;
    width: 4.4rem !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .header__icon--cart {
    margin-right: 0 !important;
  }
  .header__inline-menu {
    display: none !important;
  }

  /* Full-width Search modal on mobile */
  .search-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: auto !important;
    min-height: 68px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    z-index: 100 !important;
  }
  .search-modal__content {
    display: flex !important;
    align-items: center !important;
    padding: 1rem 1.4rem !important;
    width: 100% !important;
  }
  .search-modal__form {
    flex: 1 !important;
  }
  .search-modal__close-button {
    margin-left: 0.6rem !important;
  }
}

/* --- Mobile Menu Drawer (REVO Radiant Blue Style) ------------------------ */
#menu-drawer.menu-drawer {
  width: min(86vw, 380px) !important;
  max-width: 86vw !important;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(0, 140, 255, 0.42) 0%, rgba(214, 32, 31, 0.2) 40%, transparent 75%),
    linear-gradient(180deg, #030712 0%, #051329 28%, #092a63 65%, #0062ff 100%) !important;
  border: 0 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 15px 0 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(214, 32, 31, 0.25) !important;
  color: #ffffff !important;
  filter: none !important;
  overflow: hidden !important;
}

#menu-drawer .menu-drawer__inner-container,
#menu-drawer .menu-drawer__navigation-container {
  background: transparent !important;
  color: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

/* Header bar with 'Menu' and ✕ close button */
#menu-drawer .menu-drawer__title-and-close-btn {
  min-height: 64px !important;
  padding: 14px 22px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(3, 7, 18, 0.45) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

#menu-drawer .menu-drawer__title {
  font-size: 2.1rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: -0.02em !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.8rem !important;
}

#menu-drawer .menu-drawer__close-btn {
  color: #ffffff !important;
  width: 4rem !important;
  height: 4rem !important;
  min-width: 4rem !important;
  min-height: 4rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}

#menu-drawer .menu-drawer__close-btn:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  transform: rotate(90deg) !important;
}

#menu-drawer .menu-drawer__close-btn .svg-wrapper,
#menu-drawer .menu-drawer__close-btn svg {
  width: 1.6rem !important;
  height: 1.6rem !important;
  color: #ffffff !important;
}

/* Navigation list */
#menu-drawer .menu-drawer__navigation {
  padding: 8px 0 20px !important;
  border: 0 !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

#menu-drawer .menu-drawer__menu {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

#menu-drawer .menu-drawer__menu li {
  margin-bottom: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#menu-drawer .menu-drawer__menu-item,
#menu-drawer .menu-drawer__close-button {
  color: #ffffff !important;
  background: transparent !important;
  font-size: 1.65rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.01em !important;
  padding: 1.4rem 2.2rem !important;
  min-height: 5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  transition: background 0.15s ease, padding-left 0.15s ease, color 0.15s ease !important;
  text-decoration: none !important;
  width: 100% !important;
}

#menu-drawer .menu-drawer__menu-item:hover,
#menu-drawer .menu-drawer__menu-item--active,
#menu-drawer .menu-drawer__menu-item:focus {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  padding-left: 2.6rem !important;
}

#menu-drawer .menu-drawer__menu-item--active {
  background: rgba(214, 32, 31, 0.25) !important;
  border-left: 4px solid #38bdf8 !important;
}

#menu-drawer .menu-drawer__menu-item .icon-arrow,
#menu-drawer .menu-drawer__menu-item > .svg-wrapper {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: rgba(255, 255, 255, 0.75) !important;
  width: 1.6rem !important;
  height: 1.6rem !important;
  position: static !important;
  transform: none !important;
  transition: transform 0.2s ease, color 0.2s ease !important;
}

#menu-drawer .menu-drawer__menu-item:hover .icon-arrow,
#menu-drawer .menu-drawer__menu-item:hover > .svg-wrapper {
  color: #ffffff !important;
  transform: translateX(4px) !important;
}

#menu-drawer .menu-drawer__menu-item .icon-caret {
  display: none !important;
}

#menu-drawer svg path {
  fill: currentColor !important;
}

/* Submenu styling */
#menu-drawer .menu-drawer__submenu {
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(0, 140, 255, 0.42) 0%, rgba(214, 32, 31, 0.2) 40%, transparent 75%),
    linear-gradient(180deg, #030712 0%, #051329 28%, #092a63 65%, #0062ff 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
}

#menu-drawer .menu-drawer__close-button {
  color: #ffffff !important;
  font-weight: 700 !important;
  background: rgba(3, 7, 18, 0.4) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
  margin-top: 0 !important;
  padding: 1.5rem 2.2rem !important;
  cursor: pointer !important;
  justify-content: flex-start !important;
  gap: 1rem !important;
}

#menu-drawer .menu-drawer__close-button .svg-wrapper {
  transform: rotate(180deg) !important;
  margin-right: 0.6rem !important;
}

/* Bottom utility links */
#menu-drawer .menu-drawer__utility-links {
  background: rgba(3, 7, 18, 0.5) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  padding: 1.6rem 2.2rem !important;
  color: #ffffff !important;
}

#menu-drawer .list-social {
  display: flex !important;
  align-items: center !important;
  gap: 1.2rem !important;
  margin: 0 !important;
}

#menu-drawer .list-social__link {
  color: rgba(255, 255, 255, 0.8) !important;
  transition: color 0.2s ease, transform 0.2s ease !important;
  padding: 0.6rem !important;
}

#menu-drawer .list-social__link:hover {
  color: #ffffff !important;
  transform: scale(1.15) !important;
}

/* Backdrop dim overlay */
.js menu-drawer > details > summary:before,
.js menu-drawer > details[open]:not(.menu-opening) > summary:before,
header-drawer details[open] > summary:before {
  background: rgba(3, 7, 18, 0.7) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

/* Announcement bar: shorter line height so a long message stays 2 lines. */
@media screen and (max-width: 749px) {
  .announcement-bar__message {
    font-size: 1.15rem !important;
    line-height: 1.35 !important;
    padding: 0.8rem 1.2rem !important;
    letter-spacing: 0 !important;
  }
}

/* --- Rich product sections --------------------------------------------- */
/* Without component-image-with-text.css these collapsed into two ~147px
   columns on a phone. Keep them stacked below the tablet breakpoint. */
@media screen and (max-width: 749px) {
  .image-with-text__grid {
    display: block !important;
  }
  .image-with-text__grid > .grid__item {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 1.6rem 0 !important;
  }
  .image-with-text__content {
    padding: 2rem 1.6rem !important;
  }
  .image-with-text__heading {
    font-size: 2.2rem !important;
    line-height: 1.25 !important;
  }
  .image-with-text__text p,
  .image-with-text__text li {
    font-size: 1.5rem !important;
    line-height: 1.6 !important;
  }
}

/* Product media, price and specs on a narrow screen. */
@media screen and (max-width: 749px) {
  .product__title,
  .product__title h1 {
    font-size: 2.2rem !important;
    line-height: 1.25 !important;
  }
  .product__info-container {
    padding: 0 !important;
  }
  .product table,
  .rte table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* imported descriptions sometimes carry fixed pixel widths */
  .rte img,
  .product__description img {
    max-width: 100% !important;
    height: auto !important;
  }
  .rte iframe,
  .product__description iframe {
    max-width: 100% !important;
  }
}

/* --- Sticky buy bar + assistant bubble ---------------------------------- */
/* They used to sit on top of each other at the bottom right. */
@media screen and (max-width: 749px) {
  .stickybuy {
    padding-right: 7.6rem !important;
  }
  body.template-product #akashop-chat-root {
    bottom: 78px !important;
  }
  #akashop-chat-root {
    right: 12px !important;
    bottom: 14px !important;
  }
  .aka-chat-launcher {
    width: 52px !important;
    height: 52px !important;
  }
  .aka-chat-toast {
    width: min(78vw, 270px) !important;
    bottom: 64px !important;
  }
}

/* The footer must never end underneath the floating bubble. */
@media screen and (max-width: 749px) {
  .footer__content-bottom {
    padding-bottom: 7rem !important;
  }
  .footer .bb-locale {
    flex-wrap: wrap;
    row-gap: 0.6rem;
  }
  .footer__content-bottom-wrapper {
    row-gap: 1.2rem;
  }
}

/* --- Grids, cards and forms --------------------------------------------- */
@media screen and (max-width: 749px) {
  .page-width {
    padding-left: 1.6rem !important;
    padding-right: 1.6rem !important;
  }
  .card__heading,
  .card__heading a {
    font-size: 1.4rem !important;
    line-height: 1.35 !important;
  }
  .price,
  .price__container {
    font-size: 1.5rem !important;
  }
  /* no element may push the page sideways */
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }
  .field__input,
  .select__select,
  textarea.text-area {
    font-size: 1.6rem !important; /* stops iOS zooming in on focus */
  }
  .button,
  button.button,
  .shopify-payment-button__button {
    min-height: 4.6rem;
  }
}

/* --- Rich landing sections: force one column on phones ------------------- */
/* zz-product-rich-landing.css pins these items to 50% with !important and a
   two-class selector, and its own 840px block only flips the direction, so the
   text column stayed ~180px wide on a phone. These rules out-specify it. */
@media screen and (max-width: 840px) {
  .revo-custom-landing-sections .image-with-text__grid,
  .revo-custom-landing-sections .image-with-text__grid--reverse {
    display: block !important;
  }
  .revo-custom-landing-sections .image-with-text__grid .image-with-text__text-item,
  .revo-custom-landing-sections .image-with-text__grid .image-with-text__media-item,
  .revo-custom-landing-sections .image-with-text__text-item,
  .revo-custom-landing-sections .image-with-text__media-item,
  .revo-custom-landing-sections .grid__item {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .revo-custom-landing-sections .image-with-text__media,
  .revo-custom-landing-sections .image-with-text__media img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  .revo-custom-landing-sections .image-with-text__content {
    padding: 1.6rem 0 2.4rem !important;
    max-width: 100% !important;
  }
}

/* --- Header and menu drawer must stay on top ---------------------------- */
/* .pdp is a flex container, so .pdp__media (a flex item with z-index: 5)
   created a stacking context above the sticky header (z-index: 3): the product
   photo covered the open mobile menu. */
.pdp__media {
  z-index: 1 !important;
}
.section-header,
#shopify-section-sections--header,
sticky-header {
  z-index: 99 !important;
  position: relative;
}
.menu-drawer,
.menu-drawer-container details[open] > .menu-drawer {
  z-index: 100 !important;
  background-color: #ffffff !important;
  background: #ffffff !important;
}
.menu-drawer__inner-container,
.menu-drawer__navigation-container,
.menu-drawer__navigation,
.menu-drawer__submenu,
.menu-drawer__inner-submenu {
  background-color: #ffffff !important;
  background: #ffffff !important;
}

/* Rich-section pictures were cropped by the 90% aspect box on a phone:
   show the whole photo instead of a zoomed-in slice. */
@media screen and (max-width: 840px) {
  .revo-custom-landing-sections .image-with-text__media {
    padding-bottom: 0 !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .revo-custom-landing-sections .image-with-text__media img {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }
}

/* The drawer's own panel is dark; its inner nav kept a white background,
   so white menu text sat on white and the panel looked empty. */
#menu-drawer .menu-drawer__navigation,
#menu-drawer .menu-drawer__navigation-container,
#menu-drawer .menu-drawer__utility-links,
#menu-drawer .menu-drawer__submenu,
#menu-drawer .menu-drawer__inner-submenu {
  background: transparent !important;
  background-color: transparent !important;
}
