/* Modal Filters Styling - Dropdown Design */

/* Filters bar in modal */
.catalog-filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -4px 16px;
  padding: 16px 4px 4px;
  position: relative;
  z-index: 2;
  background: var(--bg, var(--card-bg, #111a2f));
}

.modal-header h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Filters toggle button (Filtry) */
.filters-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--bg, #0c0e13) 88%, white 12%);
  border: 1px solid rgba(255, 183, 3, 0.32);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 25px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.filters-toggle-btn:hover {
  background: rgba(255, 183, 3, 0.14);
  background: color-mix(in srgb, var(--bg, #0c0e13) 78%, var(--accent) 22%);
  border-color: rgba(255, 183, 3, 0.58);
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(255, 183, 3, 0.18);
}

.filters-toggle-btn[aria-expanded="true"] {
  background: rgba(255, 183, 3, 0.16);
  background: color-mix(in srgb, var(--bg, #0c0e13) 74%, var(--accent) 26%);
  border-color: var(--accent);
  color: var(--ink);
}

.filters-toggle-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 75%, white 25%);
  outline-offset: 3px;
}

.filters-toggle-btn:active {
  transform: translateY(0);
}

.filters-icon {
  display: inline-block;
  font-size: 14px;
  color: var(--accent);
  transition: transform 0.16s ease;
}

.filters-toggle-btn[aria-expanded="true"] .filters-icon {
  transform: rotate(180deg);
}

/* Active filter label */
.active-filter-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.modal-empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

/* Filters dropdown layer */
.filters-drawer-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 10050;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease;
  display: block;
}

.filters-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Filters dropdown menu */
.filters-drawer {
  background: var(--bg, var(--card-bg, #111a2f));
  position: fixed;
  top: var(--filters-menu-top, 120px);
  left: var(--filters-menu-left, 16px);
  width: min(var(--filters-menu-width, 260px), calc(100vw - 24px));
  max-height: min(380px, calc(100vh - var(--filters-menu-top, 120px) - 12px));
  display: block;
  overflow: hidden;
  border: 1px solid var(--outline);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.filters-drawer-overlay.active .filters-drawer {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Drawer header is hidden for standard dropdown mode */
.filters-drawer-header {
  display: none;
}

.filters-drawer-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

/* Drawer Close Button */
.filters-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--outline);
  background: var(--bg, var(--card-bg, #111a2f));
  color: var(--ink);
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  padding-bottom: 2px;
}

.filters-drawer-close:hover {
  background: var(--outline);
  border-color: var(--muted);
}

/* Dropdown body */
.filters-drawer-body {
  max-height: inherit;
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Filter buttons in dropdown */
.filter-drawer-btn {
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
  text-align: left;
}

.filter-drawer-btn:hover {
  background: var(--bg-2, var(--bg-card, rgba(255, 255, 255, 0.06)));
}

.filter-drawer-btn.active {
  background: rgba(255, 183, 3, 0.16);
  background: color-mix(in srgb, var(--bg, #0c0e13) 80%, var(--accent) 20%);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
}

.filter-drawer-btn.active:hover {
  background: rgba(255, 183, 3, 0.2);
  background: color-mix(in srgb, var(--bg, #0c0e13) 76%, var(--accent) 24%);
  color: var(--ink);
}

/* Modal close button styling */
.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 183, 3, 0.32);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--bg, #0c0e13) 88%, white 12%);
  color: var(--ink);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
  z-index: 10;
  padding-bottom: 2px;
}

.modal-close:hover {
  background: rgba(255, 183, 3, 0.14);
  background: color-mix(in srgb, var(--bg, #0c0e13) 78%, var(--accent) 22%);
  border-color: var(--accent);
  color: var(--ink);
  transform: scale(1.05);
}

.modal-close:active {
  transform: scale(0.95);
}

/* Mobile styles */
@media (max-width: 768px) {
  .filters-toggle-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 20px;
    border-width: 1px;
  }

  .filter-drawer-btn {
    padding: 10px 12px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .modal-close {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
}
