/* ===== Product listing layout ===== */

.listing-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: #9ca3af;
}

.listing-breadcrumb a:hover {
  color: #059669;
}

.listing-layout {
  position: relative;
}

@media (min-width: 1024px) {
  .listing-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.75rem;
    align-items: start;
  }
}

.listing-layout__content {
  min-width: 0;
}

/* ===== Search results hero ===== */

.listing-search-hero {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border: 1px solid #d1fae5;
  border-radius: 1rem;
}

.listing-search-hero__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.12);
}

.listing-search-hero__label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 2px;
}

.listing-search-hero__query {
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.4;
}

.listing-search-hero__count {
  font-size: 13px;
  color: #059669;
  margin-top: 4px;
  font-weight: 600;
}

/* ===== Toolbar ===== */

.listing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.listing-toolbar__start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.listing-toolbar__count {
  font-size: 13px;
  color: #9ca3af;
}

.listing-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  background: #fff;
  position: relative;
}

.listing-filter-toggle__badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  position: absolute;
  top: 6px;
  left: 6px;
}

.listing-sort-select {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 10px center;
  appearance: none;
  cursor: pointer;
}

.listing-sort-select:focus {
  outline: none;
  border-color: #059669;
}

/* ===== Active filter chips ===== */

.listing-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.listing-active-filters__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #c2410c;
  transition: background 0.2s;
}

.listing-active-filters__chip:hover {
  background: #ffedd5;
}

/* ===== Filter sidebar ===== */

.listing-filters-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  z-index: 45;
  transition: background 0.3s;
}

.listing-filters-backdrop.is-visible {
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.listing-filters {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(320px, 92vw);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.listing-filters.is-open {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .listing-filters-backdrop {
    display: none !important;
  }

  .listing-filters {
    position: sticky;
    top: calc(var(--shop-admin-bar-height, 0px) + var(--shop-header-height, 120px) + 0.75rem);
    z-index: 10;
    width: auto;
    height: auto;
    transform: none;
    box-shadow: none;
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    overflow: visible;
    align-self: start;
  }

  .listing-filters.is-open {
    transform: none;
  }

  .listing-filters__form {
    overflow: visible;
    flex: none;
  }

  .listing-filters__options {
    max-height: none;
    overflow: visible;
  }
}

.listing-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.listing-filters__title {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.listing-filters__close {
  padding: 0.35rem;
  border-radius: 8px;
  color: #6b7280;
}

.listing-filters__close:hover {
  background: #f3f4f6;
}

.listing-filters__form {
  padding: 1rem 1.25rem 1.25rem;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.listing-filters__form::-webkit-scrollbar {
  display: none;
}

.listing-filters__section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #f3f4f6;
}

.listing-filters__section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.listing-filters__label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.75rem;
}

.listing-filters__options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.listing-filters__check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  padding: 0.35rem 0;
}

.listing-filters__check input {
  width: 16px;
  height: 16px;
  accent-color: #059669;
  flex-shrink: 0;
}

.listing-filters__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.listing-filters__submit {
  width: 100%;
  padding: 0.75rem;
  background: #f59e0b;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  border-radius: 12px;
  transition: background 0.2s;
}

.listing-filters__submit:hover {
  background: #d97706;
}

.listing-filters__reset {
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  padding: 0.5rem;
}

.listing-filters__reset:hover {
  color: #374151;
}

body.listing-filters-open {
  overflow: hidden;
}

@media (min-width: 1024px) {
  body.listing-filters-open {
    overflow: auto;
  }
}

/* ===== Price range slider ===== */

.price-range-slider-wrap {
  padding-top: 0.25rem;
}

.price-range-track-wrap {
  position: relative;
  height: 32px;
  margin-bottom: 0.75rem;
}

.price-range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  pointer-events: none;
}

.price-range-fill {
  position: absolute;
  top: 0;
  height: 6px;
  background: linear-gradient(90deg, #059669, #14b8a6);
  border-radius: 999px;
  pointer-events: none;
}

.price-range-inputs {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.price-range-inputs input[type="range"] {
  position: absolute;
  width: 100%;
  height: 32px;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.price-range-inputs input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border: none;
}

.price-range-inputs input[type="range"]::-moz-range-track {
  height: 6px;
  background: transparent;
  border: none;
}

.price-range-inputs input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #059669;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  pointer-events: auto;
}

.price-range-inputs input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #059669;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  pointer-events: auto;
}

.price-range-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
}

/* ===== Empty state ===== */

.listing-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #fafafa;
  border: 1px dashed #e5e7eb;
  border-radius: 1rem;
}

.listing-empty__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  color: #9ca3af;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.listing-empty__title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.5rem;
}

.listing-empty__text {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 1.25rem;
}

.listing-empty__suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.listing-empty__suggestion {
  padding: 0.4rem 0.875rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.listing-empty__suggestion:hover {
  border-color: #059669;
  color: #059669;
}

.listing-empty__cta {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: #059669;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
}

.listing-empty__cta:hover {
  background: #047857;
}

/* ===== Search modal ===== */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.search-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.search-modal__panel {
  background: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(-8px);
  transition: transform 0.3s;
}

.search-modal.is-open .search-modal__panel {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .search-modal {
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
  }

  .search-modal__panel {
    max-width: 640px;
    height: auto;
    max-height: 85vh;
    border-radius: 1rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    overflow: hidden;
  }
}

.search-modal__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
}

.search-modal__close {
  padding: 0.35rem;
  border-radius: 999px;
  color: #6b7280;
  flex-shrink: 0;
}

.search-modal__close:hover {
  background: #e5e7eb;
}

.search-modal__form {
  flex: 1;
  position: relative;
}

.search-modal__input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  font-size: 14px;
  outline: none;
}

.search-modal__input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.search-modal__icon {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.search-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-modal__section-title {
  font-size: 12px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.search-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-modal__tag {
  padding: 0.5rem 0.875rem;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  transition: all 0.2s;
}

.search-modal__tag:hover {
  background: #ecfdf5;
  color: #059669;
}

.search-modal__categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.search-modal__category {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem;
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  background: #fafafa;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  transition: background 0.2s;
}

.search-modal__category:hover {
  background: #fff;
  border-color: #d1fae5;
}

.search-modal__category-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-modal__promo {
  background: linear-gradient(135deg, #059669, #14b8a6);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.search-modal__promo-title {
  font-size: 13px;
  font-weight: 800;
}

.search-modal__promo-text {
  font-size: 11px;
  opacity: 0.9;
  margin-top: 2px;
}

.search-modal__promo-btn {
  padding: 0.5rem 0.875rem;
  background: #fff;
  color: #047857;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
