/* Keep the original desktop arrow-only control. */
#back-to-top .lio-back-to-top-label{display:none;}

/* LioPlus 0.3.56 — floating mobile dock inspired by the approved capsule layout. */
@media (max-width: 600px) {
  body {
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-bottom {
    position: fixed !important;
    z-index: 850 !important;
    right: 16px !important;
    left: 90px !important;
    bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    display: flex !important;
    width: auto !important;
    height: 58px !important;
    min-height: 58px !important;
    align-items: center !important;
    justify-content: space-around !important;
    gap: 0 !important;
    padding: 4px 7px !important;
    overflow: visible !important;
    border: 1px solid #e7eaf0 !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: 0 9px 28px rgba(15,23,42,.13), 0 2px 7px rgba(15,23,42,.05) !important;
    direction: rtl !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-sizing: border-box !important;
  }

  .mobile-bottom > .mobile-dock-item {
    position: relative !important;
    display: grid !important;
    flex: 1 1 20% !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: 46px !important;
    min-height: 46px !important;
    align-items: center !important;
    justify-items: center !important;
    align-content: center !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #7b8798 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    line-height: 1 !important;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom > .mobile-dock-item > svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
  }

  .mobile-bottom > .mobile-dock-item > span {
    display: none !important;
  }

  .mobile-bottom > .mobile-dock-item.active {
    color: #202b42 !important;
    background: #f0f1f3 !important;
  }

  .mobile-bottom > .mobile-dock-item:focus-visible {
    outline: 2px solid #8b1538 !important;
    outline-offset: 2px;
  }

  .mobile-bottom .mobile-dock-count {
    position: absolute !important;
    top: 3px !important;
    right: calc(50% - 17px) !important;
    display: grid !important;
    min-width: 15px !important;
    width: 15px !important;
    height: 15px !important;
    place-items: center !important;
    padding: 0 !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
    background: #ef4444 !important;
    color: #fff !important;
    font: 700 8px/1 Tahoma,Arial,sans-serif !important;
  }

  /* The existing scroll-to-top action becomes the small caption pill above the dock. */
  #back-to-top {
    position: fixed !important;
    z-index: 860 !important;
    right: auto !important;
    left: 50% !important;
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    display: inline-flex !important;
    width: auto !important;
    min-width: 98px !important;
    height: 34px !important;
    min-height: 34px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #f1f2f4 !important;
    color: #64748b !important;
    box-shadow: 0 4px 14px rgba(15,23,42,.06) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    transform: translate(-50%,8px) !important;
  }

  #back-to-top.visible {
    transform: translate(-50%,0) !important;
  }

  #back-to-top .lio-back-to-top-arrow {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
  }

  #back-to-top .lio-back-to-top-label {
    display: inline;
    white-space: nowrap;
  }

  /* Keep the plugin's real gift orb as a separate round launcher to the left of the dock. */
  body .lio-floating-cart {
    z-index: 910 !important;
    right: auto !important;
    left: max(16px, env(safe-area-inset-left)) !important;
    bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    width: min(380px, calc(100vw - 32px)) !important;
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    transform-origin: bottom left !important;
  }

  body .lio-floating-cart.is-orb,
  body .lio-floating-cart[data-presentation="orb"] {
    right: auto !important;
    left: max(16px, env(safe-area-inset-left)) !important;
    bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
  }

  body .lio-floating-cart.is-orb > button.lio-floating-cart__capsule,
  body .lio-floating-cart[data-presentation="orb"] > button.lio-floating-cart__capsule {
    right: auto !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    box-shadow: 0 8px 22px rgba(110,8,48,.28) !important;
  }

  body .lio-floating-cart.is-orb .lio-floating-cart__orb-mark svg,
  body .lio-floating-cart[data-presentation="orb"] .lio-floating-cart__orb-mark svg {
    width: 35px !important;
    height: 35px !important;
  }

  /* During the plugin's temporary cart capsule or expanded panel state, lift it above the dock. */
  body .lio-floating-cart:not(.is-orb):not([data-presentation="orb"]):not(.is-expanded) {
    right: auto !important;
    left: max(16px, env(safe-area-inset-left)) !important;
    bottom: calc(128px + env(safe-area-inset-bottom)) !important;
    width: min(380px, calc(100vw - 32px)) !important;
  }

  body .lio-floating-cart.is-expanded {
    right: 16px !important;
    left: 16px !important;
    bottom: calc(128px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: 430px !important;
    height: 72px !important;
    margin: 0 auto !important;
  }
}

@media (max-width: 360px) {
  .mobile-bottom {
    right: 12px !important;
    left: 78px !important;
  }

  body .lio-floating-cart.is-orb,
  body .lio-floating-cart[data-presentation="orb"] {
    width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
  }

  body .lio-floating-cart.is-orb > button.lio-floating-cart__capsule,
  body .lio-floating-cart[data-presentation="orb"] > button.lio-floating-cart__capsule {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
  }
}
