/* ==========================================================
   FALCON JACKETS — CATEGORY FILTERS V15
   Desktop: category bar only.
   Phone/tablet: app-style bottom controls and single-column drawer.
========================================================== */

.category-first-filters {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.category-first-filters .catalogue-filter-menu {
  position: relative;
}

.category-first-filters .catalogue-filter-dropdown {
  min-width: 250px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid rgba(17,17,17,.10);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(17,17,17,.14);
}

.category-first-filters .catalogue-filter-dropdown > button,
.category-first-filters .accessory-tree details > div > button {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(17,17,17,.07);
  border-radius: 0;
  background: transparent;
  color: #171717;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.category-first-filters .catalogue-filter-dropdown > button:last-child,
.category-first-filters .accessory-tree details > div > button:last-child {
  border-bottom: 0;
}

.category-first-filters .catalogue-filter-dropdown > button:hover,
.category-first-filters .accessory-tree details > div > button:hover {
  background: #f7f5ef;
  color: #9b700f;
}

.category-first-filters .accessory-tree details {
  border-bottom: 1px solid rgba(17,17,17,.08);
}
.category-first-filters .accessory-tree details:last-child { border-bottom: 0; }
.category-first-filters .accessory-tree details > summary {
  cursor: pointer;
  padding: 12px;
  font-weight: 750;
  list-style: none;
}
.category-first-filters .accessory-tree details > summary::-webkit-details-marker { display:none; }
.category-first-filters .accessory-tree details > summary::after { content:'›'; float:right; }
.category-first-filters .accessory-tree details[open] > summary::after { transform:rotate(90deg); }
.category-first-filters .accessory-tree details > div { padding:0 8px 8px; }

/* ----------------------------------------------------------
   MOBILE + TABLET FILTER DRAWER
---------------------------------------------------------- */
.category-first-mobile {
  display: block;
  padding: 0 10px 22px;
}

.category-first-mobile .mobile-filter-direct {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  padding: 0 13px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(17,17,17,.10);
  border-radius: 0;
  background: #fff;
  color: #171717;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.category-first-mobile .mobile-filter-direct.active {
  color: #a87910;
  background: #fff;
}

.category-first-mobile .mobile-filter-group {
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(17,17,17,.10);
  background: #fff;
}

.category-first-mobile .mobile-filter-group > summary {
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  color: #171717;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.category-first-mobile .mobile-filter-group > summary::-webkit-details-marker { display:none; }
.category-first-mobile .mobile-filter-group > summary::after {
  content: '›';
  flex: 0 0 auto;
  color: #7d7d7d;
  font-size: 17px;
  line-height: 1;
  transition: transform .18s ease;
}
.category-first-mobile .mobile-filter-group[open] > summary::after {
  transform: rotate(90deg);
}

/* One option per row — never a two-column grid. */
.category-first-mobile .mobile-filter-options {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 13px 9px 25px;
  background: #faf9f6;
}

.category-first-mobile .mobile-filter-options > button,
.category-first-mobile .nested-accessory-options details > div > button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  padding: 8px 10px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(17,17,17,.07);
  border-radius: 0;
  background: transparent;
  color: #222;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.category-first-mobile .mobile-filter-options > button:last-child,
.category-first-mobile .nested-accessory-options details > div > button:last-child {
  border-bottom: 0;
}
.category-first-mobile .mobile-filter-options > button::before,
.category-first-mobile .nested-accessory-options details > div > button::before {
  content: '—';
  margin-right: 8px;
  color: #b48618;
}
.category-first-mobile .mobile-filter-options > button.active,
.category-first-mobile .nested-accessory-options details > div > button.active {
  color: #9b700f;
  font-weight: 800;
}

.category-first-mobile .nested-accessory-options {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 13px 9px 25px;
  background: #faf9f6;
}

.category-first-mobile .nested-accessory-options details {
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(17,17,17,.08);
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.category-first-mobile .nested-accessory-options details:last-child { border-bottom: 0; }
.category-first-mobile .nested-accessory-options details > summary {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  color: #222;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.category-first-mobile .nested-accessory-options details > summary::-webkit-details-marker { display:none; }
.category-first-mobile .nested-accessory-options details > summary::after {
  content:'›';
  color:#888;
  font-size:16px;
  transition:transform .18s ease;
}
.category-first-mobile .nested-accessory-options details[open] > summary::after { transform:rotate(90deg); }
.category-first-mobile .nested-accessory-options details > div {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 7px 12px;
}

/* Phone/tablet behavior: use drawer and bottom controls. */
@media (max-width: 1400px) {
  .catalogue-filters-desktop { display: none !important; }
}

/* Real desktop/laptop behavior, including narrower desktop browser windows.
   Fine pointer + hover prevents the mobile/tablet bottom bar appearing on PC. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  body { padding-bottom: 0 !important; }
  .catalogue-filters-desktop {
    display: flex !important;
  }
  nav.mobile-shop-bar,
  aside.mobile-shop-drawer,
  .mobile-shop-backdrop,
  .mobile-sort-sheet {
    display: none !important;
    visibility: hidden !important;
  }
  .floating { bottom: 22px !important; }
}

/* Large desktop fallback. */
@media (min-width: 1401px) {
  .catalogue-filters-desktop { display:flex !important; }
  .catalogue-filters-mobile,
  .mobile-shop-bar,
  .mobile-shop-drawer,
  .mobile-sort-sheet,
  .mobile-shop-backdrop { display:none !important; }
}


/* ==========================================================
   DESKTOP OVERLAY + DEVICE MODE FIX — V16
   Desktop never shows the mobile bottom bar. Dropdowns stay
   above the status/search/product grid instead of behind it.
========================================================== */
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
  html body { padding-bottom: 0 !important; }
  html body nav.mobile-shop-bar,
  html body aside.mobile-shop-drawer,
  html body .mobile-shop-backdrop,
  html body .mobile-sort-sheet {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  html body .catalogue-filters-desktop {
    display: flex !important;
    position: relative !important;
    z-index: 200 !important;
    overflow: visible !important;
  }
  html body .category-first-filters .catalogue-filter-menu {
    position: relative !important;
    z-index: 201 !important;
  }
  html body .category-first-filters .catalogue-filter-menu[open] {
    z-index: 9998 !important;
  }
  html body .category-first-filters .catalogue-filter-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
  }
  html body .catalogue-filter-status,
  html body #productSearch,
  html body #managedProductsGrid {
    position: relative;
    z-index: 1;
  }
  html body .floating { bottom: 22px !important; }
}
