/**
 * ATS Search v3 - Modal Styles
 * Full-width modal arama stiller
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --ats-primary: #e31e24;
  --ats-primary-hover: #c41a1f;
  --ats-text: #1a1a1a;
  --ats-text-muted: #666;
  --ats-text-light: #999;
  --ats-border: #e0e0e0;
  --ats-bg: #fff;
  --ats-bg-light: #f8f8f8;
  --ats-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  --ats-transition: 0.2s ease;
  --ats-radius: 4px;
  --ats-sidebar-width: 240px;
}

/* Body scroll lock when modal is open */
html[ats-search-active="true"],
body[ats-search-active="true"] {
  overflow: hidden !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide scrollbar gutter */
html[ats-search-active="true"] {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html[ats-search-active="true"]::-webkit-scrollbar {
  display: none;
}

/* ============================================
   Modal Base
   ============================================ */
.ats-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.ats-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.ats-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.ats-modal-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--ats-bg);
  display: flex;
  flex-direction: column;
  transform: translateY(-10px);
  transition: transform 0.3s ease;
}

.ats-modal.is-open .ats-modal-container {
  transform: translateY(0);
}

/* ============================================
   Modal Header
   ============================================ */
.ats-modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--ats-border);
  background: var(--ats-bg);
}

.ats-modal-logo {
  flex-shrink: 0;
  max-width: 170px;
}

.ats-modal-logo img {
  /* height: 32px; */
  width: auto;
}

.ats-modal-search-box {
  flex: 1;
  /* max-width: 800px; */
}

.ats-modal-search-box input {
  width: 100% !important;
  padding: 12px 16px !important;
  font-size: 16px !important;
  border: 1px solid var(--ats-border) !important;
  border-radius: var(--ats-radius) !important;
  outline: none;
  transition: border-color var(--ats-transition) !important;
  /* background-color: rgb(248 245 245) !important; */
  background-color: rgb(243 244 246) !important;
  color: #4e4e4e;
  font-weight: bold;
}

.ats-modal-search-box input:focus {
  /* border-color: var(--ats-primary); */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.ats-modal-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: none;
  border: none !important;
  padding: 0 !important;
  cursor: pointer !important;
  color: var(--ats-text) !important;
  border-radius: var(--ats-radius) !important;
  transition: background var(--ats-transition) !important;
}

.ats-modal-close:hover {
  background: var(--ats-bg-light);
}

/* ============================================
   Modal Body
   ============================================ */
.ats-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Showcase Mode (Full Width) */
.ats-modal-body.has-showcase .ats-modal-sidebar {
  display: none !important;
}

.ats-modal-body.has-showcase .ats-modal-main {
  width: 100%;
}

/* ============================================
   Sidebar / Facets
   ============================================ */
.ats-modal-sidebar {
  width: var(--ats-sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--ats-border);
  overflow-y: auto;
  padding: 16px 0;
}

.ats-facet-group {
  border-bottom: 1px solid #cdcdcd36;
  padding: 0 16px 16px;
  margin-bottom: 16px;
}

.ats-facet-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.ats-facet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* margin-bottom: 12px; */
  cursor: pointer;
  user-select: none;
}

.ats-facet-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ats-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ats-facet-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background-color: var(--ats-primary, #2563eb);
  border-radius: 9px;
  line-height: 1;
}

button.ats-clear-all-filters {
  display: block;
  width: 90%;
  background: none;
  border: 1px solid var(--ats-border);
  color: var(--ats-primary, #2563eb);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  margin: 0 auto 10px;
  text-align: center;
  transition: background var(--ats-transition);
}

button.ats-clear-all-filters:hover {
  background: var(--ats-bg-light);
}

.ats-facet-toggle {
  width: 24px;
  height: 24px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  color: var(--ats-text-muted) !important;
  transition: transform var(--ats-transition) !important;
  padding: 0 !important;
}

.ats-facet-group.is-collapsed .ats-facet-toggle {
  transform: rotate(-90deg);
}

.ats-facet-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Scrollable facet options — 5 items visible, rest scrollable */
.ats-facet-group.has-scroll .ats-facet-options {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.ats-facet-group.has-scroll .ats-facet-options::-webkit-scrollbar {
  width: 4px;
}

.ats-facet-group.has-scroll .ats-facet-options::-webkit-scrollbar-track {
  background: var(--ats-bg-light);
  border-radius: 2px;
}

.ats-facet-group.has-scroll .ats-facet-options::-webkit-scrollbar-thumb {
  background: var(--ats-border);
  border-radius: 2px;
}

.ats-facet-group.is-collapsed .ats-facet-options {
  display: none;
}

/* Facet search input */
.ats-facet-search {
  margin-bottom: 8px;
}

.ats-facet-search input.ats-facet-search-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--ats-border);
  border-radius: var(--ats-radius);
  outline: none;
  transition: border-color var(--ats-transition);
  background: #f3f4f6;
  height: auto;
}
.ats-facet-search-input:focus {
  border-color: var(--ats-primary);
}

.ats-facet-search-input::placeholder {
  color: var(--ats-text-light);
}

/* Hide filtered facet options */
.ats-facet-option.is-hidden {
  display: none;
}

.ats-facet-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--ats-radius);
  cursor: pointer;
  transition: background var(--ats-transition);
  font-size: 13px;
}

.ats-facet-option:hover {
  background: var(--ats-bg-light);
}

.ats-facet-option.is-selected {
  background: rgba(227, 30, 36, 0.08);
}

.ats-facet-checkbox,
.ats-sort-radio {
  width: 16px;
  height: 16px;
  accent-color: var(--ats-primary);
  cursor: pointer;
}

.ats-facet-label {
  flex: 1;
  color: var(--ats-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ats-facet-count {
  color: var(--ats-text-light);
  font-size: 12px;
}

/* ============================================
   Main Content Area
   ============================================ */
.ats-modal-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  background-color: rgb(248 245 245);
}

/* ============================================
   Results Header & Sorting
   ============================================ */
.ats-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  /* border-bottom: 1px solid rgba(0, 0, 0, 0.05); */
  position: sticky;
  top: -16px;
  background: rgb(248 245 245);
  z-index: 10;
  /* padding-top: 12px; */
}

.ats-sort-wrapper {
  position: relative;
  min-width: 180px;
}

.ats-sort-trigger {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 12px !important;
  background: #fff !important;
  border: 1px solid var(--ats-border) !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--ats-text) !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
  min-height: unset !important;
  line-height: 1.4 !important;
}

.ats-sort-trigger:hover {
  border-color: var(--ats-text-muted) !important;
  background: var(--ats-bg-light, #f9fafb) !important;
}

.ats-sort-trigger svg:first-child {
  color: var(--ats-text-muted);
  flex-shrink: 0;
}

.ats-sort-chevron {
  color: var(--ats-text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.ats-sort-wrapper.is-open .ats-sort-chevron {
  transform: rotate(180deg);
}

.ats-sort-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid var(--ats-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 4px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s;
}

.ats-sort-wrapper.is-open .ats-sort-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ats-sort-option {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding: 8px 12px !important;
  background: none !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--ats-text) !important;
  white-space: nowrap !important;
  transition: background 0.1s ease !important;
  min-height: unset !important;
  line-height: 1.4 !important;
}

.ats-sort-option:hover {
  background: var(--ats-bg-light, #f3f4f6) !important;
}

.ats-sort-option.is-active {
  color: var(--ats-primary) !important;
  font-weight: 600 !important;
}

.ats-sort-option.is-active svg {
  color: var(--ats-primary);
}

/* Results Actions Bar (Sort + Filter buttons) */
.ats-results-actions {
  display: none;
}

button.ats-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ats-text, #1f2937);
  cursor: pointer;
  min-height: unset;
}

.ats-action-divider {
  width: 1px;
  height: 20px;
  background: var(--ats-border, #e5e7eb);
  flex-shrink: 0;
}

/* Sort Bottom Sheet — styled to match mobile filter sidebar */
.ats-sort-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 300;
  pointer-events: none;
}

.ats-sort-sheet.is-open {
  pointer-events: auto;
}

.ats-sort-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.ats-sort-sheet.is-open .ats-sort-sheet-overlay {
  opacity: 1;
  pointer-events: auto;
}

.ats-sort-sheet-content {
  position: relative;
  background: #fff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ats-sort-sheet.is-open .ats-sort-sheet-content {
  transform: translateY(0);
}

/* Drag handle — same as filter sidebar */
.ats-sort-sheet-content::before {
  content: "";
  display: block;
  width: 48px;
  height: 5px;
  background: var(--ats-border, #e5e7eb);
  border-radius: 100px;
  margin: 12px auto 8px auto;
  flex-shrink: 0;
}

.ats-sort-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px 16px 24px;
  border-bottom: 1px solid var(--ats-border, #e5e7eb);
  flex-shrink: 0;
}

.ats-sort-sheet-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ats-text, #1f2937);
  margin: 0;
  letter-spacing: -0.02em;
}

.ats-sort-sheet-close {
  background: var(--ats-bg-light, #f3f4f6);
  border: none;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ats-text, #1f2937);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.ats-sort-sheet-options {
  padding: 8px 0;
}

.ats-sort-sheet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 24px;
  background: none;
  border: none;
  font-size: 15px;
  color: var(--ats-text, #1f2937);
  cursor: pointer;
  text-align: left;
}

.ats-sort-sheet-option:hover {
  background: var(--ats-bg-hover, #f3f4f6);
}

.ats-sort-sheet-option.is-selected {
  font-weight: 600;
}

#ats-pagination-container {
  width: 100%;
  margin-top: 40px;
  padding-bottom: 20px;
}

.ats-load-more-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.ats-load-more-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  background: var(--ats-text) !important;
  color: #fff !important;
  border: none !important;
  padding: 12px 32px !important;
  border-radius: 100px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.2s !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  min-width: 240px !important;
}

.ats-load-more-btn:hover:not(:disabled) {
  background: #000 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

.ats-load-more-btn:active:not(:disabled) {
  transform: translateY(0) !important;
}

.ats-load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.ats-load-more-info {
  font-size: 13px;
  color: var(--ats-text-muted);
}

.ats-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: ats-spin 0.8s linear infinite;
}

.ats-infinite-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  width: 100%;
}

.ats-spinner-brand {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  border-top-color: var(--ats-primary);
  animation: ats-spin 0.8s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

@keyframes ats-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   Query Tags
   ============================================ */
.ats-query-tags {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: #f5f5f5;
  border-radius: 8px;
}

.ats-query-tags:empty,
.ats-query-tags:not(:has(.ats-query-tag)):not(:has(.ats-sort-wrapper)) {
  display: none;
}

.ats-query-tags-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

span.ats-query-tag {
  margin: 0;
  line-height: 1;
  background: #fff;
  color: #d0011c;
  border: 1px solid #e5e7eb;
  padding: 4px 10px 5px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

span.ats-query-tag:hover {
  border-color: #d0011c;
  background: rgba(208, 1, 28, 0.04);
}

button.ats-query-tag-remove {
  padding: 0;
  margin-top: 1px;
  height: 0;
  line-height: 1;
  min-height: unset;
  color: #d0011c !important;
  transition: unset;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #6b7280;
  font-weight: 700;
}

span.ats-query-tag:hover {
  /* border: 1px solid #d0011c !important; */
  background-color: #d0011c !important;
  color: #fff !important;
}
span.ats-query-tag:hover button.ats-query-tag-remove {
  /* border: 1px solid #d0011c !important; */
  background-color: #d0011c !important;
  color: #fff !important;
}
/* Standalone query tags (promoBar disabled) — larger tags on desktop */
@media (min-width: 769px) {
  .ats-query-tags--standalone span.ats-query-tag {
    font-size: 13px;
    padding: 6px 14px 7px;
  }
}

/* ============================================
   Promo Bar (Campaign Buttons)
   ============================================ */
.ats-promo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0px 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
@media screen and (min-width: 769px) {
  #ats-promo-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }

  #ats-promo-bar-container .ats-promo-bar {
    flex: 1;
    min-width: 0;
  }

  #ats-promo-bar-container .ats-sort-wrapper,
  .ats-query-tags .ats-sort-wrapper {
    flex-shrink: 0;
  }
}
.ats-promo-bar::-webkit-scrollbar {
  display: none;
}

.ats-campaign-btn {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 14px !important;
  background: #fff !important;
  border: 1.5px solid var(--promo-color) !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--promo-color) !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  min-height: unset !important;
  line-height: 1 !important;
  flex-shrink: 0;
}

.ats-campaign-btn svg {
  flex-shrink: 0;
}

.ats-campaign-btn:hover {
  background: color-mix(in srgb, var(--promo-color) 8%, #fff) !important;
}

.ats-campaign-btn.is-active {
  background: var(--promo-color) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--promo-color) 40%, transparent);
}

.ats-campaign-btn.is-active svg {
  color: #fff;
  fill: #fff;
}

/* ============================================
   Promo Banner (inside product grid)
   ============================================ */
.ats-promo-banner {
  grid-column: 1 / -1;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.ats-promo-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ============================================
   Quick Filters Bar
   ============================================ */
#ats-quick-filters-container {
  position: relative;
  z-index: 50;
}

.ats-quick-filters {
  display: flex;
  gap: 8px;
  padding: 6px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ats-quick-filters::-webkit-scrollbar {
  display: none;
}

.ats-qf-dropdown {
  position: relative;
  flex-shrink: 0;
}

button.ats-qf-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--ats-border, #e5e7eb);
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--ats-text, #1f2937);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: unset;
}

button.ats-qf-trigger:hover {
  border-color: var(--ats-text, #1f2937);
}

button.ats-qf-trigger.is-active {
  background: var(--ats-text, #1f2937);
  color: #fff;
  border-color: var(--ats-text, #1f2937);
}

button.ats-qf-trigger svg {
  transition: transform 0.2s ease;
}

.ats-qf-dropdown.is-open button.ats-qf-trigger svg {
  transform: rotate(180deg);
}

.ats-qf-count {
  background: #fff;
  color: var(--ats-text, #1f2937);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}

.ats-qf-panel {
  display: none;
  position: fixed;
  left: 0 !important;
  right: 0;
  width: 100%;
  max-height: 50vh;
  background: #fff;
  border-top: 1px solid var(--ats-border, #e5e7eb);
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 999999;
  overflow: hidden;
}

.ats-qf-dropdown.is-open .ats-qf-panel,
.ats-qf-panel.is-open {
  display: block;
}

#ats-products-grid.is-dimmed {
  position: relative;
}

#ats-products-grid.is-dimmed::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -20px;
  right: -20px;
  background: rgba(0, 0, 0, 0.35);
  z-index: 5;
  pointer-events: none;
}

.ats-qf-options {
  overflow-y: auto;
  max-height: 260px;
  padding: 6px;
}

.ats-qf-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ats-text, #1f2937);
  transition: background 0.1s ease;
}

.ats-qf-option:hover {
  background: var(--ats-bg-hover, #f3f4f6);
}

.ats-qf-option.is-selected {
  background: var(--ats-bg-hover, #f3f4f6);
  font-weight: 600;
}

.ats-qf-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ats-text, #1f2937);
  cursor: pointer;
  flex-shrink: 0;
}

.ats-qf-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ats-qf-option-count {
  font-size: 11px;
  color: var(--ats-text-muted, #9ca3af);
  flex-shrink: 0;
}

/* ============================================
   Products Grid
   ============================================ */
.ats-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.ats-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ats-text);
  background: #fff;
  /* border: 1px solid var(--ats-border); */
  border: 1px solid rgb(243 244 246);
  border-radius: 12px;
  overflow: hidden;
  transition:
    box-shadow var(--ats-transition),
    transform var(--ats-transition);
}

.ats-product-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.ats-product-image-box {
  aspect-ratio: 1;
  margin: 8px;
  background-color: #f9fafb;
  /* gray-50 */
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border-radius: 8px;
  position: relative;
  overflow: visible;
  border: 12px solid rgb(249 250 251);
}

.ats-badge-stack {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.ats-season-badge,
.ats-snow-badge,
.ats-ice-badge,
.ats-fuel-badge,
.ats-noise-badge {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.ats-snow-badge:hover .ats-season-tooltip,
.ats-ice-badge:hover .ats-season-tooltip,
.ats-fuel-badge:hover .ats-season-tooltip,
.ats-noise-badge:hover .ats-season-tooltip,
.ats-season-badge.is-active .ats-season-tooltip,
.ats-snow-badge.is-active .ats-season-tooltip,
.ats-ice-badge.is-active .ats-season-tooltip,
.ats-fuel-badge.is-active .ats-season-tooltip,
.ats-noise-badge.is-active .ats-season-tooltip {
  opacity: 1;
}

.ats-season-tooltip {
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--ats-text, #1f2937);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
}
.ats-season-tooltip::before {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-left-color: var(--ats-text, #1f2937);
}

.ats-season-badge:hover .ats-season-tooltip {
  opacity: 1;
}

.ats-sale-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 60px;
  height: auto;
  z-index: 2;
  pointer-events: none;
}

.ats-product-price-old-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: -2px;
}

.ats-discount-badge {
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.3;
  white-space: nowrap;
}

.ats-bestseller-badge {
  display: none; /* gecici kapali daha guzelini yapana kadar*/
  position: absolute;
  bottom: 0;
  left: 0;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  padding: 6px 8px;
  border-radius: 0 8px 0 0;
  z-index: 2;
  letter-spacing: 0.3px;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.12);
}

.ats-product-details {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ats-product-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: #111;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* Can be set to 1 but 2 is safer */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Flip Badge - Trendyol style rotating text */
.ats-flip-badge {
  --ats-flip-speed: 2.5s; /* Duration per message — adjustable here */
  height: 18px;
  overflow: hidden;
  position: relative;
  margin-top: 6px;
}

.ats-modal:not(.is-open) .ats-flip-inner,
.ats-modal:not(.is-open) .ats-skeleton-box,
.ats-modal:not(.is-open) .ats-skeleton-line,
.ats-modal:not(.is-open) .ats-spinner-brand {
  animation-play-state: paused;
}

.ats-flip-inner {
  animation: atsFlip2 calc(var(--ats-flip-speed) * 2) infinite;
}

.ats-flip-badge[style*="--ats-flip-count:3"] .ats-flip-inner {
  animation: atsFlip3 calc(var(--ats-flip-speed) * 3) infinite;
}

.ats-flip-badge[style*="--ats-flip-count:4"] .ats-flip-inner {
  animation: atsFlip4 calc(var(--ats-flip-speed) * 4) infinite;
}

.ats-flip-badge[style*="--ats-flip-count:5"] .ats-flip-inner {
  animation: atsFlip5 calc(var(--ats-flip-speed) * 5) infinite;
}

.ats-flip-badge[style*="--ats-flip-count:6"] .ats-flip-inner {
  animation: atsFlip6 calc(var(--ats-flip-speed) * 6) infinite;
}

.ats-flip-item {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  line-height: 18px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ats-flip-icon {
  flex-shrink: 0;
}

.ats-flip-sale {
  color: #dc2626;
}

.ats-flip-review {
  color: #f59e0b;
}

.ats-flip-top {
  color: #16a34a;
}

.ats-flip-cargo {
  color: #2563eb;
}

.ats-flip-custom {
  color: #7c3aed;
}

.ats-flip-rank {
  color: #ea580c;
}

@keyframes atsFlip2 {
  0%,
  40% {
    transform: translateY(0);
  }
  50%,
  97% {
    transform: translateY(-18px);
  }
  100% {
    transform: translateY(-36px);
  }
}

@keyframes atsFlip3 {
  0%,
  27% {
    transform: translateY(0);
  }
  33%,
  60% {
    transform: translateY(-18px);
  }
  66%,
  97% {
    transform: translateY(-36px);
  }
  100% {
    transform: translateY(-54px);
  }
}

@keyframes atsFlip4 {
  0%,
  20% {
    transform: translateY(0);
  }
  25%,
  45% {
    transform: translateY(-18px);
  }
  50%,
  70% {
    transform: translateY(-36px);
  }
  75%,
  97% {
    transform: translateY(-54px);
  }
  100% {
    transform: translateY(-72px);
  }
}

@keyframes atsFlip5 {
  0%,
  16% {
    transform: translateY(0);
  }
  20%,
  36% {
    transform: translateY(-18px);
  }
  40%,
  56% {
    transform: translateY(-36px);
  }
  60%,
  76% {
    transform: translateY(-54px);
  }
  80%,
  97% {
    transform: translateY(-72px);
  }
  100% {
    transform: translateY(-90px);
  }
}

@keyframes atsFlip6 {
  0%,
  13% {
    transform: translateY(0);
  }
  16.6%,
  30% {
    transform: translateY(-18px);
  }
  33.3%,
  46% {
    transform: translateY(-36px);
  }
  50%,
  63% {
    transform: translateY(-54px);
  }
  66.6%,
  80% {
    transform: translateY(-72px);
  }
  83.3%,
  97% {
    transform: translateY(-90px);
  }
  100% {
    transform: translateY(-108px);
  }
}

.ats-product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.ats-rating-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--ats-text);
}

.ats-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
}

.ats-stars svg {
  display: block;
}

.ats-rating-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--ats-text-muted);
}

.ats-product-bottom {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.ats-product-price-wrapper {
  display: flex;
  flex-direction: column;
}

.ats-product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--ats-primary);
}

.ats-product-price.is-sale {
  color: var(--ats-primary);
}

.ats-product-price-regular {
  font-size: 11px;
  color: var(--ats-text-light);
  text-decoration: line-through;
}

.ats-stock-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #3bae65d9;
  white-space: nowrap;
}

button.ats-add-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition:
    background 0.2s,
    transform 0.1s;
  padding: 0;
  min-height: unset;
}

button.ats-add-btn:hover {
  background: #374151;
  color: #fff;
}

button.ats-add-btn:active {
  transform: scale(0.92);
}

/* ============================================
   Skeleton Loader
   ============================================ */
@keyframes ats-skeleton-pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
    /* More pronounced pulse */
  }

  100% {
    opacity: 1;
  }
}

.ats-skeleton {
  pointer-events: none;
}

.ats-skeleton .ats-product-image-box {
  background: var(--ats-bg-light);
}

.ats-skeleton-box {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
  /* Darker grays */
  background-size: 200% 100%;
  animation: ats-skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--ats-radius);
}

.ats-skeleton-line {
  height: 12px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-bottom: 6px;
  animation: ats-skeleton-pulse 1.5s ease-in-out infinite;
}

.ats-skeleton-line.short {
  width: 40%;
}

.ats-skeleton-line.medium {
  width: 70%;
}

.ats-facet-skeleton {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ats-border);
}

.ats-facet-skeleton:last-child {
  border-bottom: none;
}

.ats-skeleton-facet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

/* ============================================
   No Results / Loading / Error
   ============================================ */
.ats-no-results,
.ats-loading,
.ats-error {
  text-align: center;
  padding: 60px 20px;
  color: var(--ats-text-muted);
  font-size: 16px;
}

.ats-error {
  color: var(--ats-primary);
}

.ats-no-results-banner {
  text-align: center;
  padding: 20px;
  margin-bottom: 12px;
  color: var(--ats-text-muted);
  font-size: 15px;
  background: var(--ats-bg-secondary, #f5f5f5);
  border-radius: 8px;
}

.ats-no-results-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  text-align: center;
}

.ats-no-results-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ats-text);
  margin: 16px 0 0;
}

.ats-no-results-subtitle {
  font-size: 13px;
  color: var(--ats-text-muted);
  margin: 8px 0 0;
}

.ats-no-results-tips {
  margin-top: 16px;
  color: var(--ats-text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.ats-no-results-tips ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.ats-no-results-tips li::before {
  content: "•";
  margin-right: 6px;
  color: var(--ats-primary, #2563eb);
}

.ats-no-results-suggestions {
  margin-top: 24px;
}

.ats-no-results-suggestions-label {
  font-size: 13px;
  color: var(--ats-text-muted);
  font-weight: 500;
}

.ats-no-results-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

button.ats-suggestion-term {
  background: #fff;
  border: 1px solid var(--ats-border);
  color: var(--ats-text);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

button.ats-suggestion-term:hover {
  border-color: var(--ats-primary, #2563eb);
  color: var(--ats-primary, #2563eb);
  background: rgba(37, 99, 235, 0.04);
}

/* ============================================
   Showcase / Vitrine
   ============================================ */

/* Promo Banners — matches Tailwind reference exactly */
.ats-promo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.ats-promo-card {
  position: relative;
  height: 256px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.ats-promo-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s ease;
}

.ats-promo-card:hover .ats-promo-bg {
  transform: scale(1.1);
}

.ats-promo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.8),
    rgba(0, 0, 0, 0.2),
    transparent
  );
}

.ats-promo-content {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 66%;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ats-promo-tag {
  display: inline-block;
  width: fit-content;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 16px;
  color: #fff;
}

.ats-promo-tag--red {
  background: var(--ats-primary, #e31e24);
}

.ats-promo-tag--blue {
  background: #2563eb;
}

.ats-promo-title {
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 8px;
}

.ats-promo-desc {
  line-height: 1.4;
  margin: 0 0 24px;
  max-width: 218px;
  color: #dddddd;
  font-size: 13px;
}

button.ats-promo-btn {
  display: inline-block;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  min-height: unset;
}

button.ats-promo-btn--white {
  background: #fff;
  color: #000;
}

button.ats-promo-btn--white:hover {
  background: var(--ats-primary, #e31e24);
  color: #fff;
}

button.ats-promo-btn--primary {
  background: var(--ats-primary, #e31e24);
  color: #fff;
}

button.ats-promo-btn--primary:hover {
  background: #fff;
  color: #000;
}

@media (max-width: 768px) {
  .ats-promo-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 24px;
  }

  .ats-promo-card {
    height: 220px;
  }

  .ats-promo-title {
    font-size: 25px;
  }

  .ats-promo-content {
    width: 75%;
    padding: 24px;
  }

  .ats-promo-desc {
    margin-bottom: 16px;
  }
}

.ats-showcase-popular {
  /* padding: 0 16px; */
  margin-bottom: 10px;
}

.ats-showcase-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ats-text);
  margin: 0 0 6px;
}

.ats-popular-list-wrap {
  position: relative;
}

.ats-popular-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ats-popular-list::-webkit-scrollbar {
  display: none;
}

.ats-popular-fade {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: linear-gradient(to right, transparent, var(--ats-bg) 70%);
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding-right: 2px;
}

.ats-popular-fade svg {
  color: #9ca3af;
}

.ats-popular-fade.is-hidden {
  opacity: 0;
}

button.ats-popular-term {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--ats-text);
  text-align: left;
  border-radius: var(--ats-radius);
  transition: background var(--ats-transition);
  background: #e2e2e2;
  white-space: nowrap;
  border-radius: 6px;
  min-height: unset;
  text-transform: unset;
}

button.ats-popular-term:hover {
  background: #cecece;
}

button.ats-popular-term svg {
  flex-shrink: 0;
  color: var(--ats-text-light);
}

/* ============================================
   Showcase Carousel
   ============================================ */
.ats-showcase-carousel {
  margin-bottom: 28px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--ats-border);
}

.ats-showcase-carousel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ats-carousel-title-block {
  flex: 1;
  min-width: 0;
}

.ats-showcase-carousel-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ats-text);
  margin: 0;
  line-height: 1.3;
  border-left: 3px solid #dc2626;
  padding-left: 10px;
}

.ats-showcase-carousel-subtitle {
  font-size: 13px;
  color: var(--ats-text-light);
  margin: 4px 0 0 0;
  padding-left: 13px;
}

/* Carousel Tabs */
.ats-carousel-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 3px;
  background: #f1f3f5;
  border-radius: 10px;
}

button.ats-carousel-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: unset;
  line-height: 1;
  letter-spacing: 0.01em;
}

button.ats-carousel-tab:hover {
  color: #374151;
  background: rgba(0, 0, 0, 0.04);
}

button.ats-carousel-tab.is-active {
  background: #fff;
  color: #dc2626;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.06);
}

button.ats-carousel-tab.is-active svg {
  stroke: #dc2626;
  fill: none;
}

button.ats-carousel-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

button.ats-carousel-tab.is-active svg {
  opacity: 1;
}

/* Carousel Panels */
.ats-carousel-panel {
  display: none;
}

.ats-carousel-panel.is-active {
  display: block;
}

.ats-carousel-nav {
  display: flex;
  gap: 6px;
}

.ats-carousel-btn {
  width: 32px;
  height: 32px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--ats-bg-light) !important;
  border: 1px solid var(--ats-border) !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  color: var(--ats-text) !important;
  transition: all var(--ats-transition) !important;
  padding: 0 !important;
  min-height: unset !important;
}

.ats-carousel-btn:hover {
  background: var(--ats-bg) !important;
  border-color: var(--ats-text) !important;
}

.ats-carousel-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.ats-carousel-track::-webkit-scrollbar {
  display: none;
}

.ats-carousel-track > .ats-product-card {
  flex-shrink: 0;
  width: calc((100% - (5 * 12px)) / 6);
  scroll-snap-align: start;
}

.ats-carousel-loading .ats-carousel-track {
  overflow: hidden;
}

.ats-carousel-loading .ats-product-card.ats-skeleton {
  pointer-events: none;
}

@media (max-width: 1100px) {
  .ats-carousel-track > .ats-product-card {
    width: calc((100% - (3 * 12px)) / 4);
  }
}

@media (max-width: 768px) {
  .ats-carousel-track > .ats-product-card {
    width: calc((100% - 12px) / 2.3);
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .ats-season-tooltip {
    font-size: 9px;
  }

  .ats-modal-header {
    padding: 12px 16px;
    gap: 12px;
    border-bottom: unset;
  }

  .ats-modal-logo {
    display: none;
  }

  .ats-modal-body {
    flex-direction: column;
  }

  .ats-modal-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--ats-border);
    max-height: 200px;
  }

  .ats-modal-main {
    padding: 0 16px 16px;
    margin-top: -5px;
  }

  /* Sticky bar: promo icons + quick filters stick on scroll */
  .ats-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--ats-bg, #fff);
    margin: -16px -16px 30px;
    padding: 8px 16px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  }

  .ats-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .ats-carousel-track {
    gap: 12px;
  }

  .ats-carousel-item {
    width: calc(50% - 6px);
  }

  /* Mobile: Hide results header entirely — sort/filter moved to promo bar & sidebar */
  .ats-results-header {
    display: none !important;
  }

  /* Hide desktop sort dropdown on mobile — sort is in sidebar */
  .ats-sort-wrapper {
    display: none !important;
  }

  .ats-query-tags {
    display: none;
  }

  /* Mobile Sidebar (Drawer) */
  .ats-modal-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 91vh;
    background: #fff;
    z-index: 200;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 91vh;
  }

  /* Drag Handle Visual */
  .ats-modal-sidebar::before {
    content: "";
    display: block;
    width: 48px;
    height: 5px;
    background: var(--ats-border);
    border-radius: 100px;
    margin: 12px auto 8px auto;
    flex-shrink: 0;
  }

  .ats-modal-sidebar.is-open {
    transform: translateY(0);
  }

  .ats-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px 16px 24px;
    border-bottom: 1px solid var(--ats-border);
    flex-shrink: 0;
  }

  .ats-sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ats-text);
    margin: 0;
    letter-spacing: -0.02em;
  }

  button.ats-sidebar-close {
    background: var(--ats-bg-light);
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ats-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  .ats-sidebar-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
  }

  .ats-sidebar-footer {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--ats-border);
    background: #fff;
    flex-shrink: 0;
  }

  button.ats-apply-btn {
    width: 100%;
    padding: 14px;
    background: var(--ats-primary, #e31e24);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
  }

  button.ats-apply-btn:active {
    opacity: 0.9;
  }

  /* Override previous sidebar settings if any */
  .ats-modal-sidebar .ats-facet-group {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--ats-border);
    padding-bottom: 20px;
  }

  .ats-modal-sidebar .ats-facet-group:last-child {
    border-bottom: none;
  }

  /* Mobile Accordion Facets (Open Default) */
  .ats-facet-options {
    display: block;
    margin-top: 12px;
  }

  .ats-facet-group.is-active .ats-facet-options,
  .ats-facet-group.is-active .ats-facet-search {
    display: none;
  }

  /* Mobile Toggle Icon Rotation */
  .ats-facet-group.is-active .ats-facet-toggle svg {
    transform: rotate(-90deg);
  }

  /* Reset Desktop Rotation Rule for Mobile */
  .ats-facet-group:not(.is-active) .ats-facet-toggle svg {
    transform: rotate(0);
  }
}

/* Desktop Styles */
@media (min-width: 769px) {
  .ats-results-header {
    display: none !important;
  }

  .ats-results-actions {
    display: none !important;
  }

  .ats-sort-sheet {
    display: none !important;
  }

  #ats-quick-filters-container {
    display: none !important;
  }

  /* Hide sidebar sort on desktop — it's only for mobile */
  .ats-sidebar-sort {
    display: none !important;
  }

  .ats-sidebar-header,
  .ats-sidebar-footer {
    display: none;
  }

  .ats-sidebar-content {
    display: contents;
  }

  /* Desktop Accordion Logic */
  .ats-facet-group.is-active .ats-facet-options,
  .ats-facet-group.is-active .ats-facet-search {
    display: none;
  }

  .ats-facet-group.is-active .ats-facet-toggle svg {
    transform: rotate(-90deg);
  }
}

@keyframes ats-slide-down {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Zoll Facet Grid */
.ats-facet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 0;
}

button.ats-facet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  background: transparent;
  border: 1px solid var(--ats-border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ats-text);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: unset;
}

button.ats-facet-btn:hover {
  border-color: var(--ats-primary);
  color: #fff;
  background: var(--ats-primary);
}

button.ats-facet-btn.is-selected {
  background: var(--ats-primary);
  border-color: var(--ats-primary);
  color: #fff;
}

/* Dark mode overrides for facet buttons */
[data-theme="dark"] .ats-facet-btn {
  border-color: #334155;
}

[data-theme="dark"] .ats-facet-btn:hover {
  border-color: var(--ats-primary);
}

/* Price Segmented Buttons Styles */
.ats-facet-grid.price-grid {
  display: grid;
  /* grid-template-columns: 1fr; */
  /* Single column for more readable price ranges */
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px 0;
}

@media (min-width: 1024px) {
  .ats-facet-grid.price-grid {
    grid-template-columns: 1fr;
  }
}

/* Range Slider */
.ats-range-slider-wrap {
  padding: 8px 4px 12px;
}

.ats-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--ats-text, #1f2937);
  margin-top: 4px;
}

.ats-range-track-wrap {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
}

.ats-range-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 20px;
  margin-top: -8px;
  margin-bottom: -8px;
  background: transparent;
  cursor: pointer;
}

.ats-range-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
}

.ats-range-fill {
  position: absolute;
  height: 4px;
  background: var(--ats-primary, #e31e24);
  border-radius: 2px;
  pointer-events: none;
}

.ats-range-input {
  position: absolute;
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

.ats-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ats-primary, #e31e24);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  pointer-events: all;
  position: relative;
  z-index: 2;
}

.ats-range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ats-primary, #e31e24);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  pointer-events: all;
}

.ats-range-input::-webkit-slider-thumb:hover {
  background: #fef2f2;
  transform: scale(1.15);
}

.ats-range-input::-moz-range-thumb:hover {
  background: #fef2f2;
  transform: scale(1.15);
}

.ats-range-input::-webkit-slider-thumb:active {
  background: #fee2e2;
  box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.15);
}

.ats-range-input::-moz-range-thumb:active {
  background: #fee2e2;
  box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.15);
}

/* Ensure max handle is above min handle */
.ats-range-input-max {
  z-index: 3;
}

.ats-range-reset {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
  color: #b91c1c;
  background: #fff1f2;
  border: 1px solid #fecaca;
  border-radius: var(--ats-radius, 8px);
  cursor: pointer;
}

.ats-range-reset:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* not needed for now, may be used later */
.ats-facet-group[data-facet="car_keys"] {
  display: none !important;
}
