/* ═══ Shop listing top bar (minimal — no panel chrome) ═══════════════════ */
.ath-shop-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.ath-shop-top__result-p {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ath-pf-result-label, #64748b);
}

.ath-shop-top__result-label,
.ath-shop-top__result-suffix {
  font-weight: 500;
}

.ath-shop-top__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: normal;
  color: var(--ath-pf-result-count, #0f172a);
  background: transparent;
  border: none;
}

.ath-shop-top__count--zero {
  padding: 0;
  background: none;
  border: none;
  font-weight: 500;
  color: #94a3b8;
}

.ath-shop-top__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Filter CTA — ghost / text style; optional theme colors (--ath-pf-open-*) */
.ath-pfd-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border: none;
  border-radius: 0;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.2;
  color: var(--ath-pf-open-text, var(--primary-color, #003dff));
  background: transparent;
  box-shadow: none;
  transition:
    opacity 0.15s ease,
    transform 0.12s ease;
}

.ath-pfd-open-btn:hover {
  opacity: 0.85;
  filter: none;
}

.ath-pfd-open-btn:active {
  transform: translateY(1px);
  opacity: 1;
}

.ath-pfd-open-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 1.5rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.ath-pfd-open-btn__icon svg {
  display: block;
}

.ath-pfd-open-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary-color, #003dff);
  border-radius: 4px;
}

/* ═══ Filter drawer shell ═══════════════════════════════════════════ */
#ath-products-filter-drawer {
  /* Above slide-menu / float widgets; below page-loader (100000) */
  --ath-pfd-z: 100010;
  --ath-pfd-width: min(440px, 100vw);
  --ath-pfd-mobile-h: min(78vh, 560px);
  --ath-pfd-bg: #fafbfc;
  --ath-pfd-fg: #0f172a;
  --ath-pfd-border: rgba(15, 23, 42, 0.09);
  --ath-pfd-surface: #fff;
  --ath-pfd-muted: #64748b;
  position: fixed;
  inset: 0;
  z-index: var(--ath-pfd-z);
  pointer-events: none;
  visibility: hidden;
  font-family: inherit;
}

#ath-products-filter-drawer[aria-hidden="false"] {
  visibility: visible;
  pointer-events: auto;
}

#ath-products-filter-drawer .ath-pfd__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

#ath-products-filter-drawer[aria-hidden="false"] .ath-pfd__overlay {
  opacity: 1;
}

#ath-products-filter-drawer .ath-pfd__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: var(--ath-pfd-width);
  background: var(--ath-pfd-bg);
  color: var(--ath-pfd-fg);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.1);
  border-inline-start: 1px solid var(--ath-pfd-border);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

[dir="rtl"] #ath-products-filter-drawer .ath-pfd__panel {
  transform: translateX(-100%);
}

#ath-products-filter-drawer[aria-hidden="false"] .ath-pfd__panel {
  transform: translateX(0);
}

body.ath-pfd-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  #ath-products-filter-drawer .ath-pfd__panel {
    top: auto;
    inset-inline-end: 0;
    inset-inline-start: 0;
    width: 100%;
    height: var(--ath-pfd-mobile-h);
    max-height: 90vh;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
  }

  [dir="rtl"] #ath-products-filter-drawer .ath-pfd__panel {
    transform: translateY(100%);
  }

  #ath-products-filter-drawer[aria-hidden="false"] .ath-pfd__panel {
    transform: translateY(0);
  }
}

#ath-products-filter-drawer .ath-pfd__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 18px;
  flex-shrink: 0;
  background: var(--ath-pfd-surface);
  border-bottom: 1px solid var(--ath-pfd-border);
}

#ath-products-filter-drawer .ath-pfd__header-text {
  min-width: 0;
}

#ath-products-filter-drawer .ath-pfd__title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

#ath-products-filter-drawer .ath-pfd__subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ath-pfd-muted);
}

#ath-products-filter-drawer .ath-pfd__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid var(--ath-pfd-border);
  border-radius: 12px;
  background: var(--ath-pfd-bg);
  color: inherit;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

#ath-products-filter-drawer .ath-pfd__close:hover {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.14);
  color: var(--primary-color, #003dff);
}

#ath-products-filter-drawer .ath-pfd__grabber {
  display: none;
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.12);
  margin: 8px auto 2px;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  #ath-products-filter-drawer .ath-pfd__grabber {
    display: block;
  }

  #ath-products-filter-drawer .ath-pfd__subtitle {
    display: none;
  }

  #ath-products-filter-drawer .ath-pfd__header {
    padding: 14px 16px 12px;
    border-radius: 50px 40px 0 0;
  }

  #ath-products-filter-drawer .ath-pfd__title {
    font-size: 1.15rem;
  }
}

#ath-products-filter-drawer .ath-pfd__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

/* Card surfaces */
#ath-products-filter-drawer .ath-pfd__surface {
  background: var(--ath-pfd-surface);
  border: 1px solid var(--ath-pfd-border);
  border-radius: 12px;
  padding: 14px 14px 16px;
}

.ath-pfd__block--sep {
  margin-top: 14px;
}

/* Options block — calmer shell (reference: simple stacked accordions) */
#ath-products-filter-drawer .ath-pfd__platform-filters-wrap.ath-pfd__surface {
  padding: 12px 12px 14px;
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.06);
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters-wrap
  .ath-pfd__section-title {
  margin-bottom: 10px;
  color: #475569;
}

#ath-products-filter-drawer .ath-pfd__section-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ath-pfd-muted);
}

[dir="rtl"] #ath-products-filter-drawer .ath-pfd__section-title {
  text-transform: none;
  letter-spacing: 0.02em;
}

/* Sort: 2×2 tile grid */
.ath-pfd__sort-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 380px) {
  .ath-pfd__sort-grid {
    grid-template-columns: 1fr;
  }
}

.ath-pfd__sort-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid transparent;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.ath-pfd__sort-tile:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.ath-pfd__sort-tile.is-active {
  background: #fff;
  border-color: var(--ath-pf-sort-active, var(--primary-color, #003dff));
  color: var(--ath-pf-sort-active, var(--primary-color, #003dff));
}

.ath-pfd__sort-tile-label {
  display: block;
}

/* ═══ Platform (Zid) attribute filters ═══════════════════════════════ */
#ath-products-filter-drawer .ath-pfd__platform-filters .product-attributes {
  position: static !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  inset: auto !important;
  transform: none !important;
  background: transparent !important;
  z-index: auto !important;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .product-attributes-light-box {
  position: static !important;
  box-shadow: none !important;
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .product-attributes-light-box-top-section {
  display: none !important;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .products-filters-container {
  margin-top: 0 !important;
}

/*
  Zid mobile CSS (injected with filters) sets .products-filters-container to max-height:0 / opacity:0
  until toggleProductAttributeMobile() runs — but we hide the tap strip inside the drawer, so filters
  stayed invisible on phones. Force the list visible when it lives in our drawer.
*/
@media (max-width: 767px) {
  #ath-products-filter-drawer
    .ath-pfd__platform-filters
    .products-filters-container,
  #ath-products-filter-drawer
    .ath-pfd__platform-filters
    .products-filters-container.mt-4 {
    max-height: none !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    transition: none !important;
    -webkit-overflow-scrolling: touch;
  }

  #ath-products-filter-drawer .ath-pfd__platform-filters .product-attributes {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    transform: none !important;
    z-index: auto !important;
  }

  #ath-products-filter-drawer
    .ath-pfd__platform-filters
    .product-attributes-light-box {
    position: static !important;
    height: auto !important;
    width: 100% !important;
    max-height: none !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    background: transparent !important;
  }

  #ath-products-filter-drawer
    .ath-pfd__platform-filters
    .products-filters-attribute-form {
    margin-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Zid mobile rules hide checkboxes and use chip-style labels — keep list usable in drawer */
  #ath-products-filter-drawer .ath-pfd__platform-filters .attribute-body {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
  }

  #ath-products-filter-drawer
    .ath-pfd__platform-filters
    .attribute-body
    input[type="checkbox"] {
    visibility: visible !important;
    position: static !important;
    opacity: 1 !important;
    width: 18px !important;
    height: 18px !important;
  }
}

#ath-products-filter-drawer .ath-pfd__platform-filters .filtration-header {
  display: none !important;
}

/* Zid embeds a second price block inside #attribute_form — we already have ath-pfd-form (from_price / to_price). */
#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-group:has(.attribute-price-body) {
  display: none !important;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-group:has(.attribute-body-sort) {
  display: none !important;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .products-filters-attribute-form {
  margin: 0;
}

#ath-products-filter-drawer .ath-pfd__platform-filters .attribute-group {
  margin-bottom: 10px;
  padding: 0;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-group:has(
    .attribute-body:not(.d-none):not(.attribute-body-collapse)
  ) {
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-group:last-child {
  margin-bottom: 0;
}

#ath-products-filter-drawer .ath-pfd__platform-filters .attribute-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin: 0;
  border-bottom: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-header:active {
  background: rgba(15, 23, 42, 0.03);
}

#ath-products-filter-drawer .ath-pfd__platform-filters .attribute-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

/* + / − toggle (Zid keeps SVG + onclick on .attribute-arrow) */
#ath-products-filter-drawer .ath-pfd__platform-filters .attribute-arrow {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.1);
  transition:
    background 0.2s ease,
    transform 0.22s ease;
}

#ath-products-filter-drawer .ath-pfd__platform-filters .attribute-arrow svg {
  display: none !important;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-arrow::before {
  display: block;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  color: #0f172a;
  transition: transform 0.22s ease;
}

/* Zid: arrow “expand” class = section open, “collapse” = closed (see toggleAttributeBodyOfId) */
#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-arrow.attribute-arrow-expand::before {
  content: "\2212";
  font-size: 1.15rem;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-arrow.attribute-arrow-collapse::before {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
}

#ath-products-filter-drawer .ath-pfd__platform-filters .filter-content {
  overflow: hidden;
  transition:
    max-height 0.32s ease,
    opacity 0.22s ease;
}

#ath-products-filter-drawer .ath-pfd__platform-filters .attribute-body {
  padding: 0 12px 12px;
  transition:
    opacity 0.22s ease,
    max-height 0.32s ease;
}

/* Drawer-only: override Bootstrap .d-none so max-height can animate */
#ath-products-filter-drawer .ath-pfd__platform-filters .attribute-body.d-none,
#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-body.attribute-body-collapse {
  display: flex !important;
  flex-direction: column;
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  pointer-events: none;
  z-index: auto !important;
}

#ath-products-filter-drawer
  .ath-pfd__platform-filters
  .attribute-body:not(.d-none):not(.attribute-body-collapse) {
  display: flex !important;
  flex-direction: column;
  max-height: 480px;
  opacity: 1;
}

#ath-products-filter-drawer .ath-pfd__platform-filters .filter-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

#ath-products-filter-drawer .ath-pfd__platform-filters .filter-row .checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  position: static;
  opacity: 1;
  z-index: 1;
}

#ath-products-filter-drawer .ath-pfd__platform-filters .filter-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

#ath-products-filter-drawer .ath-pfd__platform-filters .attribute-label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  margin: 0;
  padding: 4px 0;
}

#ath-products-filter-drawer .ath-pfd__platform-filters .attribute-color {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

#ath-products-filter-drawer .ath-pfd__platform-filters .filter-count {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-inline-start: 4px;
}

/* ═══ Price form (ath-pfd-form) ═══════════════════════════════════════ */
#ath-products-filter-drawer .ath-pfd__price-block {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#ath-products-filter-drawer .ath-pfd__price-block .ath-pfd-form__inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  padding-bottom: 0;
  background: var(--ath-pfd-surface);
  border: 1px solid var(--ath-pfd-border);
  border-radius: 12px;
  overflow: hidden;
}

#ath-products-filter-drawer .ath-pfd__price-block .ath-pfd-form__main {
  padding: 14px 14px 4px;
}

.ath-pfd-form__section {
  margin-bottom: 4px;
}

.ath-pfd-form__heading {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ath-pfd-muted, #64748b);
}

[dir="rtl"] .ath-pfd-form__heading {
  text-transform: none;
  letter-spacing: 0.02em;
}

.ath-pfd-form__price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ath-pfd-form__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

.ath-pfd-form__input {
  height: auto;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  font-size: 15px !important;
  font-weight: 600;
  background: #fff !important;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.ath-pfd-form__input:focus {
  border-color: var(--primary-color, #003dff) !important;
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--primary-color, #003dff) 18%, transparent) !important;
  outline: none !important;
}

.ath-pfd-form__slider-wrap {
  margin: 18px 0 8px;
  padding: 0 4px;
}

.ath-pfd-form__sale {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.ath-pfd-form__sale-label {
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin: 0 !important;
  cursor: pointer;
  width: 100%;
}

.ath-pfd-form__sale-text {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.ath-pfd-form__actions {
  display: flex;
  gap: 10px;
}

/* Sticky Apply / Clear — stays at bottom of drawer while scrolling (inside .ath-pfd__body) */
#ath-products-filter-drawer .ath-pfd-form__actions--dock {
  flex-shrink: 0;
  margin-top: auto;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ath-pfd-border, rgba(15, 23, 42, 0.09));
  background: var(--ath-pfd-surface, #fff);
  position: sticky;
  bottom: 0;
  z-index: 5;
  box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.07);
}

.ath-pfd-form__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    filter 0.15s,
    box-shadow 0.15s;
}

.ath-pfd-form__btn:active {
  transform: scale(0.98);
}

.ath-pfd-form__btn--ghost {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid rgba(15, 23, 42, 0.08);
}

.ath-pfd-form__btn--ghost:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.ath-pfd-form__btn--primary {
  color: var(--ath-pf-apply-text, #fff);
  background: var(--ath-pf-apply-bg, var(--primary-color, #003dff));
  box-shadow: none;
}

.ath-pfd-form__btn--primary:hover {
  filter: brightness(1.05);
}

@media (prefers-reduced-motion: reduce) {
  .ath-pfd-open-btn,
  .ath-pfd-open-btn:active,
  #ath-products-filter-drawer .ath-pfd__panel,
  #ath-products-filter-drawer .ath-pfd__overlay,
  .ath-pfd__sort-tile,
  .ath-pfd-form__btn:active {
    transition: none;
  }
}
