/* ============================================
   ARSES Search Results Page (S3.5)
   ============================================ */

.arses-search-page {
  --search-green-900: #0d3b2e;
  --search-green-700: #1a7354;
  --search-green-600: #228b63;
  --search-green-500: #1f7a5c;
  --search-cream: #faf8f3;
  --search-muted: #5a7268;
  --search-border: rgba(26, 115, 84, 0.12);
  --search-radius: 16px;
  --search-radius-lg: 20px;

  padding: calc(var(--header-height, 72px) + var(--space-4, 32px)) 0 var(--space-6, 64px);
  min-height: 60vh;
  color: var(--search-green-900);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 139, 99, 0.08), transparent 60%),
    linear-gradient(180deg, var(--search-cream) 0%, var(--background, #f6f7f5) 240px);
}

.arses-search-page__inner {
  max-width: var(--container, 1280px);
}

/* Hero */
.arses-search-hero {
  text-align: center;
  margin-bottom: var(--space-4, 32px);
}

.arses-search-hero__badge {
  display: inline-block;
  margin-bottom: var(--space-2, 16px);
  padding: 6px 14px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--search-green-600);
  background: rgba(34, 139, 99, 0.1);
  border: 1px solid rgba(34, 139, 99, 0.15);
  border-radius: 999px;
}

.arses-search-hero__title {
  margin-bottom: var(--space-2, 16px);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--search-green-900);
  letter-spacing: -0.03em;
}

.arses-search-hero__subtitle {
  max-width: 36rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--search-muted);
}

/* Search box */
.arses-search-box {
  max-width: 720px;
  margin: 0 auto var(--space-3, 24px);
}

.arses-search-box__form {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: var(--search-radius-lg);
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.06));
  overflow: hidden;
}

.arses-search-box__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  color: var(--search-muted);
}

.arses-search-box__icon svg {
  width: 20px;
  height: 20px;
}

.arses-search-box__input {
  flex: 1;
  min-width: 0;
  padding: 16px 8px 16px 0;
  font-family: inherit;
  font-size: 1rem;
  color: var(--search-green-900);
  background: transparent;
  border: none;
  outline: none;
}

.arses-search-box__input::placeholder {
  color: #9ca89f;
}

.arses-search-box__submit {
  flex-shrink: 0;
  margin: 6px;
  padding: 0 22px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--search-green-500);
  border-radius: calc(var(--search-radius-lg) - 6px);
  transition: background 0.2s ease;
}

.arses-search-box__submit:hover {
  background: var(--search-green-700);
}

.arses-search-box__submit:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

/* Search top bar */
.arses-search-top {
  margin-bottom: var(--space-4, 32px);
}

.arses-search-meta {
  max-width: 720px;
  margin: 0 auto var(--space-2, 16px);
  text-align: center;
}

.arses-search-filter-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 18px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--search-green-700);
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.arses-search-filter-toggle svg {
  width: 18px;
  height: 18px;
}

.arses-search-filter-toggle:hover {
  border-color: rgba(34, 139, 99, 0.25);
  background: rgba(34, 139, 99, 0.04);
}

.arses-search-filter-toggle:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

/* Layout: sidebar + main */
.arses-search-layout {
  display: grid;
  gap: var(--space-4, 32px);
  align-items: start;
}

.arses-search-sidebar {
  display: none;
}

.arses-search-main {
  min-width: 0;
}

@media (min-width: 1024px) {
  .arses-search-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: var(--space-5, 48px);
  }

  .arses-search-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-height, 72px) + var(--space-3, 24px));
    align-self: start;
    max-height: calc(100vh - var(--header-height, 72px) - var(--space-4, 32px));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 139, 99, 0.25) transparent;
  }

  .arses-search-meta {
    text-align: left;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .arses-search-box {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Sidebar */
.arses-search-sidebar__inner {
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: var(--search-radius);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
  overflow: hidden;
}

.arses-search-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2, 16px) var(--space-3, 24px);
  border-bottom: 1px solid var(--search-border);
}

.arses-search-sidebar__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--search-green-900);
  letter-spacing: -0.01em;
}

.arses-search-sidebar__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--search-muted);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.arses-search-sidebar__close svg {
  width: 18px;
  height: 18px;
}

.arses-search-sidebar__close:hover {
  background: rgba(34, 139, 99, 0.08);
}

.arses-search-sidebar__close:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

@media (min-width: 1024px) {
  .arses-search-sidebar__head {
    display: none;
  }
}

.arses-search-filters {
  padding: var(--space-2, 16px) var(--space-3, 24px) var(--space-3, 24px);
}

.arses-search-filter-group {
  margin: 0;
  padding: 0;
  border: none;
}

.arses-search-filter-group + .arses-search-filter-group {
  margin-top: var(--space-3, 24px);
  padding-top: var(--space-3, 24px);
  border-top: 1px solid var(--search-border);
}

.arses-search-filter-group__title {
  display: block;
  margin-bottom: 12px;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--search-green-900);
}

.arses-search-filter-group__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arses-search-filter-option__label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.875rem;
  color: var(--search-green-900);
  cursor: not-allowed;
  opacity: 0.72;
}

.arses-search-filter-option__label.is-enabled {
  cursor: pointer;
  opacity: 1;
}

.arses-search-filter-option__input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--search-green-600);
}

.arses-search-filter-price {
  padding-top: 4px;
}

.arses-search-filter-price__slider {
  width: 100%;
  height: 4px;
  accent-color: var(--search-green-600);
  cursor: not-allowed;
  opacity: 0.6;
}

.arses-search-filter-price__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--search-muted);
}

.arses-search-filter-skeleton {
  height: 72px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #e8f0ec 25%, #f4f8f6 50%, #e8f0ec 75%);
  background-size: 200% 100%;
  animation: arses-search-shimmer 1.4s ease-in-out infinite;
}

.arses-search-sidebar__skeleton {
  padding: var(--space-3, 24px);
}

/* Toolbar */
.arses-search-toolbar {
  margin-bottom: var(--space-3, 24px);
}

.arses-search-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.arses-search-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.arses-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.arses-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--search-green-900);
  background: rgba(34, 139, 99, 0.1);
  border: 1px solid rgba(34, 139, 99, 0.2);
  border-radius: 999px;
}

.arses-search-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--search-muted);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.arses-search-chip__remove:hover {
  color: var(--search-green-900);
  background: rgba(34, 139, 99, 0.12);
}

.arses-search-sort__select {
  appearance: none;
  padding: 9px 36px 9px 14px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--search-green-900);
  background:
    #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a7268' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  border: 1px solid var(--search-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.arses-search-sort__select:hover {
  border-color: rgba(34, 139, 99, 0.25);
}

.arses-search-sort__select:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

.arses-search-view {
  display: inline-flex;
  padding: 3px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--search-border);
  border-radius: 10px;
}

.arses-search-view__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--search-muted);
  border-radius: 7px;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.arses-search-view__btn svg {
  width: 16px;
  height: 16px;
}

.arses-search-view__btn:hover {
  color: var(--search-green-700);
}

.arses-search-view__btn.is-active {
  color: #fff;
  background: var(--search-green-500);
}

.arses-search-view__btn:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

/* Summary */
.arses-search-summary {
  margin-bottom: 4px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--search-muted);
}

.arses-search-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--search-green-600);
}

.arses-search-counts__item + .arses-search-counts__item::before {
  content: "·";
  margin-right: 8px;
  color: rgba(34, 139, 99, 0.35);
  font-weight: 400;
}

.arses-search-summary strong,
.arses-search-summary__query {
  font-weight: 600;
  color: var(--search-green-900);
}

/* Tabs */
.arses-search-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.arses-search-tabs__btn {
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--search-muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--search-border);
  border-radius: 999px;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.arses-search-tabs__btn:hover {
  color: var(--search-green-700);
  border-color: rgba(34, 139, 99, 0.25);
}

.arses-search-tabs__btn.is-active {
  color: #fff;
  background: var(--search-green-500);
  border-color: var(--search-green-500);
}

.arses-search-tabs__btn:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

/* Results area */
.arses-search-results {
  position: relative;
}

.arses-search-section + .arses-search-section {
  margin-top: var(--space-5, 48px);
}

.arses-search-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-3, 24px);
}

.arses-search-section__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--search-green-900);
  letter-spacing: -0.02em;
}

.arses-search-section__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--search-green-700);
  background: rgba(34, 139, 99, 0.1);
  border-radius: 999px;
}

.arses-search-section__badge--skeleton {
  width: 40px;
  height: 22px;
  padding: 0;
  background: linear-gradient(90deg, #e8f0ec 25%, #f4f8f6 50%, #e8f0ec 75%);
  background-size: 200% 100%;
  animation: arses-search-shimmer 1.4s ease-in-out infinite;
}

/* Grids */
.arses-search-grid {
  display: grid;
  gap: var(--space-3, 24px);
}

.arses-search-grid--products {
  grid-template-columns: 1fr;
}

.arses-search-grid--categories {
  grid-template-columns: repeat(2, 1fr);
}

.arses-search-grid--sellers {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .arses-search-grid--products {
    grid-template-columns: repeat(2, 1fr);
  }

  .arses-search-grid--categories {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .arses-search-grid--products {
    grid-template-columns: repeat(3, 1fr);
  }

  .arses-search-grid--categories {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .arses-search-grid--products {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Marketplace cards */
.arses-search-card {
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: var(--search-radius);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
  overflow: hidden;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.arses-search-card:not(.arses-search-card--skeleton):hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(26, 115, 84, 0.12);
  border-color: rgba(34, 139, 99, 0.2);
}

.arses-search-card--product {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.arses-search-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e8f5ef 0%, #dceee4 100%);
  overflow: hidden;
}

.arses-search-card__media--placeholder::after {
  content: "";
  position: absolute;
  inset: 32% 38%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.arses-search-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.arses-search-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-2, 16px);
  gap: 8px;
}

.arses-search-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--search-green-900);
}

.arses-search-card__description {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--search-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.arses-search-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

.arses-search-card__currency {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--search-muted);
}

.arses-search-card__price {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--search-green-700);
}

.arses-search-card__price--placeholder {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--search-muted);
}

.arses-search-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.arses-search-card__sellers {
  font-size: 0.8125rem;
  color: var(--search-muted);
}

.arses-search-card__footer {
  margin-top: 4px;
}

.arses-search-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--search-green-500);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.arses-search-card__action:hover {
  background: var(--search-green-700);
}

.arses-search-card__action:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

.arses-search-card__action[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.arses-search-card__action--seller {
  width: auto;
  padding: 8px 16px;
}

/* Badges */
.arses-search-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
}

.arses-search-badge--in-stock,
.arses-search-badge--approved {
  color: #166534;
  background: #dcfce7;
}

.arses-search-badge--out-of-stock {
  color: #4b5563;
  background: #f3f4f6;
}

/* Category cards */
.arses-search-card--category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--space-2, 16px) var(--space-3, 24px);
  text-decoration: none;
  color: inherit;
}

.arses-search-card--category:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

.arses-search-card__category-content {
  flex: 1;
  min-width: 0;
}

.arses-search-card--category .arses-search-card__title {
  margin-bottom: 4px;
}

.arses-search-card__count {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--search-green-600);
}

.arses-search-card__arrow-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--search-green-600);
  transition: transform 0.2s ease;
}

.arses-search-card--category:hover .arses-search-card__arrow-icon {
  transform: translateX(3px);
}

/* Seller cards */
.arses-search-card--seller {
  display: flex;
  gap: var(--space-2, 16px);
  padding: var(--space-2, 16px);
  align-items: flex-start;
}

.arses-search-card__avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #c5e4d4 0%, #e8f5ef 100%);
}

.arses-search-card__avatar--placeholder {
  border: 1px solid var(--search-border);
}

.arses-search-card--seller .arses-search-card__body {
  padding: 0;
  flex: 1;
  min-width: 0;
}

.arses-search-card__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Skeleton loaders */
.arses-search-loading .arses-search-section--skeleton + .arses-search-section--skeleton {
  margin-top: var(--space-5, 48px);
}

.arses-search-card--skeleton {
  pointer-events: none;
}

.arses-search-skeleton__block {
  border-radius: 8px;
  background: linear-gradient(90deg, #e8f0ec 25%, #f4f8f6 50%, #e8f0ec 75%);
  background-size: 200% 100%;
  animation: arses-search-shimmer 1.4s ease-in-out infinite;
}

.arses-search-skeleton__media {
  aspect-ratio: 4 / 3;
  border-radius: 0;
}

.arses-search-skeleton__avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.arses-search-skeleton__line {
  height: 12px;
  margin-bottom: 10px;
}

.arses-search-skeleton__line--title {
  width: 70%;
  height: 14px;
}

.arses-search-skeleton__line--desc {
  width: 90%;
}

.arses-search-skeleton__line--price {
  width: 45%;
}

.arses-search-skeleton__line--count {
  width: 50%;
  margin: 8px auto 0;
}

.arses-search-skeleton__line--action {
  width: 100%;
  height: 38px;
  margin-top: 8px;
  margin-bottom: 0;
  border-radius: 10px;
}

.arses-search-card--category.arses-search-card--skeleton {
  padding: var(--space-2, 16px);
  text-align: center;
}

@keyframes arses-search-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.arses-search-empty {
  max-width: 32rem;
  margin: var(--space-5, 48px) auto;
  padding: var(--space-5, 48px) var(--space-4, 32px);
  text-align: center;
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: var(--search-radius-lg);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
}

.arses-search-empty__illustration {
  margin-bottom: var(--space-3, 24px);
}

.arses-search-empty__svg {
  width: 120px;
  height: 100px;
  margin: 0 auto;
}

.arses-search-empty__title {
  margin-bottom: 8px;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--search-green-900);
}

.arses-search-empty__text {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--search-muted);
}

.arses-search-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: var(--space-3, 24px);
}

.arses-search-empty__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 999px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.arses-search-empty__action--primary {
  color: #fff;
  background: var(--search-green-500);
}

.arses-search-empty__action--primary:hover {
  background: var(--search-green-700);
}

.arses-search-empty__action--secondary {
  color: var(--search-green-700);
  background: #fff;
  border: 1px solid var(--search-border);
}

.arses-search-empty__action--secondary:hover {
  border-color: rgba(34, 139, 99, 0.3);
  background: rgba(34, 139, 99, 0.04);
}

.arses-search-empty__action:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

/* Error state */
.arses-search-error {
  max-width: 28rem;
  margin: var(--space-5, 48px) auto;
  padding: var(--space-4, 32px);
  text-align: center;
  background: #fff;
  border: 1px solid rgba(220, 38, 38, 0.12);
  border-radius: var(--search-radius-lg);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
}

.arses-search-error__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--space-2, 16px);
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 50%;
}

.arses-search-error__icon svg {
  width: 24px;
  height: 24px;
}

.arses-search-error__title {
  margin-bottom: 6px;
  font-size: 1.125rem;
  font-weight: 700;
  color: #991b1b;
}

.arses-search-error__text {
  margin-bottom: var(--space-3, 24px);
  font-size: 0.875rem;
  line-height: 1.5;
  color: #b91c1c;
}

.arses-search-error__retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--search-green-500);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.arses-search-error__retry:hover {
  background: var(--search-green-700);
}

.arses-search-error__retry:focus-visible {
  outline: 2px solid var(--search-green-600);
  outline-offset: 2px;
}

/* List view */
.arses-search-results.is-view-list .arses-search-grid--products {
  grid-template-columns: 1fr;
}

.arses-search-results.is-view-list .arses-search-card--product {
  flex-direction: row;
  align-items: stretch;
}

.arses-search-results.is-view-list .arses-search-card--product .arses-search-card__media {
  flex: 0 0 140px;
  aspect-ratio: auto;
  min-height: 120px;
  border-radius: var(--search-radius) 0 0 var(--search-radius);
}

.arses-search-results.is-view-list .arses-search-card--product .arses-search-card__body {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.arses-search-results.is-view-list .arses-search-card--product .arses-search-card__title {
  flex: 1 1 100%;
}

.arses-search-results.is-view-list .arses-search-card--product .arses-search-card__description {
  flex: 1 1 100%;
  -webkit-line-clamp: 1;
}

.arses-search-results.is-view-list .arses-search-card--product .arses-search-card__footer {
  margin-left: auto;
  margin-top: 0;
}

.arses-search-results.is-view-list .arses-search-card--product .arses-search-card__action--open {
  width: auto;
  min-width: 100px;
}

.arses-search-results.is-view-list .arses-search-grid--sellers {
  grid-template-columns: 1fr;
}

/* Tab panel visibility */
.arses-search-results.is-tab-products [data-search-categories],
.arses-search-results.is-tab-products [data-search-sellers],
.arses-search-results.is-tab-categories [data-search-products],
.arses-search-results.is-tab-categories [data-search-sellers],
.arses-search-results.is-tab-sellers [data-search-products],
.arses-search-results.is-tab-sellers [data-search-categories] {
  display: none !important;
}

/* Responsive */
@media (max-width: 1023px) {
  .arses-search-filter-toggle {
    display: flex;
  }

  .arses-search-sidebar {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    padding: var(--space-3, 24px);
    background: rgba(13, 59, 46, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.25s ease,
      visibility 0.25s ease;
  }

  .arses-search-layout.is-filters-open .arses-search-sidebar {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .arses-search-sidebar__inner {
    width: min(100%, 360px);
    max-height: calc(100vh - var(--space-6, 64px));
    margin: var(--space-4, 32px) auto 0;
    overflow-y: auto;
    transform: translateY(12px);
    transition: transform 0.25s ease;
  }

  .arses-search-layout.is-filters-open .arses-search-sidebar__inner {
    transform: translateY(0);
  }

  body.arses-search-filters-open {
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .arses-search-page {
    padding-top: calc(var(--header-height, 72px) + var(--space-3, 24px));
  }

  .arses-search-box__form {
    flex-wrap: wrap;
    border-radius: var(--search-radius);
  }

  .arses-search-box__icon {
    width: 44px;
  }

  .arses-search-box__input {
    flex: 1 1 calc(100% - 44px);
    padding: 14px 12px 14px 0;
  }

  .arses-search-box__submit {
    flex: 1 1 100%;
    margin: 0;
    padding: 14px;
    border-radius: 0;
  }

  .arses-search-toolbar__row {
    flex-direction: column;
    align-items: stretch;
  }

  .arses-search-toolbar__actions {
    margin-left: 0;
    justify-content: space-between;
    width: 100%;
  }

  .arses-search-sort__select {
    flex: 1;
  }

  .arses-search-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .arses-search-tabs__btn {
    flex-shrink: 0;
  }

  .arses-search-grid--categories {
    grid-template-columns: 1fr;
  }

  .arses-search-empty__actions {
    flex-direction: column;
  }

  .arses-search-empty__action {
    width: 100%;
  }
}

/* ============================================
   ARSES Search Autocomplete (S4.1)
   ============================================ */

.arses-autocomplete {
  position: relative;
}

.arses-autocomplete__dropdown {
  position: fixed;
  z-index: 1200;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--search-border, rgba(26, 115, 84, 0.12));
  border-radius: 14px;
  box-shadow:
    0 10px 28px rgba(13, 59, 46, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  -webkit-overflow-scrolling: touch;
}

.arses-autocomplete__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9375rem;
  text-align: left;
  color: var(--search-green-900, #0d3b2e);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.arses-autocomplete__item:hover,
.arses-autocomplete__item--active {
  background: rgba(34, 139, 99, 0.08);
}

.arses-autocomplete__item:focus-visible {
  outline: 2px solid var(--search-green-600, #228b63);
  outline-offset: 1px;
}

.arses-autocomplete__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--search-muted, #5a7268);
}

.arses-autocomplete__icon svg {
  width: 18px;
  height: 18px;
}

.arses-autocomplete__badge {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}

.arses-autocomplete__badge--product {
  color: #166534;
  background: #dcfce7;
}

.arses-autocomplete__badge--category {
  color: #1e40af;
  background: #dbeafe;
}

.arses-autocomplete__badge--seller {
  color: #7c2d12;
  background: #ffedd5;
}

.arses-autocomplete__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arses-autocomplete__empty {
  padding: 12px 14px;
  font-size: 0.875rem;
  color: var(--search-muted, #5a7268);
  text-align: center;
}

@media (max-width: 640px) {
  .arses-autocomplete__dropdown {
    max-height: min(280px, 45vh);
    border-radius: 12px;
  }

  .arses-autocomplete__item {
    padding: 12px;
    font-size: 0.875rem;
  }
}
