/* ===== 4. FILTER BAR (chips) ===== */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px 16px;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  white-space: nowrap;
  position: relative;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: -0.005em;
  color: var(--filterchip-text);
  background: var(--filterchip-bg);
  border: 1px solid var(--filterchip-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--filterchip-shadow);
  transition:
    background var(--motion-180) var(--motion-ease), color var(--motion-180) var(--motion-ease), border-color var(--motion-180) var(--motion-ease), box-shadow var(--motion-180) var(--motion-ease), transform var(--motion-180) var(--motion-ease);
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.filter-chip::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 9px rgba(var(--primary-rgb) / 0.52);
  opacity: 0;
  transform: scaleY(0.45);
  transform-origin: center;
  transition:
    opacity var(--motion-180) var(--motion-ease), transform var(--motion-180) var(--motion-ease);
  pointer-events: none;
}

.filter-chip svg {
  opacity: 0.82;
}

.filter-chip:hover {
  background: var(--filterchip-bg-hover);
  border-color: var(--filterchip-border-hover);
  color: var(--filterchip-text);
  box-shadow: var(--filterchip-shadow-hover);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: var(--filterchip-bg-active);
  color: var(--filterchip-text-active);
  border-color: var(--filterchip-border-active);
  font-weight: 700;
  box-shadow: var(--filterchip-shadow-active);
}

.filter-chip.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.filter-chip.active svg {
  opacity: 1;
}

.filter-chip.active:hover {
  background: var(--filterchip-bg-active);
  border-color: var(--filterchip-border-active);
  transform: none;
}

.filter-chip:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.filter-chip:focus-visible {
  outline: 2px solid var(--filterchip-focus-ring);
  outline-offset: 2px;
}

.filter-chip .chip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--filterchip-close-bg);
  border: 1px solid var(--filterchip-close-border);
  color: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  margin-left: 3px;
  transition:
    background var(--motion-180), border-color var(--motion-180);
}

.filter-chip.active .chip-close {
  background: var(--filterchip-close-bg-active);
  border-color: var(--filterchip-close-border-active);
  color: var(--filterchip-text-active);
}

.filter-chip .chip-close:hover {
  background: var(--filterchip-close-bg-hover);
}

.price-filter-open,
.price-filter-open body {
  overflow: hidden;
}

html.price-filter-open #bottomNav {
  z-index: var(--z-raised, 10);
}

html.nova-guest-limit-active .price-filter-overlay,
html.nova-guest-limit-active .nova-lightbox {
  z-index: var(--z-raised, 10);
}

.price-filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: var(--z-modal, 500);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--motion-320) var(--motion-ease);
  pointer-events: none;
}

.price-filter-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.price-filter-dialog {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow:
    0 -8px 40px rgba(0, 0, 0, 0.12),
    0 -2px 12px rgba(0, 0, 0, 0.06);
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(100%);
  transition: transform var(--motion-320) var(--motion-ease);
  max-height: 85vh;
  overflow-y: auto;
}

.price-filter-overlay.is-visible .price-filter-dialog {
  transform: translateY(0);
}

.price-filter-dialog::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin: 12px auto 4px;
  flex-shrink: 0;
  opacity: 0.7;
}

.price-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-filter-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.price-filter-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--motion-180), color var(--motion-180), border-color var(--motion-180);
}

.price-filter-close:hover {
  background: var(--surface-muted);
  border-color: var(--border-light);
  color: var(--ink);
}

.price-filter-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 10px 12px;
}

.price-filter-live-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--primary-rgb) / 0.18);
  background: rgba(var(--primary-rgb) / 0.1);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

[data-theme="dark"] .price-filter-live-count {
  color: var(--primary);
}

.price-filter-live-count.is-loading {
  border-color: var(--border-light);
  background: var(--surface);
  color: var(--muted);
}

.price-filter-live-count.is-error {
  border-color: rgba(239, 68, 68, 0.16);
  background: rgba(239, 68, 68, 0.08);
  color: #b42318;
}

.price-slider-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
}

.price-slider-row label {
  margin: 0;
  color: var(--ink-secondary);
  font-weight: 700;
  font-size: 13px;
}

.price-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.price-slider-row input[type="range"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.price-slider-value {
  min-width: 92px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 5px 8px;
}

.price-filter-actions {
  display: flex;
  justify-content: stretch;
  gap: 8px;
  padding-top: 8px;
}

.price-filter-actions .btn {
  flex: 1;
  justify-content: center;
}

@media (max-width: 640px) {
  .price-filter-dialog {
    padding: 0 16px 20px;
    border-radius: 16px 16px 0 0;
  }

  .price-slider-row {
    grid-template-columns: 24px 1fr auto;
    gap: 8px;
  }

  .price-filter-live-count {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .price-slider-value {
    min-width: 78px;
    font-size: 12px;
    padding: 4px 7px;
  }
}


.location-filter-dialog {
  max-height: 70vh;
}

.location-search-wrap {
  position: relative;
}

.location-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink);
  outline: none;
  transition:
    border-color var(--motion-180), box-shadow var(--motion-180);
  box-sizing: border-box;
}

.location-search-input::placeholder {
  color: var(--muted);
}

.location-search-input:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb)/0.12);
}

.location-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 45vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0;
  margin: 0 -4px;
}

.location-list::-webkit-scrollbar {
  width: 5px;
}

.location-list::-webkit-scrollbar-track {
  background: transparent;
}

.location-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

.location-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink);
  cursor: pointer;
  transition:
    background var(--motion-180), color var(--motion-180);
  text-align: left;
}

.location-item:hover {
  background: var(--surface-soft);
}

.location-item.active {
  background: rgba(var(--primary-rgb) / 0.1);
  color: var(--primary-deep);
  font-weight: 600;
}

.location-item.active:hover {
  background: rgba(var(--primary-rgb) / 0.15);
}

.location-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-item-count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}

.location-item.active .location-item-count {
  background: rgba(var(--primary-rgb) / 0.12);
  border-color: rgba(var(--primary-rgb) / 0.25);
  color: var(--primary-deep);
}


.nova-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox, 700);
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--motion-320), visibility var(--motion-320);
}

.nova-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.nova-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  transform: scale(0.95);
  opacity: 0;
  transition:
    transform var(--motion-320) var(--motion-ease), opacity var(--motion-320);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.nova-lightbox.is-open .nova-lightbox-img {
  transform: scale(1);
  opacity: 1;
}

.nova-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background var(--motion-180);
  z-index: 2;
}

.nova-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.nova-lightbox-prev,
.nova-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  transition: background var(--motion-180);
  z-index: 2;
}

.nova-lightbox-prev {
  left: 16px;
}

.nova-lightbox-next {
  right: 16px;
}

.nova-lightbox-prev:hover,
.nova-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.22);
}

.nova-lightbox-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0;
  overflow-x: auto;
  max-width: 90vw;
}

.nova-lightbox-strip img {
  height: 60px;
  width: auto;
  border-radius: 8px;
  object-fit: cover;
  opacity: 0.6;
  cursor: pointer;
  transition:
    opacity var(--motion-180), outline-color var(--motion-180);
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.nova-lightbox-strip img:hover {
  opacity: 0.85;
}

.nova-lightbox-strip img.active {
  opacity: 1;
  outline-color: var(--primary);
}

.nova-lightbox-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-align: center;
}


@keyframes heartBounce {
  0% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.3);
  }

  50% {
    transform: scale(0.9);
  }

  75% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.ad-fav-btn.bounce {
  animation: heartBounce var(--motion-320) var(--motion-ease);
}

.ad-fav-btn.is-active {
  transition:
    color var(--motion-320), transform var(--motion-320);
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb) / 0.45);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(var(--primary-rgb) / 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb) / 0);
  }
}

.btn.primary.pulse-attention {
  animation: pulseGlow 2s ease-in-out infinite;
}

.nova-toast--success {
  border-left: 3px solid var(--green);
}

.nova-toast--error {
  border-left: 3px solid var(--red);
}

.nova-toast--warning {
  border-left: 3px solid #f59e0b;
}

.nova-toast--success .nova-toast-body::before {
  content: "\2713";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--green-rgb) / 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
  flex-shrink: 0;
}

.nova-toast--error .nova-toast-body::before {
  content: "\2715";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(231, 76, 60, 0.12);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
  flex-shrink: 0;
}

.nova-toast--warning .nova-toast-body::before {
  content: "\0021";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  font-size: 13px;
  font-weight: 700;
  margin-right: 8px;
  flex-shrink: 0;
}

.nova-toast--success .nova-toast-body,
.nova-toast--error .nova-toast-body,
.nova-toast--warning .nova-toast-body {
  display: flex;
  align-items: center;
}


.ad-empty {
  animation: fadeUp var(--motion-320) var(--motion-ease) both;
}

.ad-empty-loading {
  border-style: solid;
  border-color: rgba(var(--primary-rgb) / 0.2);
  background: rgba(var(--surface-rgb) / 0.96);
}

.ad-empty-error {
  border-style: solid;
  border-color: rgba(239, 68, 68, 0.34);
  background: color-mix(in srgb, var(--surface) 94%, var(--red) 6%);
}

.ad-empty-error .ad-empty-icon {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

.ad-empty-denied {
  border-style: solid;
  border-color: rgba(var(--primary-rgb) / 0.24);
  background: color-mix(in srgb, var(--surface) 95%, var(--primary) 5%);
}

.ad-empty-action {
  min-height: var(--control-44);
  margin-top: var(--space-8);
}

.ad-empty-illustration {
  width: 120px;
  height: 100px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}

.ad-empty-illustration svg {
  width: 100%;
  height: 100%;
}

.ad-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--color-on-primary);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition:
    background var(--motion-180), box-shadow var(--motion-180);
  text-decoration: none;
}

.ad-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.ad-empty-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 6px auto 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--primary-rgb) / 0.14);
  background: rgba(var(--primary-rgb) / 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.ad-empty-actions .btn {
  min-width: 150px;
}

.ad-empty-cta:hover {
  background: var(--primary-strong);
  box-shadow: var(--primary-shadow);
}

.favorites-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 32px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  background: var(--surface);
  animation: fadeUp var(--motion-320) var(--motion-ease) both;
}

.favorites-empty .ad-empty-illustration {
  color: var(--red);
  opacity: 0.35;
}

.search-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 32px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  background: var(--surface);
  animation: fadeUp var(--motion-320) var(--motion-ease) both;
}

.search-empty .ad-empty-illustration {
  color: var(--muted);
  opacity: 0.3;
}

.search-empty .ad-empty-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 6px;
}

.search-empty .ad-empty-text {
  color: var(--muted);
  font-size: 13px;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}

@media (max-width: 768px), (pointer: coarse) {
  .price-filter-close,
  .nova-lightbox-close {
    min-width: 44px;
    min-height: 44px;
  }

  .location-item {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .price-filter-overlay,
  .price-filter-dialog,
  .nova-lightbox,
  .nova-lightbox-img {
    animation-name: none;
    transition-property: none;
  }

  .price-filter-dialog,
  .nova-lightbox-img {
    transform: none;
  }
}
