/**
 * Equsto PLP — Mobile Filter Bottom Sheet Styles
 * Breakpoint: ≤768px
 * Design: #0B0C0E bg, #5EEAD4 accent, glassmorphism
 */
@media (max-width: 768px) {
  /* ── Override: Show mobile filter button in toolbar ─────────────────────── */
  .eq-dept-plp-filter-mob,
  .eq-arama-filter-mob {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid var(--eq-border, #e5e7eb);
    border-radius: 8px;
    background: var(--eq-surface, #fff);
    color: var(--eq-text, #111);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 48px;
  }

  .eq-dept-plp-filter-mob:hover,
  .eq-arama-filter-mob:hover {
    background: var(--eq-surface-hover, #f9fafb);
    border-color: var(--eq-border-hover, #d1d5db);
  }

  .eq-dept-plp-filter-mob:active,
  .eq-arama-filter-mob:active {
    background: var(--eq-surface-active, #f3f4f6);
  }

  .eq-dept-plp-filter-mob .eq-filter-mob__badge,
  .eq-arama-filter-mob .eq-filter-mob__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--eq-accent, #5EEAD4);
    color: #0B0C0E;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
  }

  .eq-dept-plp-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) !important;
    gap: 8px 10px !important;
    align-items: stretch !important;
    padding: 12px 0 !important;
  }

  .eq-dept-plp-toolbar__row--primary,
  .eq-dept-plp-toolbar__row--sort {
    display: contents !important;
  }

  .eq-dept-plp-sort {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    min-width: 0;
  }

  .eq-dept-plp-sort > span {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
    color: var(--eq-text, #333);
  }

  .eq-dept-plp-sort select {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 16px;
    border: 1px solid var(--eq-border, #ccc);
    border-radius: 8px;
    background: var(--eq-surface, #fff);
    color: var(--eq-text, #111);
  }

  .eq-dept-plp-count,
  #eq-arama-filter-count {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    flex: none;
    text-align: center;
    font-size: 13px;
    line-height: 1.35;
    padding-top: 2px;
    color: var(--eq-text-muted, #666);
  }

  .eq-dept-plp-count strong {
    color: var(--eq-text, #111);
  }

  .eq-dept-plp-main {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  /* ── Hide desktop sidebar completely on mobile ──────────────────────────── */
  .eq-dept-plp-aside,
  .eq-arama-aside {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: none !important;
  }

  .eq-dept-filter-backdrop {
    display: none !important;
  }

  /* ── Bottom Sheet ───────────────────────────────────────────────────────── */
  .eq-dept-filter-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(11, 12, 14, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .eq-dept-filter-sheet-backdrop.visible {
    display: block;
    opacity: 1;
  }

  .eq-dept-filter-sheet {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1310;
    max-height: 85vh;
    background: #0B0C0E;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .eq-dept-filter-sheet.open {
    display: flex;
    transform: translateY(0);
  }

  .eq-dept-filter-sheet__handle {
    width: 40px;
    height: 5px;
    margin: 12px auto 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
  }

  .eq-dept-filter-sheet__hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  .eq-dept-filter-sheet__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
  }

  .eq-dept-filter-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .eq-dept-filter-sheet__close:hover,
  .eq-dept-filter-sheet__close:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .eq-dept-filter-sheet__content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 0;
    -webkit-overflow-scrolling: touch;
  }

  .eq-dept-filter-sheet__actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-shrink: 0;
  }

  .eq-dept-filter-sheet__actions button {
    flex: 1;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  .eq-dept-filter-sheet__clear {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
  }

  .eq-dept-filter-sheet__clear:hover,
  .eq-dept-filter-sheet__clear:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
  }

  .eq-dept-filter-sheet__apply {
    border: 1px solid #5EEAD4;
    background: #5EEAD4;
    color: #0B0C0E;
  }

  .eq-dept-filter-sheet__apply:hover,
  .eq-dept-filter-sheet__apply:focus {
    background: #4dd9c2;
    border-color: #4dd9c2;
    color: #0B0C0E;
  }

  .eq-dept-filter-sheet__apply:active {
    background: #3cc9b0;
    border-color: #3cc9b0;
  }

  /* ── Facet styling inside sheet (dark theme) ────────────────────────────── */
  .eq-dept-filter-sheet .eq-cm-facet {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
    margin-bottom: 4px;
    border-radius: 10px;
    overflow: hidden;
  }

  .eq-dept-filter-sheet .eq-cm-facet__hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: transparent;
  }

  .eq-dept-filter-sheet .eq-cm-facet__hd::-webkit-details-marker {
    display: none;
  }

  .eq-dept-filter-sheet .eq-cm-facet__hd::after {
    content: '−';
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.15s ease;
  }

  .eq-dept-filter-sheet .eq-cm-facet:not([open]) .eq-cm-facet__hd::after {
    content: '+';
  }

  .eq-dept-filter-sheet .eq-cm-facet__body {
    padding: 0 16px 14px;
  }

  .eq-dept-filter-sheet .eq-cm-facet__search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    -webkit-appearance: none;
  }

  .eq-dept-filter-sheet .eq-cm-facet__search::placeholder {
    color: rgba(255, 255, 255, 0.4);
  }

  .eq-dept-filter-sheet .eq-cm-facet__search:focus {
    outline: none;
    border-color: #5EEAD4;
    box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.2);
  }

  .eq-dept-filter-sheet .eq-cm-facet__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
  }

  .eq-dept-filter-sheet .eq-cm-facet__label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
  }

  .eq-dept-filter-sheet .eq-cm-facet__label input {
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #5EEAD4;
  }

  .eq-dept-filter-sheet .eq-cm-facet__count {
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
    margin-left: auto;
    white-space: nowrap;
  }

  /* Price inputs in sheet */
  .eq-dept-filter-sheet .eq-cm-facet__price-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
  }

  .eq-dept-filter-sheet .eq-cm-facet__price-row input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
  }

  .eq-dept-filter-sheet .eq-cm-facet__price-row input::placeholder {
    color: rgba(255, 255, 255, 0.35);
  }

  .eq-dept-filter-sheet .eq-cm-facet__price-row span {
    color: rgba(255, 255, 255, 0.4);
  }

  .eq-dept-filter-sheet .eq-cm-facet__apply {
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid #5EEAD4;
    background: #5EEAD4;
    color: #0B0C0E;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .eq-dept-filter-sheet .eq-cm-facet__apply:hover {
    background: #4dd9c2;
    border-color: #4dd9c2;
  }

  .eq-dept-filter-sheet .eq-cm-facet__range-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin: 8px 0 0;
  }

  /* Chips in sheet (selected filters) */
  .eq-dept-filter-sheet .eq-cm-selected {
    padding: 8px 16px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.01);
    flex-shrink: 0;
  }

  .eq-dept-filter-sheet .eq-cm-selected__hd {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .eq-dept-filter-sheet .eq-cm-selected__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
  }

  .eq-dept-filter-sheet .eq-cm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .eq-dept-filter-sheet .eq-cm-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
  }

  .eq-dept-filter-sheet .eq-cm-chip span[aria-hidden="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 2px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
  }

  .eq-dept-filter-sheet .eq-cm-chip:hover span[aria-hidden="true"] {
    color: #5EEAD4;
  }

  .eq-dept-filter-sheet .eq-cm-selected__clear {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: none;
    background: none;
    color: #5EEAD4;
    cursor: pointer;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
  }

  .eq-dept-filter-sheet .eq-cm-selected__clear:hover {
    text-decoration: underline;
  }

  /* Body scroll lock when sheet open */
  body.eq-dept-filter-sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  /* Reduce motion */
  @media (prefers-reduced-motion: reduce) {
    .eq-dept-filter-sheet,
    .eq-dept-filter-sheet-backdrop {
      transition: none !important;
    }
  }
}

/* ── Light theme adjustments (if ever needed) ────────────────────────────── */
@media (max-width: 768px) {
  [data-theme="light"] .eq-dept-filter-sheet {
    background: #fff;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  }

  [data-theme="light"] .eq-dept-filter-sheet__title {
    color: #111;
  }

  [data-theme="light"] .eq-dept-filter-sheet__close {
    color: rgba(17, 17, 17, 0.6);
  }

  [data-theme="light"] .eq-dept-filter-sheet__close:hover {
    background: rgba(17, 17, 17, 0.06);
    color: #111;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet {
    background: #fafafa;
    border-bottom-color: #e8e8e8;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__hd {
    color: #111;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__hd::after {
    color: #888;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__search {
    background: #fff;
    border-color: #ddd;
    color: #111;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__search::placeholder {
    color: #999;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__label {
    color: #333;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__count {
    color: #888;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__price-row input {
    background: #fff;
    border-color: #ddd;
    color: #111;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__price-row span {
    color: #888;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__apply {
    border-color: #111;
    background: #111;
    color: #fff;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-facet__apply:hover {
    background: #333;
    border-color: #333;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-selected {
    background: #f5f5f5;
    border-bottom-color: #e8e8e8;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-selected__hd {
    color: #888;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-chip {
    background: #fff;
    border-color: #ddd;
    color: #111;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-chip:hover {
    background: #f5f5f5;
    border-color: #ccc;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-chip span[aria-hidden="true"] {
    color: #888;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-chip:hover span[aria-hidden="true"] {
    color: #5EEAD4;
  }

  [data-theme="light"] .eq-dept-filter-sheet .eq-cm-selected__clear {
    color: #5EEAD4;
  }

  [data-theme="light"] .eq-dept-filter-sheet__actions {
    background: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(8px);
    border-top-color: #e8e8e8;
  }

  [data-theme="light"] .eq-dept-filter-sheet__clear {
    border-color: #ccc;
    color: #333;
  }

  [data-theme="light"] .eq-dept-filter-sheet__clear:hover {
    background: #f0f0f0;
    border-color: #bbb;
  }

  [data-theme="light"] .eq-dept-filter-sheet__apply {
    border-color: #5EEAD4;
    background: #5EEAD4;
    color: #0B0C0E;
  }

  [data-theme="light"] .eq-dept-filter-sheet__apply:hover {
    background: #4dd9c2;
    border-color: #4dd9c2;
  }
}