/**
 * Lenik Meilisearch Module - CSS Variables
 *
 * This file contains CSS variables that can be set by JavaScript based on user configuration.
 */

:root {
  /* Mobile Products Per Row */
  --lenik-mobile-products-per-row: 2; /* Default: 2 */
  --lenik-mobile-grid-template-columns: repeat(2, 1fr); /* Default: 2 columns */
  --lenik-mobile-grid-gap: 12px; /* Default gap */

  /* Dropdown Products Per Row */
  --lenik-dropdown-products-per-row: 4; /* Default: 4 */
  --lenik-dropdown-grid-template-columns: repeat(4, 1fr); /* Default: 4 columns */

  /* Product Display */
  --lenik-product-card-bg-color: #ffffff;
  --lenik-product-card-border: 1px solid #eee;
  --lenik-product-name-color: #232323;
  --lenik-product-name-font-size: 14px;
  --lenik-product-name-line-height: 1.5;
  --lenik-product-name-truncate: clip; /* ellipsis or clip */
  --lenik-product-name-white-space: normal; /* nowrap or normal */
  --lenik-product-name-overflow: visible; /* hidden or visible */
  --lenik-product-price-color: #2fb5d2;
  --lenik-product-price-font-size: 16px;
  
  /* Indexed Data */
  --lenik-indexed-data-color: #7a7a7a;
  --lenik-indexed-data-font-size: 14px;
  
  /* Mobile Category Display */
  --lenik-mobile-category-width: auto; /* auto or 100% */
  --lenik-mobile-category-padding: 0 50px; /* Default padding with space for arrows */
  --lenik-mobile-category-order: 1; /* 1 for top, 2 for bottom */
  --lenik-mobile-category-image-display: block; /* block or none */
  --lenik-mobile-category-item-padding: 0; /* Default padding */
  --lenik-mobile-category-item-min-width: 120px; /* Default min-width */
  --lenik-mobile-category-scroll-indicator: none; /* none or block */

  /* Reviews/Stars Styling */
  --lenik-star-color: #FFD700; /* Yellow/gold for filled stars */
  --lenik-star-size: 16px; /* Star font size */
  --lenik-review-count-color: #7a7a7a; /* Review count color */

  /* Discount/Reduction Styling */
  --lenik-discount-badge-bg-color: #ff7043; /* Reduction badge background color */
  --lenik-discount-badge-text-color: #ffffff; /* Reduction badge text color */
  --lenik-discount-price-color: #d9534f; /* Discounted price color */
  --lenik-original-price-color: #999999; /* Original price (crossed out) color */
}

/**
 * Lenik Meilisearch Module - Base CSS
 *
 * This file contains base styles that don't change based on user configuration.
 */

/* CSS Reset for module elements to prevent conflicts */
.lenik-meilisearch-search-box,
.lenik-meilisearch-search-box * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Prevent body scrolling when overlay is open */
body.lenik-meilisearch-search-overlay-open {
  overflow: hidden;
}

/* Animation keyframes */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/**
 * Lenik Meilisearch Module - Search Box Component CSS
 */

/* Search Box */
.lenik-meilisearch-search-box {
  position: relative;
  margin: 0;
  padding: 0;
  width: auto;
  height: auto;
  display: block;
  clear: both;
}

/* Positioning classes */
.lenik-meilisearch-search-box.position-left {
  margin-right: auto !important;
  margin-left: 0 !important;
  text-align: left !important;
}

.lenik-meilisearch-search-box.position-center {
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}

.lenik-meilisearch-search-box.position-right {
  margin-left: auto !important;
  margin-right: 0 !important;
  text-align: right !important;
}

.lenik-meilisearch-search-form {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  width: 100%;
  position: relative;
}

/* Button position styles */
.lenik-meilisearch-search-form.button-position-right {
  flex-direction: row;
}

.lenik-meilisearch-search-form.button-position-left {
  flex-direction: row-reverse;
}

.lenik-meilisearch-search-form.button-position-center .lenik-meilisearch-search-button {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  border-radius: 50% !important;
}

.lenik-meilisearch-search-form.button-position-none .lenik-meilisearch-search-button {
  display: none;
}

.lenik-meilisearch-search-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
  margin: 0;
  height: auto;
  min-height: 0;
  width: auto;
}

/* Adjust input border radius based on button position */
.lenik-meilisearch-search-form.button-position-right .lenik-meilisearch-search-input {
  border-radius: 4px 0 0 4px;
}

.lenik-meilisearch-search-form.button-position-left .lenik-meilisearch-search-input {
  border-radius: 0 4px 4px 0;
}

.lenik-meilisearch-search-form.button-position-center .lenik-meilisearch-search-input,
.lenik-meilisearch-search-form.button-position-none .lenik-meilisearch-search-input {
  border-radius: 4px;
}

.lenik-meilisearch-search-input:focus {
  border-color: #2fb5d2;
}

.lenik-meilisearch-search-input::placeholder {
  color: #999;
  opacity: 1;
}

.lenik-meilisearch-search-button {
  padding: 10px 15px;
  background-color: #2fb5d2;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
  margin: 0;
  height: auto;
  min-height: 0;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box !important;
}

/* Override any theme styles that might interfere with our button styling */
.lenik-meilisearch-search-button.btn,
.lenik-meilisearch-search-button[type="submit"] {
  padding: 10px 15px !important;
  line-height: normal !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-weight: normal !important;
}

/* Adjust button border radius based on position - these are fallbacks */
.lenik-meilisearch-search-form.button-position-right .lenik-meilisearch-search-button {
  border-radius: 0 4px 4px 0 !important;
}

.lenik-meilisearch-search-form.button-position-left .lenik-meilisearch-search-button {
  border-radius: 4px 0 0 4px !important;
}

/* Ensure button dimensions are respected */
.lenik-meilisearch-search-button {
  min-width: 40px !important;
  min-height: 40px !important;
}

.lenik-meilisearch-search-button:hover {
  background-color: #1e94ab;
}

.lenik-meilisearch-search-button i {
  font-size: 18px;
}

/* Autocomplete */
.lenik-meilisearch-autocomplete-results {
  position: fixed;
  /* top will be set dynamically in JavaScript based on search input position */
  width: var(--lenik-dropdown-width, 90vw);
  left: 50%;
  transform: translateX(-50%);
  max-width: 1400px;
  height: 700px;
  min-height: 400px;
  z-index: 1000;
  background-color: var(--lenik-dropdown-bg-color, white);
  border: 1px solid var(--lenik-dropdown-border-color, #ddd);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  display: none;
}

/* Close button for dropdown (now in top header) */
.lenik-meilisearch-dropdown-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 28px;
  color: #666;
  line-height: 32px;
  padding: 0;
  transition: all 0.2s ease;
  pointer-events: auto;
  outline: none;
  flex-shrink: 0;
  text-align: center;
  user-select: none;
}

.lenik-meilisearch-dropdown-close:hover {
  color: #000;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  transform: scale(1.1);
}

.lenik-meilisearch-dropdown-close:active {
  transform: scale(0.95);
}

/* Top header row for dropdown mode */
.autocomplete-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--lenik-dropdown-border-color, #e0e0e0);
  background-color: var(--lenik-dropdown-header-bg-color, #f8f8f8);
  gap: 20px;
}

.autocomplete-filters-title {
  font-size: 14px;
  font-weight: 600;
  color: #232323;
  flex: 0 0 25%; /* Match left pane width */
}

.autocomplete-right-header {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

/* Sort dropdown */
.autocomplete-sort-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
}

.autocomplete-sort-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  margin: 0;
}

.autocomplete-sort-select {
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.autocomplete-sort-select:hover {
  border-color: var(--lenik-dropdown-accent-color, #2fb5d2);
}

.autocomplete-sort-select:focus {
  border-color: var(--lenik-dropdown-accent-color, #2fb5d2);
  box-shadow: 0 0 0 3px rgba(47, 181, 210, 0.1);
}

/* Dropdown mode: two-pane layout (3:9 ratio = 25%:75%) */
.lenik-meilisearch-autocomplete-results.dropdown-mode {
  display: flex !important;
  flex-direction: column;
  padding: 0;
}

.autocomplete-panes-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 20px;
  flex: 1;
  overflow: hidden;
}

.lenik-meilisearch-autocomplete-results.dropdown-mode .autocomplete-filters {
  flex: 0 0 25%;
  border-right: 1px solid var(--lenik-dropdown-filter-border-color, #e0e0e0);
  padding: 20px;
  padding-right: 20px;
  min-width: 200px;
  overflow-y: auto;
  background-color: var(--lenik-dropdown-filter-bg-color, #f9f9f9);
  margin: -20px 0 -20px -20px;
}

.lenik-meilisearch-autocomplete-results.dropdown-mode .autocomplete-results-area {
  flex: 1;
  overflow-y: auto;
}

/* Filter Sections */
.autocomplete-filter-section {
  margin-bottom: 20px;
}

.autocomplete-filter-title {
  font-size: 13px;
  font-weight: 600;
  color: #232323;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.autocomplete-filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.autocomplete-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: color 0.2s;
}

.autocomplete-filter-item:hover {
  color: #232323;
}

.autocomplete-filter-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.autocomplete-filter-item span {
  flex: 1;
  line-height: 1.4;
}

/* Show More / Show Less Toggle Button */
.autocomplete-filter-toggle {
  margin-top: 8px;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--lenik-primary-color, #2fb5d2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.autocomplete-filter-toggle:hover {
  color: var(--lenik-primary-color-dark, #1a8fa3);
  text-decoration: underline;
}

.autocomplete-filter-toggle .toggle-icon {
  font-weight: bold;
  font-size: 14px;
}

/* Price Range Slider */
.autocomplete-price-slider {
  padding: 30px 8px 25px 8px;
  position: relative;
  height: 90px;
}

.autocomplete-price-input {
  position: absolute;
  width: calc(100% - 16px);
  left: 8px;
  height: 10px;
  top: 35px;
  border-radius: 10px;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  margin: 0;
}

/* Track styling - WebKit */
.autocomplete-price-input::-webkit-slider-runnable-track {
  width: 100%;
  height: 10px;
  background: #d8d8d8;
  border-radius: 10px;
}

/* Track styling - Firefox */
.autocomplete-price-input::-moz-range-track {
  width: 100%;
  height: 10px;
  background: #d8d8d8;
  border-radius: 10px;
  border: none;
}

/* Thumb styling - WebKit */
.autocomplete-price-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 28px;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  border: 2px solid #d8d8d8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  margin-top: -9px;
  position: relative;
  z-index: 2;
  transition: all 0.15s ease;
}

/* Thumb styling - Firefox */
.autocomplete-price-input::-moz-range-thumb {
  width: 20px;
  height: 28px;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  border: 2px solid #d8d8d8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  position: relative;
  z-index: 2;
  transition: all 0.15s ease;
}

/* Hover effects */
.autocomplete-price-input::-webkit-slider-thumb:hover {
  border-color: #aaa;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  background: #ffffff;
}

.autocomplete-price-input::-moz-range-thumb:hover {
  border-color: #aaa;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  background: #ffffff;
}

/* Active/pressed state */
.autocomplete-price-input::-webkit-slider-thumb:active {
  border-color: #888;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  background: #ffffff;
}

.autocomplete-price-input::-moz-range-thumb:active {
  border-color: #888;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  background: #ffffff;
}

/* Min slider (below) - force white background */
.autocomplete-price-input#autocomplete-price-min {
  z-index: 1;
}

.autocomplete-price-input#autocomplete-price-min::-webkit-slider-thumb {
  background: #ffffff !important;
}

.autocomplete-price-input#autocomplete-price-min::-moz-range-thumb {
  background: #ffffff !important;
}

/* Max slider (above) - force white background */
.autocomplete-price-input#autocomplete-price-max {
  z-index: 3;
}

.autocomplete-price-input#autocomplete-price-max::-webkit-slider-thumb {
  background: #ffffff !important;
}

.autocomplete-price-input#autocomplete-price-max::-moz-range-thumb {
  background: #ffffff !important;
}

.autocomplete-price-labels {
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

.autocomplete-price-labels span {
  padding: 3px 10px;
  background: #f5f5f5;
  border-radius: 4px;
  border: 1px solid #e8e8e8;
}

/* View Toggle Header */
.autocomplete-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.autocomplete-results-count {
  font-size: 14px;
  color: #666;
}

.autocomplete-view-toggle {
  display: flex;
  gap: 5px;
}

.autocomplete-view-btn {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.autocomplete-view-btn:hover {
  background: #e8e8e8;
}

.autocomplete-view-btn.active {
  background: var(--lenik-dropdown-accent-color, #2fb5d2);
  border-color: var(--lenik-dropdown-accent-color, #2fb5d2);
  color: white;
}

.autocomplete-view-btn svg {
  width: 16px;
  height: 16px;
}

/* Exact Match Checkbox for Dropdown */
.autocomplete-exact-match-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.autocomplete-exact-match-container:hover {
  border-color: #2a9d8f;
  background: #f9f9f9;
}

.autocomplete-exact-match-checkbox {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #2a9d8f;
  margin: 0;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
}

.autocomplete-exact-match-label {
  cursor: pointer;
  user-select: none;
  color: #333;
  font-size: 12px;
  font-weight: 400;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.autocomplete-exact-match-label .exact-match-icon {
  display: inline-block;
  font-weight: 600;
  font-size: 11px;
  color: #2a9d8f;
  opacity: 0.8;
}

/* Grid View */
.autocomplete-products-grid {
  display: grid;
  grid-template-columns: var(--lenik-dropdown-grid-template-columns, repeat(4, 1fr));
  gap: 16px;
  padding: 10px 0;
}

.autocomplete-product-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}

.autocomplete-product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.autocomplete-product-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.autocomplete-product-image {
  position: relative; /* For stock badge positioning */
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f8f8f8;
}

.autocomplete-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.autocomplete-product-info {
  padding: 12px;
}

.autocomplete-product-name {
  font-size: 14px;
  font-weight: 500;
  color: #232323;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.autocomplete-product-price {
  font-size: 16px;
  font-weight: 600;
  color: #2fb5d2;
}

/* List View */
.autocomplete-products-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}

.autocomplete-product-list-item {
  display: flex;
  gap: 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 10px;
  transition: all 0.2s;
}

.autocomplete-product-list-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.autocomplete-product-list-item .autocomplete-product-link {
  display: flex;
  gap: 12px;
  width: 100%;
}

.autocomplete-product-list-item .autocomplete-product-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  aspect-ratio: 1;
  border-radius: 4px;
}

.autocomplete-product-list-item .autocomplete-product-info {
  flex: 1;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.autocomplete-product-list-item .autocomplete-product-name {
  -webkit-line-clamp: 1;
}

/* View All Link */
.autocomplete-view-all-link {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  text-align: right;
}

.autocomplete-view-all-btn {
  display: inline-block;
  padding: 6px 12px;
  color: #2fb5d2;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
}

.autocomplete-view-all-btn:hover {
  color: #27a1bb;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1200px) {
  /* Removed hardcoded grid - uses CSS variable */
}

@media (max-width: 992px) {
  /* Removed hardcoded grid - uses CSS variable */
}

@media (max-width: 768px) {
  .lenik-meilisearch-autocomplete-results {
    width: 95vw !important;
  }

  .lenik-meilisearch-autocomplete-results.dropdown-mode {
    flex-direction: column;
    gap: 15px;
  }

  .lenik-meilisearch-autocomplete-results.dropdown-mode .autocomplete-filters {
    flex: none;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    padding-right: 0;
    padding-bottom: 15px;
  }

  /* Removed hardcoded grid - uses CSS variable */
}

@media (max-width: 480px) {
  /* Removed hardcoded grid - uses CSS variable */
}

.autocomplete-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.autocomplete-item {
  border-bottom: 1px solid #eee;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-link {
  display: flex;
  padding: 10px;
  text-decoration: none;
  color: #232323;
  transition: background-color 0.3s;
}

.autocomplete-link:hover {
  background-color: #f7f7f7;
  text-decoration: none;
}

.autocomplete-image {
  width: 50px;
  height: 50px;
  margin-right: 10px;
  flex-shrink: 0;
}

.autocomplete-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.autocomplete-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.autocomplete-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.autocomplete-price {
  color: #2fb5d2;
}

.autocomplete-view-all {
  background-color: #f7f7f7;
  text-align: center;
}

.autocomplete-view-all-text {
  font-weight: bold;
  padding: 10px;
}

/* No Results Message */
.autocomplete-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #666;
}

.autocomplete-no-results .no-results-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.autocomplete-no-results h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: #333;
}

.autocomplete-no-results p {
  font-size: 14px;
  margin: 0;
  color: #999;
}

/**
 * Lenik Meilisearch Module - Category Display Component CSS (Refactored)
 */

/* Base styles for category container wrapper */
.lenik-meilisearch-category-container-wrapper {
  margin-bottom: 10px;
  position: static;
  background-color: #f8f8f8;
  padding: 5px 5px 5px 5px;
  border-radius: 4px;
  border: 1px solid #eee;
  z-index: auto;
  overflow-x: hidden;
  height: auto;
  display: none; /* Hidden by default, shown when has content */
  box-sizing: border-box; /* Use border-box for more predictable sizing */
}

/* Visible state */
.lenik-meilisearch-category-container-wrapper.visible {
  display: block;
}

/* Ensure minimum content height when categories are present */
.lenik-meilisearch-category-container-wrapper.has-categories {
  min-height: auto; /* Let it expand to fit content */
  height: auto !important; /* Force auto height */
  overflow: visible !important; /* Prevent content from being cut off */
}

/* Ensure scroll wrapper is fully visible */
.lenik-meilisearch-category-scroll-wrapper {
  min-height: 120px; /* Minimum height to show category content properly */
  overflow: visible; /* Allow content to be fully visible */
  padding-bottom: 10px; /* Reduced padding at the bottom */
}

/* Inner container */
.lenik-meilisearch-category-container {
  position: relative;
}

/* Scroll wrapper */
.lenik-meilisearch-category-scroll-wrapper {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  scroll-behavior: smooth;
  padding-bottom: 5px;
  padding-left: 0;
  max-width: 100%;
}

.lenik-meilisearch-category-scroll-wrapper::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Scroll arrows */
.lenik-meilisearch-category-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  font-size: 24px;
}

.lenik-meilisearch-category-scroll-arrow i {
  font-size: 24px;
}

.lenik-meilisearch-category-scroll-left {
  left: 5px;
}

.lenik-meilisearch-category-scroll-right {
  right: 5px;
}

/* Style for category container in full-page mode */
.lenik-meilisearch-search-overlay.full-page .lenik-meilisearch-category-container-wrapper {
  background-color: white;
  margin-top: 10px;
  margin-bottom: 15px;
}

/* Sticky positioning */
.lenik-meilisearch-category-container-wrapper.sticky {
  position: sticky !important;
  top: 0 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
  z-index: 100 !important;
  background-color: white !important;
  display: block !important; /* Always visible when sticky */
}

/* Category items */
.lenik-meilisearch-category-item {
  flex: 0 0 auto;
  margin-right: 15px;
  text-align: center;
  width: 120px;
  cursor: pointer;
  transition: transform 0.2s;
  min-width: 120px;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.lenik-meilisearch-category-item:hover {
  transform: translateY(-5px);
}

/* Selected category styling */
.lenik-meilisearch-category-item.selected .lenik-meilisearch-category-image {
  border-color: #2fb5d2;
  border-width: 3px;
}

.lenik-meilisearch-category-item.selected .lenik-meilisearch-category-name {
  color: #2fb5d2;
  font-weight: bold;
}

/* Category filter info */
.lenik-meilisearch-category-filter-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f0f8ff;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: 14px;
}

.lenik-meilisearch-category-filter-remove {
  background-color: #2fb5d2;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s;
}

.lenik-meilisearch-category-filter-remove:hover {
  background-color: #1e94ab;
}

/* Category image */
.lenik-meilisearch-category-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 10px;
  border: 2px solid #eee;
  transition: border-color 0.3s;
}

.lenik-meilisearch-category-item:hover .lenik-meilisearch-category-image {
  border-color: #2fb5d2;
}

.lenik-meilisearch-category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Show/hide images based on class */
.lenik-meilisearch-category-container-wrapper.show-images .lenik-meilisearch-category-image {
  display: block;
}

/* .lenik-meilisearch-category-container-wrapper.hide-images .lenik-meilisearch-category-image {
  display: none;
} */

.lenik-meilisearch-category-bottom {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Category name and count */
.lenik-meilisearch-category-name {
  font-size: 12px;
  font-weight: bold;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #232323;
  line-height: initial;
}

.lenik-meilisearch-category-count {
  font-size: 11px;
  color: #7a7a7a;
  margin-top: 3px;
}

/* Scroll indicator */
.lenik-meilisearch-category-container-wrapper.show-scroll-indicator .lenik-meilisearch-category-container:after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, #007bff, transparent);
  opacity: 0.7;
}

.lenik-meilisearch-category-container-wrapper.hide-scroll-indicator .lenik-meilisearch-category-container:after {
  display: none;
}

/* Responsive styles */
@media (min-width: 768px) {
  /* Desktop styles */
  .lenik-meilisearch-category-container-wrapper {
    /* Allow positioning based on class, don't force order */
  }
}

@media (max-width: 767px) {
  /* Mobile styles */
  .lenik-meilisearch-category-container-wrapper {
    width: 100% !important; /* Always full width on mobile */
    padding: 10px 0; /* Remove horizontal padding, increase vertical padding */
    overflow-x: hidden; /* Prevent horizontal scrolling on mobile */
    margin-bottom: 0 !important; /* Remove bottom margin */
    border-radius: 0 !important; /* Remove border radius */
    border-left: none !important; /* Remove side borders */
    border-right: none !important; /* Remove side borders */
    border-bottom: none !important; /* Remove bottom border */
  }
  
  /* Position based on class */
  .lenik-meilisearch-category-container-wrapper.position-top {
    order: 1;
    border-bottom: 1px solid #ddd !important; /* Add bottom border for top position */
  }
  
  .lenik-meilisearch-category-container-wrapper.position-bottom {
    order: 3; /* Use 3 to ensure it's after the results */
    border-top: 1px solid #333 !important; /* Add darker top border for bottom position */
    margin-top: 0 !important; /* Remove top margin */
    background-color: #f0f0f0 !important; /* Slightly darker background */
  }
  
  /* Ensure search results are always order 2 */
  .lenik-meilisearch-search-overlay-results {
    order: 2;
    margin-bottom: 0 !important; /* Remove bottom margin */
  }
  
  /* Sticky positioning for bottom position */
  .lenik-meilisearch-category-container-wrapper.sticky.position-bottom {
    position: sticky !important;
    bottom: 0 !important;
    top: auto !important;
  }
  
  .lenik-meilisearch-category-container {
    padding: 0 !important; /* Remove padding to maximize space */
  }
  
  /* Hide scroll arrows on mobile */
  .lenik-meilisearch-category-scroll-arrow {
    display: none !important;
  }
  
  /* Make category items slightly wider */
  .lenik-meilisearch-category-item {
    width: 100px;
    min-width: 100px; /* Ensure minimum width */
  }
  
  /* Show a bit of the next category to indicate scrolling */
  .lenik-meilisearch-category-scroll-wrapper {
    padding-right: 20px; /* Show a bit of the next category */
    margin-right: -20px; /* Compensate for the padding */
    padding-left: 0 !important; /* Remove left padding */
    padding-bottom: 5px !important; /* Reduce bottom padding */
  }
  
  .lenik-meilisearch-category-image {
    width: 70px;
    height: 70px;
  }
}

@media (max-width: 480px) {
  .lenik-meilisearch-category-item {
    width: 80px;
    margin-right: 10px;
  }
  
  .lenik-meilisearch-category-image {
    width: 60px;
    height: 60px;
  }
  
  .lenik-meilisearch-category-name {
    font-size: 11px;
  }
}

/**
 * Lenik Meilisearch Module - Search Overlay Component CSS
 */

/* Search Overlay */
.lenik-meilisearch-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background-color: rgba(0, 0, 0, 0.5) !important;
}

.lenik-meilisearch-search-overlay.active {
  display: block;
  opacity: 1;
}

.lenik-meilisearch-search-overlay-backdrop {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: top 0.3s ease, height 0.3s ease;
}

.lenik-meilisearch-search-overlay.full-page .lenik-meilisearch-search-overlay-backdrop {
  display: none;
}

.lenik-meilisearch-search-overlay-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  padding: 20px;
  box-sizing: border-box;
  transition: height 0.3s ease;
}

.lenik-meilisearch-search-overlay.full-page .lenik-meilisearch-search-overlay-content {
  height: 100%;
}

.lenik-meilisearch-search-overlay-form {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  padding: 0 45px; /* Make room for the buttons outside the input but allow more space for input */
}

.lenik-meilisearch-search-overlay-input {
  flex: 1;
  padding: 15px 0;
  border: none;
  border-bottom: 3px solid #333;
  border-radius: 0;
  font-size: 18px;
  outline: none;
  background: var(--lenik-input-bg-color, transparent);
  box-shadow: none;
  height: var(--lenik-input-height, 40px);
}

/* Remove the blue outline on focus and use green instead */
.lenik-meilisearch-search-overlay-input:focus {
  outline: none;
  box-shadow: none;
  border-color: #2a9d8f;
}

.lenik-meilisearch-search-overlay-back {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #7a7a7a;
  font-size: 32px;
  cursor: pointer;
  z-index: 2;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lenik-meilisearch-search-overlay-clear {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #7a7a7a;
  font-size: 32px;
  cursor: pointer;
  z-index: 2;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lenik-meilisearch-search-overlay-results {
  margin-top: 20px;
  background-color: #ffffff !important;
}

/* Combined container for categories and results */
.lenik-meilisearch-combined-container {
  max-height: calc(100% - 80px); /* Account for the search form and padding */
  overflow-y: auto; /* Enable vertical scrolling */
  overflow-x: hidden; /* Prevent horizontal scrolling */
  padding-bottom: 20px; /* Add some padding at the bottom */
  display: flex !important; /* Make it a flexbox container - use !important to ensure it's always applied */
  flex-direction: column !important; /* Stack children vertically - use !important to ensure it's always applied */
  background-color: #ffffff !important;
}

/* Ensure the category container and results container are properly ordered */
.lenik-meilisearch-combined-container .lenik-meilisearch-category-container-wrapper {
  order: var(--lenik-mobile-category-order, 1); /* Default to top (1) */
  width: 100%;
  margin-bottom: 15px;
}

.lenik-meilisearch-combined-container .lenik-meilisearch-search-overlay-results {
  order: var(--lenik-mobile-results-order, 2); /* Default to after categories (2) */
  width: 100%;
}

/* When category is at the bottom, adjust margins */
.lenik-meilisearch-combined-container .lenik-meilisearch-category-container-wrapper.position-bottom {
  margin-top: 15px;
  margin-bottom: 0;
}

/* Set CSS variable for mobile category order */
:root {
  --lenik-mobile-category-order: 1; /* 1 for top, 2 for bottom */
}

/* Add specific styling for results container in full-page mode */
.lenik-meilisearch-search-overlay.full-page .lenik-meilisearch-search-overlay-results {
  overflow-y: visible; /* Disable separate scrolling for results */
  padding-bottom: 20px; /* Add some padding at the bottom */
}

.lenik-meilisearch-search-overlay-grid {
  display: grid;
  grid-template-columns: repeat(var(--lenik-products-per-row, 4), 1fr);
  gap: var(--lenik-grid-gap, 20px);
}

.lenik-meilisearch-search-overlay-grid-item {
  border: var(--lenik-product-card-border, none);
  border-radius: var(--lenik-product-border-radius, 4px);
  overflow: hidden;
  transition: box-shadow 0.3s;
  background-color: var(--lenik-product-card-bg, #f8f8f8);
}

.lenik-meilisearch-search-overlay-grid-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.lenik-meilisearch-search-overlay-product {
  display: block;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.lenik-meilisearch-search-overlay-product:hover {
  text-decoration: none;
  color: inherit;
}

.lenik-meilisearch-search-overlay-product-image {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
  margin: 5px;
}

.lenik-meilisearch-search-overlay-product-image img {
  position: absolute;
  top: 5px;
  left: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  object-fit: cover;
  transition: transform 0.3s;
}

/* Lazy loading styles */
.lenik-meilisearch-search-overlay-product-image .lazy-load {
  opacity: 0;
  transition: opacity 0.5s;
  background-color: #f7f7f7;
}

.lenik-meilisearch-search-overlay-product-image img[src] {
  opacity: 1;
}

.lenik-meilisearch-search-overlay-product:hover .lenik-meilisearch-search-overlay-product-image img {
  transform: scale(1.05);
}

.lenik-meilisearch-search-overlay-product-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.lenik-meilisearch-search-overlay-product-name {
  font-weight: normal;
  margin-bottom: 5px;
  font-size: var(--lenik-product-name-font-size);
  color: var(--lenik-product-name-color);
  line-height: var(--lenik-product-name-line-height);
  overflow: var(--lenik-product-name-overflow);
  text-overflow: var(--lenik-product-name-truncate);
  white-space: var(--lenik-product-name-white-space);
}

.lenik-meilisearch-search-overlay-product-name.no-truncate {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  display: block;
  -webkit-line-clamp: none;
  -webkit-box-orient: initial;
  max-height: unset;
}

.lenik-meilisearch-search-overlay-product-price {
  color: var(--lenik-product-price-color);
  font-size: var(--lenik-product-price-font-size);
  font-weight: bold;
}

.lenik-product-indexed-data {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: var(--lenik-indexed-data-font-size);
  color: var(--lenik-indexed-data-color);
}

.lenik-product-feature,
.lenik-product-attribute {
  margin-bottom: 5px;
  font-size: var(--lenik-indexed-data-font-size);
  color: var(--lenik-indexed-data-color);
}

.feature-name,
.attribute-group {
  font-weight: bold;
  margin-right: 5px;
}

.lenik-meilisearch-search-overlay-view-all {
  text-align: center;
  margin-top: 20px;
  padding: 10px;
}

.lenik-meilisearch-search-overlay-view-all-link {
  display: inline-block;
  padding: 10px 20px;
  background-color: #2fb5d2;
  color: white;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s;
}

.lenik-meilisearch-search-overlay-view-all-link:hover {
  background-color: #1e94ab;
  text-decoration: none;
  color: white;
}

.lenik-meilisearch-search-overlay-no-results {
  text-align: center;
  padding: 30px;
  color: #7a7a7a;
  font-size: 16px;
}

.lenik-meilisearch-search-overlay-loading {
  text-align: center;
  padding: 20px;
  color: #7a7a7a;
  font-size: 16px;
  margin-top: 20px;
  position: relative;
  padding-top: 40px;
}

.lenik-meilisearch-search-overlay-loading:before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -15px;
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2fb5d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.lenik-meilisearch-search-overlay-count {
  margin-bottom: 20px;
  font-size: 16px;
  color: #7a7a7a;
}

/* Responsive styles for search overlay */
@media (max-width: 767px) {
  /* Mobile-specific overlay styles */
  .lenik-meilisearch-search-overlay-content {
    height: 100%; /* Full height on mobile by default */
    padding: 15px; /* Less padding on mobile */
    overflow-x: hidden; /* Prevent horizontal scrolling on mobile */
  }
  
  /* Prevent horizontal scrolling on the body when overlay is open */
  body.lenik-meilisearch-search-overlay-open {
    overflow-x: hidden;
  }
  
  .lenik-meilisearch-search-overlay-form {
    padding: 0 50px; /* Reduced padding for more space for input */
  }
  
  .lenik-meilisearch-search-overlay-input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 15px 0; /* Vertical padding only */
    border-bottom: 3px solid #333; /* Stronger underline on mobile with black color */
  }
  
  /* Remove the blue outline on focus for mobile and use green instead */
  .lenik-meilisearch-search-overlay-input:focus {
    outline: none;
    box-shadow: none;
    border-color: #2a9d8f;
  }
  
  .lenik-meilisearch-search-overlay-clear {
    font-size: 36px; /* Even larger clear button for easier tapping */
    padding: 10px; /* Add more padding for a larger tap target */
    right: 0; /* Position at the edge */
  }
  
  .lenik-meilisearch-search-overlay-back {
    font-size: 36px; /* Even larger back button for easier tapping */
    padding: 10px; /* Add more padding for a larger tap target */
    left: 0; /* Position at the edge */
  }
  
  .lenik-meilisearch-search-overlay-grid {
    grid-template-columns: var(--lenik-mobile-grid-template-columns);
    gap: var(--lenik-mobile-grid-gap);
  }
  
  /* Hide backdrop on mobile since we're always full-page */
  .lenik-meilisearch-search-overlay-backdrop {
    display: none;
  }
  
  /* Improve scrolling on mobile */
  .lenik-meilisearch-combined-container {
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
}

@media (max-width: 480px) {
  .lenik-meilisearch-search-overlay-content {
    padding: 10px; /* Even less padding on small mobile */
  }
  
  /* Optimize product display for small screens */
  .lenik-meilisearch-search-overlay-product-info {
    padding: 10px;
  }
}

/* Mobile products per row - auto width */
@media (max-width: 767px) {
  .lenik-meilisearch-search-overlay-grid.mobile-auto-width {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-right: -15px;
    margin-left: -15px;
    padding-bottom: 15px;
  }
  
  .lenik-meilisearch-search-overlay-grid.mobile-auto-width .lenik-meilisearch-search-overlay-grid-item {
    width: auto;
    flex: 0 0 auto;
    max-width: none;
    min-width: 200px;
    padding: 0 10px;
  }
}

/* Product Reviews Stars Display */
.lenik-product-reviews {
  margin-top: 5px;
  margin-bottom: 5px;
}

.stars-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.stars-rating .star {
  font-size: var(--lenik-star-size, 16px);
  line-height: 1;
  font-family: Arial, "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.stars-rating .star.filled::before {
  content: "\2605"; /* Filled star Unicode */
  color: var(--lenik-star-color, #FFD700); /* Yellow/gold for filled stars */
}

.stars-rating .star.empty::before {
  content: "\2606"; /* Empty star Unicode */
  color: #E0E0E0; /* Light gray for empty stars */
}

.review-count {
  color: var(--lenik-review-count-color, #7a7a7a);
  font-size: 13px;
  margin-left: 4px;
}

/* Stock Badge */
.lenik-stock-badge {
  display: inline-block;
  background-color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Stock Badge - In Stock (Green) */
.lenik-stock-badge-in-stock {
  color: #28a745 !important;
  border: 1px solid #28a745 !important;
  background-color: #ffffff !important;
}

/* Stock Badge - Out of Stock (Red) */
.lenik-stock-badge-out-of-stock {
  color: #dc3545 !important;
  border: 1px solid #dc3545 !important;
  background-color: #f8d7da !important;
}

/* Stock Badge - On Image Position in Search Overlay */
.lenik-meilisearch-search-overlay-product-image .lenik-stock-badge.badge-on-image {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
}

/* Stock Badge - Below Image Position in Search Overlay */
.lenik-stock-badge.badge-below-image {
  margin-top: 8px;
  margin-bottom: 8px;
  /* display: block; */
  text-align: center;
}

/* Stock Badge - On Image Position (legacy autocomplete) */
.autocomplete-product-image .lenik-stock-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
}

/* Stock Badge - Below Image Position (legacy autocomplete) */
.autocomplete-product-info > .lenik-stock-badge {
  margin-bottom: 8px;
}

/* Exact Match Checkbox */
.lenik-meilisearch-exact-match-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 15px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.lenik-meilisearch-exact-match-container:hover {
  border-color: #2a9d8f;
  background: #f9f9f9;
}

.lenik-meilisearch-exact-match-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2a9d8f;
  margin: 0;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
}

.lenik-meilisearch-exact-match-label {
  cursor: pointer;
  user-select: none;
  color: #333;
  font-size: 13px;
  font-weight: 400;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.exact-match-icon {
  display: inline-block;
  font-weight: 600;
  font-size: 12px;
  color: #2a9d8f;
  opacity: 0.8;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .lenik-meilisearch-exact-match-container {
    margin-left: 8px;
    padding: 5px 10px;
  }

  .lenik-meilisearch-exact-match-label {
    font-size: 12px;
  }

  .lenik-meilisearch-exact-match-checkbox {
    width: 15px;
    height: 15px;
  }
}

/**
 * Lenik Meilisearch Module - Search Results Component CSS
 */

/* Search Results */
.lenik-meilisearch-search-results {
  margin-top: 20px;
}

.lenik-meilisearch-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.lenik-meilisearch-search-count {
  font-size: 16px;
}

.lenik-meilisearch-search-sort {
  display: flex;
  align-items: center;
}

.lenik-meilisearch-search-sort label {
  margin-right: 10px;
  margin-bottom: 0;
}

.lenik-meilisearch-search-sort select {
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
}

/* Custom column classes for 5 and 8 products per row */
.lenik-meilisearch-search-results .lenik-col-5 {
  width: 20%;
  float: left;
  padding-left: 15px;
  padding-right: 15px;
  position: relative;
  min-height: 1px;
}

.lenik-meilisearch-search-results .lenik-col-8 {
  width: 12.5%;
  float: left;
  padding-left: 15px;
  padding-right: 15px;
  position: relative;
  min-height: 1px;
}

/* Responsive adjustments for custom columns */
@media (max-width: 991px) {
  .lenik-meilisearch-search-results .lenik-col-5,
  .lenik-meilisearch-search-results .lenik-col-8 {
    width: 50%; /* 2 columns on tablet */
  }
}

@media (max-width: 767px) {
  .lenik-meilisearch-search-results .lenik-col-5,
  .lenik-meilisearch-search-results .lenik-col-8 {
    width: 100%; /* 1 column on mobile */
  }
}

/* Make product classes more specific to avoid conflicts with theme */
.lenik-meilisearch-search-results .lenik-product-item {
  margin-bottom: 30px;
}

.lenik-meilisearch-search-results .lenik-product-container {
  border: var(--lenik-product-card-border);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.3s;
  background-color: var(--lenik-product-card-bg-color);
}

.lenik-meilisearch-search-results .lenik-product-container:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.lenik-meilisearch-search-results .lenik-product-image-container {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
}

.lenik-meilisearch-search-results .lenik-product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  /* height: 100%; - Removed: was covering images */
  object-fit: cover;
  transition: transform 0.3s;
}

.lenik-meilisearch-search-results .lenik-product-container:hover .lenik-product-image {
  transform: scale(1.05);
}

/* Stock Badge Styling for Search Results */
.lenik-meilisearch-search-results .lenik-stock-badge {
  display: inline-block;
  background-color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Stock Badge - In Stock (Green) */
.lenik-meilisearch-search-results .lenik-stock-badge-in-stock {
  color: #28a745 !important;
  border: 1px solid #28a745 !important;
  background-color: #ffffff !important;
}

/* Stock Badge - Out of Stock (Red) */
.lenik-meilisearch-search-results .lenik-stock-badge-out-of-stock {
  color: #dc3545 !important;
  border: 1px solid #dc3545 !important;
  background-color: #f8d7da !important;
}

/* Stock Badge - On Image Position */
.lenik-meilisearch-search-results .lenik-product-image-container .lenik-stock-badge.badge-on-image {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
}

/* Stock Badge - Below Image Position */
.lenik-meilisearch-search-results .lenik-stock-badge.badge-below-image {
  margin-top: 8px;
  margin-bottom: 8px;
  /* display: block; */
  text-align: center;
}

.lenik-meilisearch-search-results .lenik-product-info {
  padding: 15px;
}

.lenik-meilisearch-search-results .lenik-product-name {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: var(--lenik-product-name-font-size);
  font-weight: bold;
  line-height: var(--lenik-product-name-line-height);
}

.lenik-meilisearch-search-results .lenik-product-name a {
  color: var(--lenik-product-name-color);
  text-decoration: none;
  overflow: var(--lenik-product-name-overflow);
  text-overflow: var(--lenik-product-name-truncate);
  white-space: var(--lenik-product-name-white-space);
  display: block;
}

.lenik-meilisearch-search-results .lenik-product-name a:hover {
  color: #2fb5d2;
}

.lenik-meilisearch-search-results .lenik-product-price {
  color: var(--lenik-product-price-color);
  font-size: var(--lenik-product-price-font-size);
  font-weight: bold;
  margin-bottom: 10px;
}

/* Discount Price Styling */
.lenik-meilisearch-search-results .lenik-product-price-wrapper {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.lenik-meilisearch-search-results .lenik-product-price-regular {
  color: var(--lenik-original-price-color, #999);
  font-size: 14px;
  text-decoration: line-through;
  font-weight: normal;
}

.lenik-meilisearch-search-results .lenik-product-price-discount {
  color: var(--lenik-discount-price-color, #d9534f);
  font-size: var(--lenik-product-price-font-size);
  font-weight: bold;
}

.lenik-meilisearch-search-results .lenik-product-discount-badge {
  background-color: var(--lenik-discount-badge-bg-color, #ff7043);
  color: var(--lenik-discount-badge-text-color, #ffffff);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.lenik-meilisearch-search-results .lenik-product-description {
  color: #7a7a7a;
  font-size: 14px;
  margin-bottom: 15px;
  height: 60px;
  overflow: hidden;
}

.lenik-meilisearch-search-results .lenik-product-actions {
  text-align: center;
}

/* Loading, Error, No Results */
.lenik-meilisearch-search-loading,
.lenik-meilisearch-search-error,
.lenik-meilisearch-search-no-results {
  padding: 20px;
  text-align: center;
  display: none;
}

.lenik-meilisearch-search-loading {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lenik-meilisearch-search-loading::after {
  content: '';
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2fb5d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.lenik-meilisearch-search-error {
  color: #ff4c4c;
  background-color: #ffe8e8;
  border: 1px solid #ffcccc;
  border-radius: 4px;
}

.lenik-meilisearch-search-no-results {
  color: #7a7a7a;
  background-color: #f7f7f7;
  border: 1px solid #eee;
  border-radius: 4px;
}

/* Indexed Data Display */
.lenik-product-indexed-data {
  margin-top: 10px;
  font-size: var(--lenik-indexed-data-font-size);
  color: var(--lenik-indexed-data-color);
}

.lenik-product-standard-field,
.lenik-product-feature,
.lenik-product-attribute {
  margin-bottom: 5px;
  font-size: var(--lenik-indexed-data-font-size);
  color: var(--lenik-indexed-data-color);
}

.field-name,
.feature-name,
.attribute-group {
  font-weight: bold;
  margin-right: 5px;
}

/* Pagination */
.lenik-meilisearch-search-pagination {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-item {
  margin: 0 5px;
}

.page-item.active .page-link {
  background-color: #2fb5d2;
  color: white;
  border-color: #2fb5d2;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #232323;
  text-decoration: none;
  transition: all 0.3s;
}

.page-link:hover {
  background-color: #f7f7f7;
  text-decoration: none;
}

/* Responsive */
@media (max-width: 767px) {
  .lenik-meilisearch-search-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .lenik-meilisearch-search-count {
    margin-bottom: 10px;
  }

  .lenik-meilisearch-search-results .lenik-product-item {
    width: 50%;
  }
}

@media (max-width: 480px) {
  .lenik-meilisearch-search-results .lenik-product-item {
    width: 100%;
  }

  .lenik-meilisearch-search-pagination .page-link {
    width: 30px;
    height: 30px;
  }
}

/* ============================================
   DROPDOWN SEARCH OVERLAY
   ============================================ */

.lenik-search-wrapper {
  position: relative;
}

.lenik-search-wrapper[data-display-type="dropdown"] .lenik-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Search Input */
.lenik-search-input {
  width: 100%;
  padding: 12px 48px 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.lenik-search-input:focus {
  outline: none;
  border-color: var(--primary-color, #007bff);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.lenik-search-input::placeholder {
  color: #999;
}

.lenik-search-icon {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lenik-search-icon:hover {
  color: var(--primary-color, #007bff);
}

.lenik-search-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lenik-search-close:hover {
  color: #333;
}

/* Dropdown Overlay */
.lenik-search-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
}

.lenik-search-dropdown.lenik-dropdown-visible {
  display: block !important;
}

/* Backdrop */
.lenik-search-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

/* Dropdown Content */
.lenik-search-dropdown-content {
  position: relative;
  width: var(--lenik-dropdown-width, 90%);
  max-width: 1400px;
  margin: 80px auto 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-height: calc(100vh - 120px);
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

/* Header with View Toggle */
.lenik-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.lenik-search-count {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.lenik-search-view-toggle {
  display: flex;
  gap: 4px;
}

.lenik-view-btn {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.lenik-view-btn:hover {
  background: #e0e0e0;
}

.lenik-view-btn.active {
  background: var(--primary-color, #007bff);
  border-color: var(--primary-color, #007bff);
  color: white;
}

/* Search Suggestions */
.lenik-search-suggestions {
  padding: 16px 24px;
  background: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
}

.lenik-suggestions-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
  font-weight: 500;
}

.lenik-suggestions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lenik-suggestion-chip {
  background: white;
  border: 1px solid #e0e0e0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lenik-suggestion-chip:hover {
  background: var(--primary-color, #007bff);
  border-color: var(--primary-color, #007bff);
  color: white;
}

/* Main Content Area */
.lenik-search-main {
  display: flex;
  gap: 24px;
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
}

/* Filters Sidebar */
.lenik-search-filters {
  width: 250px;
  flex-shrink: 0;
}

.lenik-filter-section {
  margin-bottom: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.lenik-filter-title {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f5f5f5;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lenik-filter-title:hover {
  background: #e8e8e8;
}

.lenik-filter-title.collapsed .lenik-filter-arrow {
  transform: rotate(-90deg);
}

.lenik-filter-arrow {
  transition: transform 0.2s ease;
}

.lenik-filter-content {
  padding: 12px 16px;
  background: white;
}

.lenik-filter-content.collapsed {
  display: none;
}

/* Brand Filter */
.lenik-brand-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.lenik-brand-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.lenik-brand-item .lenik-brand-count {
  color: #999;
  font-size: 13px;
  margin-left: auto;
}

/* Title Match Sections */
.title-match-section {
  margin-bottom: 24px;
}

.title-match-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-match-count {
  font-size: 12px;
  font-weight: normal;
  color: #666;
}

.title-match-exact .title-match-section-title {
  color: #666;
  border-bottom-color: #e0e0e0;
}

/* Filter Divider (separates matched from unmatched filter values) */
.autocomplete-filter-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 8px 0;
}

/* Title Match Checkbox Container */
.autocomplete-title-match-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
}

.autocomplete-title-match-checkbox {
  cursor: pointer;
}

.autocomplete-title-match-label {
  cursor: pointer;
  font-size: 12px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.title-match-icon {
  color: var(--lenik-primary-color, #2fb5d2);
  font-weight: bold;
}

/* Show More / Show Less Button for Dropdown Filters */
.lenik-filter-show-more {
  margin-top: 8px;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--lenik-primary-color, #2fb5d2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.lenik-filter-show-more:hover {
  color: var(--lenik-primary-color-dark, #1a8fa3);
  text-decoration: underline;
}

.lenik-filter-show-more .toggle-icon {
  font-weight: bold;
  font-size: 14px;
}

/* Price Range Filter */
.lenik-price-range {
  padding: 8px 0;
}

.lenik-price-range input[type="range"] {
  width: 100%;
  margin-bottom: 8px;
}

.lenik-price-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

/* Results Area */
.lenik-search-results {
  flex: 1;
  min-width: 0;
}

/* Loading State */
.lenik-search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.lenik-search-loading p {
  margin-top: 16px;
  color: #666;
  font-size: 14px;
}

.lenik-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top-color: var(--primary-color, #007bff);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Empty State */
.lenik-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #999;
}

.lenik-search-empty svg {
  opacity: 0.3;
  margin-bottom: 16px;
}

.lenik-search-empty p {
  font-size: 16px;
  margin: 8px 0;
}

.lenik-search-empty .lenik-empty-hint {
  font-size: 14px;
  color: #bbb;
}

/* Results Grid */
.lenik-search-grid {
  display: grid;
  grid-template-columns: var(--lenik-dropdown-grid-template-columns, repeat(4, 1fr));
  gap: 20px;
}

.lenik-search-grid.lenik-view-list {
  grid-template-columns: 1fr;
}

/* Product Card */
.lenik-product-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.lenik-product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.lenik-product-image {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: #f5f5f5;
}

.lenik-product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lenik-product-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e53935;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* Stock Badge Styling for Dropdown */
.lenik-product-card .lenik-stock-badge {
  display: inline-block;
  background-color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Stock Badge - In Stock (Green) */
.lenik-product-card .lenik-stock-badge-in-stock {
  color: #28a745 !important;
  border: 1px solid #28a745 !important;
  background-color: #ffffff !important;
}

/* Stock Badge - Out of Stock (Red) */
.lenik-product-card .lenik-stock-badge-out-of-stock {
  color: #dc3545 !important;
  border: 1px solid #dc3545 !important;
  background-color: #f8d7da !important;
}

/* Stock Badge - On Image Position */
.lenik-product-image .lenik-stock-badge.badge-on-image {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
}

/* Stock Badge - Below Image Position */
.lenik-product-card .lenik-stock-badge.badge-below-image {
  margin-top: 8px;
  margin-bottom: 8px;
  display: block;
  text-align: center;
}

/* Discount Badge on Image */
.autocomplete-product-image .lenik-discount-badge.badge-on-image,
.lenik-product-image .lenik-discount-badge.badge-on-image {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: var(--lenik-discount-badge-bg-color, #ff7043);
  color: var(--lenik-discount-badge-text-color, #ffffff);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.lenik-product-info {
  margin-top: 12px;
}

.lenik-product-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.lenik-product-prices {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lenik-product-price {
  font-size: 16px;
  font-weight: 700;
  color: #e53935;
}

.lenik-product-price-original {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
}

/* Dropdown-specific product name and price colors and font sizes */
.autocomplete-product-name {
  color: var(--lenik-dropdown-product-name-color, #232323) !important;
  font-size: var(--lenik-dropdown-product-name-font-size, 14px) !important;
}

.autocomplete-product-price {
  color: var(--lenik-dropdown-product-price-color, #999999) !important;
  font-size: var(--lenik-dropdown-product-price-font-size, 16px) !important;
}

/* Autocomplete Discount Price Styling */
.autocomplete-product-price-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}

.autocomplete-product-price-regular {
  color: var(--lenik-original-price-color, #999);
  font-size: 14px;
  text-decoration: line-through;
  font-weight: normal;
}

.autocomplete-product-price-discount {
  color: var(--lenik-discount-price-color, #d9534f);
  font-size: var(--lenik-dropdown-product-price-font-size, 16px);
  font-weight: bold;
}

.autocomplete-product-discount-badge {
  background-color: var(--lenik-discount-badge-bg-color, #ff7043);
  color: var(--lenik-discount-badge-text-color, #ffffff);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

/* Footer */
.lenik-search-footer {
  padding: 20px 24px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

.lenik-view-all-btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--primary-color, #007bff);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.lenik-view-all-btn:hover {
  background: var(--primary-color-dark, #0056b3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Mobile Filters Button (hidden on desktop) */
.lenik-mobile-filters-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--lenik-dropdown-accent-color, #2fb5d2);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.lenik-mobile-filters-btn:hover {
  opacity: 0.9;
}

.lenik-mobile-filters-btn svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Mobile Filters Overlay */
.lenik-mobile-filters-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lenik-mobile-filters-overlay.active {
  display: block;
  opacity: 1;
}

.lenik-mobile-filters-panel {
  position: absolute;
  left: 0;
  top: 0;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background: white;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.lenik-mobile-filters-overlay.active .lenik-mobile-filters-panel {
  transform: translateX(0);
}

.lenik-mobile-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: var(--lenik-dropdown-header-bg-color, #f5f5f5);
}

.lenik-mobile-filters-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.lenik-mobile-filters-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lenik-mobile-filters-close svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.lenik-mobile-filters-close:hover {
  color: #333;
}

.lenik-mobile-filters-content {
  padding: 0;
}

/* Force Mobile Layout (for dropdown_compact mode on desktop) */
.lenik-force-mobile-layout .lenik-search-main {
  flex-direction: column !important;
  padding: 16px !important;
}

.lenik-force-mobile-layout .lenik-search-filters {
  display: none !important;
}

.lenik-force-mobile-layout .lenik-mobile-filters-btn {
  display: flex !important;
}

.lenik-force-mobile-layout .lenik-search-results {
  width: 100% !important;
  flex: 1 !important;
}

.lenik-force-mobile-layout .lenik-search-grid {
  gap: 12px;
  grid-template-columns: repeat(4, 1fr) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .lenik-search-dropdown-content {
    width: 95% !important;
    margin: 20px auto;
    max-height: calc(100vh - 40px);
  }

  .lenik-search-main {
    flex-direction: column;
    padding: 16px;
  }

  /* Hide desktop filters sidebar on mobile */
  .lenik-search-filters {
    display: none !important;
  }

  /* Show mobile filters button */
  .lenik-mobile-filters-btn {
    display: flex;
  }

  .lenik-search-grid {
    /* Use CSS variable set by JavaScript - removed hardcoded grid */
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .lenik-search-dropdown-content {
    width: 100% !important;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }

  .lenik-search-header {
    padding: 12px 16px;
  }

  .lenik-search-suggestions {
    padding: 12px 16px;
  }
}

/* Mobile Filters Overlay (for dropdown mode) */
.autocomplete-mobile-filters-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.autocomplete-mobile-filters-overlay.active {
  opacity: 1;
  visibility: visible;
}

.autocomplete-mobile-filters-panel {
  position: absolute;
  top: 0;
  left: -320px;
  width: 320px;
  max-width: 85%;
  height: 100%;
  background-color: #ffffff;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.autocomplete-mobile-filters-overlay.active .autocomplete-mobile-filters-panel {
  left: 0;
}

.autocomplete-mobile-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 16px;
  border-bottom: 2px solid #e0e0e0;
  background: linear-gradient(135deg, var(--lenik-dropdown-accent-color, #2fb5d2) 0%, #1a8ca0 100%);
  flex-shrink: 0;
}

.autocomplete-mobile-filters-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.autocomplete-mobile-filters-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #ffffff;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.autocomplete-mobile-filters-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.autocomplete-mobile-filters-content {
  padding: 0;
  flex: 1;
  overflow-y: auto;
}

/* Clear all filters button */
.autocomplete-clear-filters-bar {
  padding: 12px 16px;
  background-color: #fff3cd;
  border-bottom: 1px solid #ffc107;
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.autocomplete-clear-filters-bar.active {
  display: flex;
}

.autocomplete-clear-filters-text {
  font-size: 13px;
  color: #856404;
  font-weight: 500;
}

.autocomplete-clear-filters-btn {
  background: #ffc107;
  border: none;
  color: #000;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}

.autocomplete-clear-filters-btn:hover {
  background: #ffb300;
}

/* Improved filter sections styling for mobile overlay */
.autocomplete-mobile-filters-content .autocomplete-filter-section {
  border: none;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0;
  border-radius: 0;
}

.autocomplete-mobile-filters-content .autocomplete-filter-section:last-child {
  border-bottom: none;
}

.autocomplete-mobile-filters-content .autocomplete-filter-title {
  background-color: #f8f9fa;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #232323;
  border-bottom: 1px solid #e0e0e0;
}

.autocomplete-mobile-filters-content .autocomplete-filter-list {
  padding: 8px 0;
}

.autocomplete-mobile-filters-content .autocomplete-filter-item {
  padding: 10px 16px;
  font-size: 14px;
  color: #444;
  transition: background 0.2s ease;
}

.autocomplete-mobile-filters-content .autocomplete-filter-item:hover {
  background-color: #f8f9fa;
}

.autocomplete-mobile-filters-content .autocomplete-filter-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
}

.autocomplete-mobile-filters-content .autocomplete-price-slider {
  padding: 20px 16px 16px 16px;
}

/* Dropdown close button - default desktop */
.lenik-meilisearch-dropdown-close {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lenik-meilisearch-dropdown-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}

/* Make filters button clickable on mobile */
@media (max-width: 768px) {
  .autocomplete-filters-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--lenik-dropdown-accent-color, #2fb5d2);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s ease;
  }

  .autocomplete-filters-title:hover {
    opacity: 0.9;
  }

  /* Modern white transparent close button for mobile */
  .lenik-meilisearch-dropdown-close {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 6px !important;
    font-size: 20px !important;
    font-weight: 300 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    z-index: 100 !important;
    order: 999 !important;
    flex-shrink: 0 !important;
  }

  .lenik-meilisearch-dropdown-close:active {
    transform: scale(0.95) !important;
    background: rgba(255, 255, 255, 1) !important;
  }

  .lenik-meilisearch-dropdown-close:hover {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
  }

  /* Top header adjustments for mobile */
  .autocomplete-top-header {
    padding: 12px 16px !important;
    gap: 12px !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  /* Hide non-essential elements on mobile to make room for close button */
  .autocomplete-view-toggle,
  .autocomplete-exact-match-container {
    display: none !important;
  }

  /* Mobile sort dropdown - show as icon button */
  .autocomplete-sort-dropdown {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
  }

  .autocomplete-sort-label {
    display: none !important;
  }

  .autocomplete-sort-dropdown::before {
    content: '' !important;
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 6px !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M7 12h10M11 18h6"/><path d="M8 6L8 4M16 12v-2M18 18v-2"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 18px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
    pointer-events: none !important;
  }

  .autocomplete-sort-select {
    opacity: 0 !important;
    width: 32px !important;
    height: 32px !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 3 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  .autocomplete-sort-select:focus + .autocomplete-sort-label {
    display: none !important;
  }

  /* Show full dropdown when focused/clicked */
  .autocomplete-sort-dropdown:focus-within .autocomplete-sort-select,
  .autocomplete-sort-select:focus {
    opacity: 1 !important;
    width: auto !important;
    min-width: 160px !important;
    padding: 6px 8px !important;
    background: white !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    font-size: 13px !important;
  }

  /* Make results count more compact on mobile */
  .autocomplete-results-count {
    font-size: 13px !important;
    white-space: nowrap !important;
  }

  /* Ensure right header doesn't take too much space */
  .autocomplete-right-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
}


