/* Navigation Flow
   Mobile and tablet navigation. Does not alter desktop layout. */

.ivy-mobile-bottom-nav {
  display: none;
}

@media (max-width: 1024px) {
  body {
    padding-bottom: 72px;
  }

  .ivy-mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;

    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));

    min-height: 64px;
    padding:
      6px max(6px, env(safe-area-inset-right))
      max(6px, env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));

    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, .12);
    box-sizing: border-box;
  }

  .ivy-mobile-bottom-nav .ivy-mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;

    min-width: 0;

    color: #111;
    text-decoration: none;
    line-height: 1;
  }

  .ivy-mobile-bottom-nav .ivy-mobile-nav-icon {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 25px;
    height: 25px;
  }

  .ivy-mobile-bottom-nav .ivy-mobile-nav-icon svg {
    width: 23px;
    height: 23px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .ivy-mobile-bottom-nav .ivy-mobile-nav-label {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
  }

  .ivy-mobile-bottom-nav .ivy-mobile-nav-item.is-active .ivy-mobile-nav-label {
    font-weight: 700;
  }

  .ivy-mobile-bottom-nav .ivy-mobile-nav-wishlist.is-active svg {
    fill: currentColor;
  }

  .ivy-mobile-bottom-nav .ivy-mobile-nav-count {
    position: absolute;
    top: -5px;
    right: -8px;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 16px;
    height: 16px;
    padding: 0 4px;

    border-radius: 999px;
    background: #111;
    color: #fff;

    font-size: 9px;
    font-weight: 700;
    line-height: 16px;

    box-sizing: border-box;
    pointer-events: none;
  }
}


/* =========================================================
   Ivy Mobile Nav v1.0.4 — precise mobile integration
   ========================================================= */
.ivy-mobile-scroll-top { display:none; }

@media (max-width:1024px) {
  /* Exact Astra hamburger only. */
  #ast-mobile-header .main-header-menu-toggle,
  #ast-mobile-header .ast-mobile-menu-trigger-minimal {
    display:none !important;
  }

  /* Hide Astra's original mobile cart UI; our bottom Cart remains visible. */
  #ast-mobile-header .ast-header-woo-cart,
  .ast-mobile-header-wrap .ast-header-woo-cart {
    display:none !important;
  }

  /* Native Astra bag copied into bottom navigation. */
  .ivy-mobile-nav-cart .ivy-native-cart-svg {
    width:23px !important;
    height:23px !important;
    display:block;
    fill:currentColor;
    stroke:none;
  }
  .ivy-mobile-nav-cart .ivy-native-cart-svg path {
    fill:currentColor;
    stroke:none;
  }

  /* FilterFlow remains visible above the bottom bar. */
  .ivy-mobile-filter-trigger {
    bottom:calc(78px + env(safe-area-inset-bottom)) !important;
    z-index:9997 !important;
  }

  /* Global mobile back-to-top. */
  .ivy-mobile-scroll-top {
    position:fixed;
    right:16px;
    bottom:calc(78px + env(safe-area-inset-bottom));
    z-index:9996;
    display:flex;
    align-items:center;
    justify-content:center;
    width:42px;
    height:42px;
    padding:0;
    border:1px solid rgba(0,0,0,.14);
    border-radius:50%;
    background:#fff;
    color:#111;
    box-shadow:0 2px 9px rgba(0,0,0,.10);
    opacity:0;
    visibility:hidden;
    transform:translateY(7px);
    transition:opacity .18s ease, transform .18s ease, visibility .18s ease;
  }
  .ivy-mobile-scroll-top.is-visible {
    opacity:1;
    visibility:visible;
    transform:none;
  }
  .ivy-mobile-scroll-top svg {
    width:20px;
    height:20px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  html.ivy-filter-drawer-open .ivy-mobile-bottom-nav,
  html.ivy-filter-drawer-open .ivy-mobile-scroll-top {
    display:none !important;
  }
  html.ivy-filter-drawer-open body {
    padding-bottom:0 !important;
  }
}


/* =========================================================
   Ivy Mobile Nav v1.1.0 — Full-screen mobile cart
   ========================================================= */
.ivy-mobile-cart-panel {
  display: none;
}

@media (max-width: 1024px) {
  html.ivy-mobile-cart-open,
  html.ivy-mobile-cart-open body {
    overflow: hidden !important;
  }

  .ivy-mobile-cart-panel {
    position: fixed;
    inset: 0 0 calc(64px + env(safe-area-inset-bottom)) 0;
    z-index: 9995;
    display: block;
    background: #fff;

    transform: translateX(100%);
    visibility: hidden;
    transition: transform .22s ease, visibility .22s ease;
  }

  .ivy-mobile-cart-panel.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .ivy-mobile-cart-panel-inner {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
  }

  .ivy-mobile-cart-header {
    position: sticky;
    top: 0;
    z-index: 4;

    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;

    min-height: 82px;
    padding: 10px 16px;

    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.10);
  }

  .ivy-mobile-cart-header h2 {
    margin: 0;
    text-align: center;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 600;
  }

  .ivy-mobile-cart-close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ivy-mobile-cart-close svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .ivy-mobile-cart-header-count {
    justify-self: end;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 34px;
    height: 34px;
    padding: 0 8px;

    border-radius: 8px;
    background: #f2f2f2;

    font-size: 17px;
    font-weight: 600;
    line-height: 1;
  }

  .ivy-mobile-cart-body {
    padding-bottom: 24px;
  }

  .ivy-mobile-cart-items {
    padding: 0 16px;
  }

  .ivy-mobile-cart-item {
    display: grid;
    grid-template-columns: 94px minmax(0,1fr) 44px;
    gap: 14px;

    padding: 18px 0;
    border-bottom: 1px solid rgba(0,0,0,.10);
  }

  .ivy-mobile-cart-image {
    width: 94px;
    min-width: 94px;
  }

  .ivy-mobile-cart-image a,
  .ivy-mobile-cart-image img {
    display: block;
    width: 94px;
  }

  .ivy-mobile-cart-image img {
    height: 128px;
    object-fit: cover;
  }

  .ivy-mobile-cart-details {
    min-width: 0;
  }

  .ivy-mobile-cart-details h3 {
    margin: 0 0 7px;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 600;
  }

  .ivy-mobile-cart-details h3 a {
    color: inherit;
    text-decoration: none;
  }

  .ivy-mobile-cart-meta {
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.35;
  }

  .ivy-mobile-cart-meta dl,
  .ivy-mobile-cart-meta p {
    margin: 0;
  }

  .ivy-mobile-cart-view {
    display: inline-block;
    margin-bottom: 10px;

    color: #333;
    text-decoration: underline;
    text-underline-offset: 2px;

    font-size: 14px;
  }

  .ivy-mobile-cart-price {
    margin-bottom: 12px;
    font-size: 17px;
    font-weight: 600;
  }

  .ivy-mobile-cart-remove {
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;

    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .ivy-mobile-cart-qty {
    align-self: start;

    display: grid;
    grid-template-rows: 42px 42px 42px;

    width: 42px;

    border: 1px solid rgba(0,0,0,.14);
    border-radius: 4px;
    overflow: hidden;
  }

  .ivy-mobile-cart-qty-btn,
  .ivy-mobile-cart-qty > span {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    padding: 0;

    border: 0;
    background: #fff;
    color: #111;

    font-size: 19px;
    line-height: 1;
  }

  .ivy-mobile-cart-qty > span {
    border-top: 1px solid rgba(0,0,0,.10);
    border-bottom: 1px solid rgba(0,0,0,.10);
    font-size: 15px;
  }

  .ivy-mobile-cart-coupon {
    border-top: 1px solid rgba(0,0,0,.10);
    border-bottom: 1px solid rgba(0,0,0,.10);
  }

  .ivy-mobile-cart-coupon summary {
    list-style: none;

    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 66px;
    padding: 0 18px;

    cursor: pointer;

    font-size: 17px;
    font-weight: 500;
  }

  .ivy-mobile-cart-coupon summary::-webkit-details-marker {
    display: none;
  }

  .ivy-mobile-cart-coupon summary svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }

  .ivy-mobile-cart-coupon-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;

    padding: 0 18px 14px;
  }

  .ivy-mobile-cart-coupon-input {
    min-width: 0;
    height: 42px;
    padding: 0 12px;

    border: 1px solid rgba(0,0,0,.18);
    border-radius: 0;

    background: #fff;
    color: #111;
  }

  .ivy-mobile-cart-apply-coupon {
    height: 42px;
    padding: 0 16px;

    border: 0;
    background: #111;
    color: #fff;

    font-size: 13px;
    font-weight: 600;
  }

  .ivy-mobile-cart-message {
    margin: 0;
    padding: 0 18px 12px;
    font-size: 12px;
  }

  .ivy-mobile-cart-totals {
    padding: 6px 18px 0;
  }

  .ivy-mobile-cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 58px;

    border-bottom: 1px solid rgba(0,0,0,.08);

    font-size: 17px;
  }

  .ivy-mobile-cart-total-row strong {
    font-weight: 600;
  }

  .ivy-mobile-cart-total-final {
    font-size: 19px;
    font-weight: 600;
  }

  .ivy-mobile-cart-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 58px;
    margin: 18px;

    background: #111;
    color: #fff;

    text-decoration: none;

    font-size: 20px;
    font-weight: 500;
  }

  .ivy-mobile-cart-empty {
    padding: 60px 24px;
    text-align: center;
  }

  .ivy-mobile-cart-empty p {
    margin: 0 0 18px;
    font-size: 19px;
  }

  .ivy-mobile-cart-empty a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 20px;

    background: #111;
    color: #fff;
    text-decoration: none;
  }

  /* Keep the mobile nav visible while the full-screen cart is open. */
  html.ivy-mobile-cart-open .ivy-mobile-bottom-nav {
    display: grid !important;
  }

  html.ivy-mobile-cart-open .ivy-mobile-scroll-top,
  html.ivy-mobile-cart-open .ivy-mobile-filter-trigger {
    display: none !important;
  }
}


@media (max-width: 1024px) {
  .ivy-mobile-cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 24px;
    color: #555;
    font-size: 14px;
    text-align: center;
  }
}
