/* AIM GEAR touch experience
   Phone: choose the next action first; category filters become a bottom sheet.
   Tablet: filters and results share one exploration workspace. */

.mobile-action-deck,
.fb-sheet-backdrop,
.fb-sheet-head,
.fb-sheet-apply {
  display: none;
}

.category-explorer-layout {
  display: contents;
}

.category-explorer-context {
  display: grid;
  gap: .65rem;
}

.category-explorer-context[hidden] {
  display: none !important;
}

@media (max-width: 699px) {
  body.home .mobile-action-deck {
    display: block;
    order: 2;
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 1.05rem 0 1.2rem;
    overflow: hidden;
  }

  body.home .hero {
    padding-bottom: .65rem !important;
  }

  body.home .hero-cta,
  body.home .hero .search-container,
  body.home .hero-trust,
  body.home .hero-buddies {
    display: none !important;
  }

  .mad-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 5% .72rem;
  }

  .mad-kicker {
    display: block;
    margin-bottom: .2rem;
    color: #67e8f9;
    font-family: var(--gx-disp, system-ui, sans-serif);
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .18em;
  }

  .mad-head h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.2rem, 5.3vw, 1.5rem);
    line-height: 1.18;
  }

  .mad-nav {
    display: flex;
    gap: .42rem;
    padding-bottom: .14rem;
  }

  .mad-nav button {
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    position: relative;
    cursor: pointer;
  }

  .mad-nav button::before {
    content: "";
    position: absolute;
    inset: 8px 3px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .38);
    transition: inset .18s ease, background .18s ease, box-shadow .18s ease;
  }

  .mad-nav button.is-active::before {
    inset: 8px 0;
    background: linear-gradient(90deg, #22d3ee, #a78bfa, #fb923c);
    box-shadow: 0 0 12px rgba(34, 211, 238, .34);
  }

  .mad-rail {
    display: flex;
    gap: .72rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 5%;
    padding: .15rem 5% .65rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mad-rail::-webkit-scrollbar {
    display: none;
  }

  .mad-card {
    position: relative;
    flex: 0 0 calc(100% - 2.2rem);
    min-height: 224px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto 1fr auto;
    gap: .52rem .7rem;
    align-content: start;
    scroll-snap-align: center;
    padding: 1rem;
    border: 1px solid rgba(125, 211, 252, .2);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    background:
      radial-gradient(circle at 90% 10%, rgba(124, 58, 237, .22), transparent 36%),
      linear-gradient(145deg, rgba(15, 23, 42, .98), rgba(7, 10, 20, .98));
    color: #f8fafc;
    text-decoration: none;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .06);
  }

  .mad-card.is-primary {
    border-color: rgba(103, 232, 249, .42);
    background:
      radial-gradient(circle at 88% 12%, rgba(251, 146, 60, .2), transparent 35%),
      radial-gradient(circle at 16% 0, rgba(34, 211, 238, .18), transparent 42%),
      linear-gradient(145deg, rgba(14, 25, 43, .99), rgba(16, 10, 31, .99));
  }

  .mad-step {
    align-self: center;
    color: #7dd3fc;
    font-family: var(--gx-disp, system-ui, sans-serif);
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .14em;
  }

  .mad-icon {
    grid-column: 2;
    grid-row: 1 / 3;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(125, 211, 252, .25);
    border-radius: 12px;
    color: #e0f2fe;
    background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(168, 85, 247, .2));
    font-size: 1.05rem;
  }

  .mad-card strong {
    grid-column: 1;
    font-size: 1.14rem;
    line-height: 1.3;
  }

  .mad-card > span:not(.mad-step):not(.mad-icon) {
    grid-column: 1 / -1;
    color: #b8c4d8;
    font-size: .82rem;
    line-height: 1.65;
  }

  .mad-card > b {
    grid-column: 1 / -1;
    align-self: end;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .8rem;
    border: 1px solid rgba(167, 139, 250, .28);
    border-radius: 9px;
    color: #f8fafc;
    background: rgba(124, 58, 237, .15);
    font-size: .82rem;
  }

  .mad-card.is-primary > b {
    color: #07111d;
    background: linear-gradient(100deg, #9ff3f6, #d8b4fe 62%, #fdba74);
    border-color: transparent;
  }

  .mad-hint {
    margin: 0;
    padding: 0 5%;
    color: rgba(203, 213, 225, .68);
    font-size: .7rem;
  }

  .mobile-route-library {
    margin: .85rem 5% 0;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 10px;
    background: rgba(15, 23, 42, .52);
  }

  .mobile-route-library summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .8rem;
    color: #cbd5e1;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
  }

  .mobile-route-library summary::-webkit-details-marker {
    display: none;
  }

  .mobile-route-library summary::after {
    content: "+";
    color: #7dd3fc;
    font-size: 1rem;
  }

  .mobile-route-library[open] summary::after {
    content: "−";
  }

  .mobile-route-library > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    padding: 0 .65rem .65rem;
  }

  .mobile-route-library a {
    min-height: 52px;
    display: grid;
    place-items: center;
    gap: .25rem;
    padding: .45rem .25rem;
    border-radius: 8px;
    color: #dbeafe;
    background: rgba(255, 255, 255, .04);
    text-align: center;
    text-decoration: none;
    font-size: .68rem;
    line-height: 1.25;
  }

  .mobile-route-library a i {
    color: #a78bfa;
  }

  /* The deck replaces repeated phone-only navigation blocks while keeping
     their destinations available in the compact route library above. */
  body.home .goods-sec,
  body.home .lp-features,
  body.home .lp-guides,
  body.home .gax-featured,
  body.home .home-watch,
  body.home #news-sec,
  body.home #featured-sec,
  body.home #promo-sec,
  body.home #purchase-lanes,
  body.home #approved-routes,
  body.home #amazon-purchase-slot-home,
  body.home #categories,
  body.home #gax-deal-notice {
    display: none !important;
  }

  body.category-page.filter-sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.category-page .fb-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9980;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(2, 6, 15, .7);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
    backdrop-filter: blur(3px);
  }

  body.category-page.filter-sheet-open .fb-sheet-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.category-page.filter-sheet-open .compare-tray {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body.category-page .fb-panel,
  body.category-page .fb-panel.open {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .68rem !important;
    width: 100%;
    max-height: min(82dvh, 680px) !important;
    margin: 0 !important;
    padding: 0 .85rem calc(.85rem + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    border: 1px solid rgba(125, 211, 252, .26) !important;
    border-width: 1px 0 0 !important;
    border-radius: 18px 18px 0 0 !important;
    background:
      radial-gradient(circle at 82% 0, rgba(124, 58, 237, .22), transparent 35%),
      #090d18 !important;
    box-shadow: 0 -20px 48px rgba(0, 0, 0, .58) !important;
    transform: translateY(105%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .24s cubic-bezier(.16, 1, .3, 1), opacity .18s ease, visibility .24s ease;
  }

  body.category-page .fb-panel.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.category-page .fb-sheet-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 60px;
    margin: 0 -.85rem;
    padding: .55rem .85rem;
    border-bottom: 1px solid rgba(148, 163, 184, .13);
    background: rgba(9, 13, 24, .96);
    backdrop-filter: blur(12px);
  }

  .fb-sheet-title {
    display: grid;
    gap: .12rem;
    color: #f8fafc;
    font-size: .95rem;
    font-weight: 900;
  }

  .fb-sheet-status {
    color: #7dd3fc;
    font-size: .7rem;
    font-weight: 700;
  }

  body.category-page .fb-sheet-close {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    color: #e2e8f0;
    background: rgba(255, 255, 255, .04);
  }

  body.category-page .fb-panel .fg {
    padding: .72rem !important;
  }

  body.category-page .fb-panel .chip {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .72rem;
  }

  body.category-page .fb-panel .fg-actions {
    position: sticky;
    bottom: calc(-.85rem - env(safe-area-inset-bottom));
    z-index: 2;
    display: grid !important;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    gap: .55rem;
    margin: .2rem -.85rem 0;
    padding: .72rem .85rem calc(.72rem + env(safe-area-inset-bottom)) !important;
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, .13);
    border-radius: 0;
    background: rgba(9, 13, 24, .97);
    backdrop-filter: blur(12px);
  }

  body.category-page .fb-clear,
  body.category-page .fb-sheet-apply {
    min-height: 46px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border-radius: 10px !important;
  }

  body.category-page .fb-sheet-apply {
    color: #07111d;
    border: 0;
    background: linear-gradient(100deg, #8debf0, #c4b5fd 62%, #fdba74);
    font-weight: 900;
  }

  body.category-page.has-compare-tray main {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body.category-page .compare-tray {
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    min-height: 58px;
    transform: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: .45rem;
    padding: .45rem;
    border-radius: 14px;
  }

  body.category-page .compare-tray .ct-label {
    width: 34px;
    flex: 0 0 34px;
    display: grid;
    grid-template-columns: auto auto;
    place-content: center;
    gap: .15rem;
    color: #94a3b8;
    font-size: 0;
    text-align: center;
  }

  body.category-page .compare-tray .ct-label i,
  body.category-page .compare-tray .ct-label b,
  body.category-page .compare-tray .ct-label .ct-max {
    font-size: .72rem;
  }

  body.category-page .compare-tray .ct-items {
    min-width: 0;
    flex: 1 1 auto;
    gap: .25rem;
  }

  body.category-page .compare-tray .ct-item {
    width: 40px;
    height: 40px;
    flex: 0 1 40px;
  }

  body.category-page .compare-tray .ct-x {
    width: 24px;
    height: 24px;
    font-size: .7rem;
  }

  body.category-page .compare-tray .ct-actions {
    flex: 0 0 auto;
  }

  body.category-page .compare-tray .ct-go {
    min-height: 44px;
    padding: 0 .7rem;
    font-size: .76rem;
  }

  body.category-page .compare-tray .ct-go-full,
  body.category-page .compare-tray .ct-clear {
    display: none;
  }

  body.category-page .compare-tray .ct-go-short {
    display: inline;
  }
}

@media (min-width: 700px) and (max-width: 1180px) {
  body.category-page .category-explorer-layout {
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    gap: 1rem 1.15rem;
    align-items: start;
  }

  body.category-page .category-explorer-layout > .category-explorer-context {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: .65rem;
  }

  body.category-page .category-explorer-layout > .filter-bar2 {
    grid-column: 1;
    grid-row: 2;
    top: 82px;
    max-height: calc(100dvh - 98px);
    margin: 0;
    overflow: hidden;
  }

  body.category-page .category-explorer-layout > #item-grid {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    margin: 0;
  }

  body.category-page .filter-bar2::before {
    margin-bottom: .6rem;
  }

  body.category-page .filter-bar2::after {
    top: 2.42rem;
  }

  body.category-page .fb-top {
    grid-template-columns: 1fr !important;
    gap: .55rem !important;
  }

  body.category-page .filter-bar2 .fb-search,
  body.category-page .filter-bar2 .fb-sort,
  body.category-page .fb-count {
    grid-column: 1 !important;
    width: 100%;
  }

  body.category-page .filter-bar2 .fb-toggle {
    display: none !important;
  }

  body.category-page .fb-count {
    justify-self: stretch;
    justify-content: flex-start;
  }

  body.category-page .fb-panel.open {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .55rem !important;
    max-height: calc(100dvh - 320px);
    margin-top: .72rem !important;
    padding-top: .78rem !important;
    padding-right: .16rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.category-page .fb-panel .fg {
    padding: .65rem !important;
  }

  body.category-page .fb-panel .fg-actions {
    position: sticky;
    bottom: 0;
    background: rgba(9, 13, 24, .96);
  }

  body.category-page .fb-sheet-head,
  body.category-page .fb-sheet-apply {
    display: none !important;
  }

  body.category-page:not(.adv-mode-intro) .category-explorer-layout > #item-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    gap: .82rem !important;
  }
}

.compare-tray .ct-go-short {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .mad-nav button::before,
  body.category-page .fb-panel,
  body.category-page .fb-sheet-backdrop {
    transition: none !important;
  }

  .mad-rail {
    scroll-behavior: auto !important;
  }
}
