/**
 * Rylan interaction fixes
 * Scope: Chaty launcher and Astra mobile navigation only.
 * Homepage content, card order and grid layout are intentionally untouched.
 */

/* Keep Chaty's native green launcher; remove the inherited gold metal button. */
body.rylan-blackgold-active .chaty-widget button.open-chaty,
body.rylan-blackgold-active .chaty-widget button.open-chaty:hover,
body.rylan-blackgold-active [id^='chaty-widget'] button.open-chaty,
body.rylan-blackgold-active [id^='chaty-widget'] button.open-chaty:hover {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  transform: none !important;
}

/* The site header should remain in normal document flow and never follow scrolling. */
body.rylan-blackgold-active .site-header,
body.rylan-blackgold-active header.site-header,
body.rylan-blackgold-active .ast-primary-header-bar,
body.admin-bar.rylan-blackgold-active .site-header,
body.admin-bar.rylan-blackgold-active header.site-header {
  position: relative !important;
  top: auto !important;
  inset-block-start: auto !important;
  transform: none !important;
}

@media (max-width: 921px) {
  body.rylan-blackgold-active.ast-header-break-point .ast-mobile-header-content,
  body.rylan-blackgold-active.ast-header-break-point .main-header-bar-navigation {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(72vh, 620px) !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #050608 !important;
    overscroll-behavior: contain;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu {
    position: relative !important;
    top: auto !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 6px 12px 12px !important;
    background: rgba(5, 6, 8, 0.985) !important;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu > .menu-item {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    min-height: 52px !important;
    border-bottom: 1px solid rgba(215, 180, 106, 0.13) !important;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .menu-link {
    display: flex !important;
    min-height: 52px !important;
    align-items: center !important;
    padding: 13px 16px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .menu-item-has-children > .menu-link {
    padding-right: 70px !important;
  }

  /* Astra renders a second arrow inside the link; hide it so taps cannot overlap. */
  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .menu-item-has-children > .menu-link .dropdown-menu-toggle {
    display: none !important;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .ast-menu-toggle {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    z-index: 4 !important;
    display: grid !important;
    width: 56px !important;
    height: 44px !important;
    min-width: 56px !important;
    min-height: 44px !important;
    padding: 0 !important;
    place-items: center !important;
    color: #e5cb7e !important;
    background: rgba(215, 180, 106, 0.055) !important;
    border: 0 !important;
    border-left: 1px solid rgba(215, 180, 106, 0.18) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .ast-menu-toggle:hover,
  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .ast-menu-toggle:focus {
    color: #f3dda0 !important;
    background: rgba(215, 180, 106, 0.095) !important;
    box-shadow: none !important;
    transform: none !important;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .ast-menu-toggle:focus-visible {
    outline: 2px solid #e6cc80 !important;
    outline-offset: -3px !important;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .sub-menu {
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 4px 0 9px 12px !important;
    background: rgba(255, 255, 255, 0.018) !important;
    border: 0 !important;
    border-left: 1px solid rgba(215, 180, 106, 0.22) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .sub-menu .menu-item {
    min-height: 48px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045) !important;
  }

  body.rylan-blackgold-active.ast-header-break-point .main-header-menu .sub-menu .menu-link {
    min-height: 48px !important;
    padding: 12px 14px !important;
    border-radius: 0 !important;
    font-size: 12px !important;
  }

  /* Floating purchase/chat controls must not cover an open navigation drawer. */
  body.rylan-blackgold-active.ast-main-header-nav-open .rylan-sticky-buy,
  body.rylan-blackgold-active.ast-main-header-nav-open .chaty-widget,
  body.rylan-blackgold-active.ast-main-header-nav-open [id^='chaty-widget'] {
    display: none !important;
  }
}
