/* ============================================= */
/*  search.css — ZAZA STYLE SEARCH + MODAL + ICONS */
/*  Полный, готовый к вставке файл               */
/*  ПОИСК ВНУТРИ .header-icons — ИДЕАЛЬНО        */
/* ============================================= */

/* === ПЕРЕМЕННЫЕ === */
:root {
  --glass: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --silver: #e0e0e0;
  --platinum: #f0f0f0;
  --dark: #0d0d0d;
  --darker: #0a0a0a;
  --text: #f5f5f5;
  --subtext: #aaaaaa;
  --white: #ffffff;
  --transition: all 0.3s ease;
}

/* === ФИКСИРОВАННЫЕ ИКОНКИ В ШАПКЕ === */
.header-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--glass);
  border: 1.2px solid var(--border);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.12);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.icon-btn i {
  font-size: 1.35rem;
  color: var(--white);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dfdedd;
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* === ПОИСК ВНУТРИ .header-icons === */
.search-wrapper {
  position: relative;
  z-index: 1001;
  flex-shrink: 0;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  height: 48px;
  width: 48px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  transition: 
    width 0.4s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.3s ease,
    box-shadow 0.4s ease,
    border-color 0.4s ease;
  overflow: hidden;
  opacity: 0.9;
  will-change: width, opacity; /* ← Плавность на GPU */
}

.search-container:hover {
  opacity: 1;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.3);
}

.search-container.active {
  width: 360px;
  opacity: 1;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.35);
}

.search-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: all 0.35s ease;
  z-index: 2;
}

.search-icon:hover {
  transform: scale(1.15);
}

.search-input {
  flex: 1;
  padding: 0 1.2rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  outline: none;
  opacity: 0;
  width: 0;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.search-container.active .search-input {
  opacity: 1;
  width: 100%;
  padding: 0 1.2rem;
}

.search-clear {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  color: #fff;
  font-weight: bold;
  backdrop-filter: blur(8px);
}

.search-container.active .search-clear {
  opacity: 1;
  pointer-events: auto;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

/* === АВТОДОПОЛНЕНИЕ (ZAZA + BIN.CSS) === */
.autocomplete-list {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 360px;
  max-height: 380px;
  background: rgba(15, 15, 15, 0.92);
  border: 1.2px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-12px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 1002;
  font-family: 'SF Pro Display', sans-serif;
}

.autocomplete-list.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.autocomplete-item {
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #eee;
  font-size: 1rem;
  font-weight: 500;
}

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

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding-left: 1.6rem;
  border-left: 3px solid #fff;
}

.autocomplete-item img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 10px;
  background: #222;
  flex-shrink: 0;
}

.autocomplete-item .item-info {
  flex: 1;
  min-width: 0;
}

.autocomplete-item .item-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.autocomplete-item .item-type {
  font-size: 0.8rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.autocomplete-empty {
  padding: 2rem 1.4rem;
  text-align: center;
  color: #888;
  font-style: italic;
}

/* === МОДАЛКА ТОВАРА (БЕЗ ИЗМЕНЕНИЙ) === */
.product-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.96) !important;
  backdrop-filter: blur(32px);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  padding: 1.5rem;
  overflow-y: auto;
}

.product-modal.active,
.product-modal[style*="flex"],
.product-modal[style*="block"],
.product-modal[style*="inline"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.product-content {
  width: 100%;
  max-width: 420px !important;
  background: linear-gradient(135deg, var(--darker) 0%, #111 50%, var(--dark) 100%) !important;
  border-radius: 48px;
  overflow: hidden;
  box-shadow: 
    0 35px 90px rgba(0,0,0,0.85),
    0 0 0 1.5px rgba(255,255,255,0.08),
    0 70px 160px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  animation: premiumPop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.35);
  transform: scale(0.86);
  max-height: 88vh !important;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
}

.product-modal.active .product-content {
  transform: scale(1) !important;
  animation: premiumPop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.35) forwards !important;
}

@keyframes premiumPop {
  0% { transform: scale(0.84) translateY(60px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.product-img {
  width: 100% !important;
  height: auto !important;
  max-height: 45vh !important;
  object-fit: contain !important;
  object-position: center !important;
  background: #0b0b0b !important;
  padding: 32px 28px !important;
  box-sizing: border-box !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.product-info {
  padding: 1.8rem 2rem 2.4rem !important;
  text-align: center;
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.9rem !important;
  flex-grow: 1;
}

.product-title {
  font-size: 2.2rem !important;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.9px;
  font-family: 'SF Pro Display', -apple-system, sans-serif;
}

.stars {
  color: #ffd700 !important;
  font-size: 1.5rem !important;
  letter-spacing: 3px;
  text-shadow: 
    0 0 10px rgba(255,255,255,0.8),
    0 0 20px rgba(255,255,255,0.6),
    0 0 30px rgba(255,255,255,0.4);
}

.reviews-count {
  font-size: 0.95rem;
  color: var(--subtext);
}

.product-price {
  font-size: 2.6rem !important;
  font-weight: 800;
  color: var(--platinum);
  margin: 0.5rem 0 !important;
  letter-spacing: -0.6px;
  font-family: 'SF Pro Display', sans-serif;
}

.product-description {
  font-size: 1.02rem;
  line-height: 1.6;
  color: #d0d0d0;
  text-align: left;
  padding: 1.2rem 1rem !important;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  margin: 0.8rem 0 !important;
}

.add-to-cart-btn {
  width: 100%;
  padding: 1.3rem 0 !important;
  background: linear-gradient(135deg, #1c1c1c, #2a2a2a) !important;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 1.2rem !important;
  border: 1.5px solid rgba(255,255,255,0.2) !important;
  border-radius: 26px;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 
    0 10px 30px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 0 20px rgba(255,255,255,0.15) !important;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  font-family: 'SF Pro Display', sans-serif;
  margin-top: 0.6rem !important;
  position: relative;
  overflow: hidden;
}

.add-to-cart-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.7s;
}

.add-to-cart-btn:hover::before {
  left: 100%;
}

.add-to-cart-btn:hover {
  background: linear-gradient(135deg, #2a2a2a, #333) !important;
  transform: translateY(-6px);
  box-shadow: 
    0 20px 50px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 0 40px rgba(255,255,255,0.4) !important;
  border-color: rgba(255,255,255,0.4) !important;
}

.product-reviews { margin-top: 1.4rem !important; text-align: left; }
.reviews-title { font-size: 1.25rem; font-weight: 700; color: var(--silver); margin-bottom: 1rem; text-align: center; }
.review { 
  background: rgba(255,255,255,0.04) !important; 
  padding: 1rem !important; 
  border-radius: 20px; 
  margin-bottom: 1rem; 
  border: 1px solid rgba(255,255,255,0.08) !important; 
  backdrop-filter: blur(12px); 
  box-shadow: 0 10px 30px rgba(0,0,0,0.4); 
}
.review-header { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.6rem; }
.review-header strong { font-size: 1rem; color: #ffffff; }
.review-stars { color: #ffd700 !important; font-size: 0.9rem; }
.review p { font-size: 0.95rem; line-height: 1.5; color: #e0e0e0; margin: 0; }
.review small { color: #999999; }
.review-header > div:first-child { 
  width: 40px; height: 40px; border-radius: 50%; 
  display: flex; align-items: center; justify-content: center; 
  font-size: 24px; 
  background: linear-gradient(135deg, #1e1e1e, #2d2d2d) !important; 
  border: 2px solid rgba(255,255,255,0.15) !important; 
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1) !important; 
}

.close-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(20,20,20,0.95) !important;
  border: 1.5px solid rgba(255,255,255,0.2) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s ease;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
  backdrop-filter: blur(16px);
}

.close-modal:hover {
  background: rgba(255,255,255,0.15) !important;
  transform: scale(1.2) rotate(90deg);
  box-shadow: 0 16px 50px rgba(255,255,255,0.3) !important;
  border-color: rgba(255,255,255,0.5) !important;
}

.close-modal i {
  color: #ffffff !important;
  font-size: 1.4rem;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.product-content { overflow-y: auto; scrollbar-width: thin; }
.product-content::-webkit-scrollbar { width: 6px; }
.product-content::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 10px; }
.product-content::-webkit-scrollbar-thumb { background: linear-gradient(#666, #999); border-radius: 10px; }

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
  .search-container.active {
    width: 280px;
  }
  
  .autocomplete-list,
  .autocomplete-list.active {
    width: 280px;
    left: 0;
  }
  
  .search-input {
    font-size: 1rem;
  }
}

/* ==================================================================
   СВЕТЛАЯ ТЕМА — ПОЛНАЯ ПОДДЕРЖКА ПОИСКА И МОДАЛКИ ТОВАРА (2025)
   ================================================================== */
html[data-theme="light"] .search-container,
html[data-theme="light"] .search-container:hover,
html[data-theme="light"] .search-container.active {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1.5px solid rgba(15, 15, 15, 0.18) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12) !important;
  backdrop-filter: blur(20px) !important;
}

html[data-theme="light"] .search-input,
html[data-theme="light"] .search-input::placeholder {
  color: #000 !important;
}

html[data-theme="light"] .search-icon i,
html[data-theme="light"] .search-clear {
  color: #000 !important;
}

html[data-theme="light"] .search-clear {
  background: rgba(15, 15, 15, 0.12) !important;
}
html[data-theme="light"] .search-clear:hover {
  background: rgba(15, 15, 15, 0.22) !important;
}

/* Автодополнение */
html[data-theme="light"] .autocomplete-list {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1.5px solid rgba(15, 15, 15, 0.15) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14) !important;
}
html[data-theme="light"] .autocomplete-item {
  color: #222 !important;
  border-bottom-color: rgba(15, 15, 15, 0.08) !important;
}
html[data-theme="light"] .autocomplete-item:hover,
html[data-theme="light"] .autocomplete-item.highlighted {
  background: rgba(15, 15, 15, 0.1) !important;
  color: #000 !important;
  border-left-color: #000 !important;
}
html[data-theme="light"] .autocomplete-item .item-title { color: #000 !important; }
html[data-theme="light"] .autocomplete-item .item-type { color: #555 !important; }

/* МОДАЛКА ТОВАРА — СВЕТЛАЯ ТЕМА */
html[data-theme="light"] .product-modal {
  background: rgba(250, 250, 250, 0.96) !important;
  backdrop-filter: blur(32px) !important;
}

html[data-theme="light"] .product-content {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1.5px solid rgba(15, 15, 15, 0.15) !important;
  box-shadow: 
    0 35px 90px rgba(0,0,0,0.12),
    0 0 0 1.5px rgba(15,15,15,0.08),
    0 70px 160px rgba(0,0,0,0.1) !important;
  backdrop-filter: blur(28px) !important;
}

html[data-theme="light"] .product-title,
html[data-theme="light"] .product-price,
html[data-theme="light"] .reviews-title,
html[data-theme="light"] .review-header strong {
  color: #000 !important;
}

html[data-theme="light"] .product-description,
html[data-theme="light"] .review p {
  color: #333 !important;
  background: rgba(15, 15, 15, 0.05) !important;
  border-color: rgba(15, 15, 15, 0.1) !important;
}

html[data-theme="light"] .stars,
html[data-theme="light"] .review-stars {
  color: #ffb800 !important;
  text-shadow: 0 0 12px rgba(255, 184, 0, 0.6) !important;
}

html[data-theme="light"] .reviews-count,
html[data-theme="light"] .review small {
  color: #666 !important;
}

html[data-theme="light"] .add-to-cart-btn {
  background: #000 !important;
  color: #fff !important;
  border-color: rgba(15, 15, 15, 0.3) !important;
  box-shadow: 0 12px 35px rgba(0,0,0,0.25) !important;
}
html[data-theme="light"] .add-to-cart-btn:hover {
  background: #222 !important;
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4) !important;
}

/* Крестик закрытия */
html[data-theme="light"] .close-modal {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1.5px solid rgba(15, 15, 15, 0.2) !important;
  box-shadow: 0 10px 35px rgba(0,0,0,0.15) !important;
}
html[data-theme="light"] .close-modal i {
  color: #000 !important;
}
html[data-theme="light"] .close-modal:hover {
  background: rgba(15, 15, 15, 0.9) !important;
}
html[data-theme="light"] .close-modal:hover i {
  color: #fff !important;
}

/* Аватарки в отзывах */
html[data-theme="light"] .review-header > div:first-child {
  background: linear-gradient(135deg, #f5f5f5, #e0e0e0) !important;
  border-color: rgba(15, 15, 15, 0.2) !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
}

/* Скроллбар */
html[data-theme="light"] .product-content::-webkit-scrollbar-track {
  background: rgba(15, 15, 15, 0.06) !important;
}
html[data-theme="light"] .product-content::-webkit-scrollbar-thumb {
  background: rgba(15, 15, 15, 0.25) !important;
}
html[data-theme="light"] .product-content::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 15, 15, 0.4) !important;
}

/* 1. Фон за картинкой товара — белый в светлой теме */
html[data-theme="light"] .product-img {
  background: #ffffff !important;
  border-bottom: 1px solid rgba(15, 15, 15, 0.1) !important;
}

/* 2. ПОЛНОСТЬЮ УБИРАЕМ СКРОЛЛБАРЫ В МОДАЛКЕ ТОВАРА (в обеих темах) */
/* Видимый скролл остаётся, но сама полоса — невидимая (как у Apple) */
.product-content,
.product-modal {
  scrollbar-width: none !important;           /* Firefox */
  -ms-overflow-style: none !important;        /* IE/Edge */
}

.product-content::-webkit-scrollbar,
.product-modal::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* На всякий случай — и в светлой теме тоже */
html[data-theme="light"] .product-content,
html[data-theme="light"] .product-modal {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html[data-theme="light"] .product-content::-webkit-scrollbar,
html[data-theme="light"] .product-modal::-webkit-scrollbar {
  display: none !important;
}

  /* АВТОДОПОЛНЕНИЕ — СВЕТЛАЯ ТЕМА — ФИНАЛЬНЫЙ ВАРИАНТ (ЧЁРНЫЕ КАРТИНКИ + ВСЁ ВИДНО) */
  html[data-theme="light"] #autocompleteList {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1.6px solid rgba(0, 0, 0, 0.22) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18) !important;
    backdrop-filter: blur(24px);
    border-radius: 18px;
  }

  html[data-theme="light"] #autocompleteList .autocomplete-item {
    color: #000 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.09) !important;
  }

  html[data-theme="light"] #autocompleteList .autocomplete-item:hover,
  html[data-theme="light"] #autocompleteList .autocomplete-item.highlighted {
    background: rgba(0, 0, 0, 0.08) !important;
  }

  html[data-theme="light"] #autocompleteList .item-title {
    color: #000 !important;
    font-weight: 600 !important;
  }

  html[data-theme="light"] #autocompleteList .item-type {
    color: #555 !important;
    font-size: 0.8rem !important;
  }

  html[data-theme="light"] #autocompleteList small {
    color: #000 !important;
    font-weight: 700 !important;
  }

  html[data-theme="light"] #autocompleteList .autocomplete-item strong {
    color: #444 !important;
    font-weight: 700 !important;
  }

  html[data-theme="light"] #autocompleteList .autocomplete-empty {
    color: #555 !important;
  }



  /* ===================================================== */
/* МОБИЛЬНЫЙ ПОИСК — ШТОРКА СВЕРХУ (iPhone SE + все мобильные) */
/* Стиль Apple 2025 — чистый, плавный, с карточками */
/* ===================================================== */
/* ===================================================== */
/* МОБИЛЬНЫЙ ПОИСК — ЕДИНАЯ ШТОРКА 2025 (Apple Style) */
/* Работает с <div class="mobile-search-sheet" id="mobileSearchSheet"> */
/* ===================================================== */

.mobile-search-sheet {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0;
  visibility: hidden;
  overscroll-behavior: contain;
}

.mobile-search-sheet.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Хедер */
.mobile-search-header {
  flex-shrink: 0;
  padding: 12px 16px 8px;
  padding-top: calc(12px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-search-back {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.12);
  border: none; border-radius: 50%;
  color: #0a84ff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mobile-search-back:active {
  background: rgba(255,255,255,0.25);
  transform: scale(0.94);
}

.mobile-search-input-wrapper {
  flex: 1;
  height: 44px;
  background: rgba(255,255,255,0.14);
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  backdrop-filter: blur(12px);
}

.mobile-search-input-wrapper i { color: #8e8e93; font-size: 19px; }

#mobileSearchInput {
  flex: 1;
  background: none; border: none; outline: none;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  font-family: -apple-system, 'SF Pro Text', sans-serif;
}

#mobileSearchInput::placeholder { color: #8e8e93; }

.mobile-search-clear {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.22);
  color: #fff;
  border: none; border-radius: 50%;
  font-size: 16px; font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

#mobileSearchInput:not(:placeholder-shown) ~ .mobile-search-clear,
.mobile-search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}

.mobile-search-clear:active { background: rgba(255,255,255,0.35); }

/* Контент */
.mobile-search-results-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 120px;
}

/* Пустое состояние */
#mobileEmptyState {
  text-align: center;
  padding-top: 140px;
  color: #8e8e93;
  font-size: 18px;
  font-weight: 500;
}

#mobileEmptyState i {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.35;
  display: block;
}

/* Список результатов */
.mobile-autocomplete-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-autocomplete-list .autocomplete-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255,255,255,0.08);
  border-radius: 18px;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
}

.mobile-autocomplete-list .autocomplete-item:active {
  background: rgba(255,255,255,0.18);
  transform: scale(0.98);
}

.mobile-autocomplete-list .autocomplete-item img {
  width: 80px; height: 80px;
  border-radius: 18px;
  object-fit: cover;
  background: #1c1c1e;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.mobile-autocomplete-list .item-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-autocomplete-list .item-title strong { color: #0a84ff; }

.mobile-autocomplete-list .item-type {
  font-size: 13px;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.mobile-autocomplete-list .autocomplete-item small {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-left: auto;
}

/* Кнопка + — ИСПРАВЛЕНО! */
.mobile-autocomplete-list .autocomplete-add {
  width: 42px; height: 42px;
  background: #0a84ff;
  color: white;
  border-radius: 50%;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(10,132,255,0.4);
  transition: all 0.25s ease;
}

.mobile-autocomplete-list .autocomplete-add:active {
  transform: scale(0.9);
  background: #0077ed;
}

/* СВЕТЛАЯ ТЕМА — 100% Apple */
html[data-theme="light"] .mobile-search-sheet {
  background: rgba(255,255,255,0.96);
}

html[data-theme="light"] .mobile-search-input-wrapper {
  background: rgba(118,118,128,0.18);
}

html[data-theme="light"] #mobileSearchInput,
html[data-theme="light"] .mobile-autocomplete-list .item-title,
html[data-theme="light"] .mobile-autocomplete-list .autocomplete-item small {
  color: #000 !important;
}

html[data-theme="light"] .mobile-autocomplete-list .item-title strong { color: #007aff; }

html[data-theme="light"] .mobile-search-back,
html[data-theme="light"] .mobile-search-clear {
  background: rgba(0,0,0,0.1);
  color: #007aff;
}

html[data-theme="light"] .mobile-autocomplete-list .autocomplete-item {
  background: rgba(255,255,255,0.75);
}

html[data-theme="light"] .mobile-autocomplete-list .autocomplete-item:active {
  background: rgba(255,255,255,0.95);
}

html[data-theme="light"] #mobileEmptyState { color: #666; }
/* ===================================================== */
/* НИЖНИЙ БАР — ВСЕГДА ПОВЕРХ ШТОРКИ */
/* ===================================================== */

.mobile-bottom-bar {
  position: fixed !important;
  bottom: 0;
  left: 0;
  right: 0;
  height: 84px;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-primary, #fff);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.08);
  z-index: 9999 !important; /* САМОЕ ВАЖНОЕ — выше всего */
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bottom-bar-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: #8e8e93;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  min-width: 60px;
  position: relative;
}

.bottom-bar-btn i {
  font-size: 24px;
}

.bottom-bar-btn.active,
.bottom-bar-btn:active {
  color: #007aff;
}

.cart-count {
  position: absolute;
  top: 6px;
  right: 12px;
  background: #ff3b30;
  color: white;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Темная тема */
html[data-theme="dark"] .mobile-search-top,
html[data-theme="dark"] .mobile-search-results,
html[data-theme="dark"] .mobile-bottom-bar {
  background: rgba(28,28,30,0.92);
  border-color: rgba(255,255,255,0.1);
  color: #fff;
}

html[data-theme="dark"] .mobile-search-input-wrapper {
  background: rgba(255,255,255,0.12);
}

html[data-theme="dark"] .item-title,
html[data-theme="dark"] small {
  color: #fff;
}

html[data-theme="dark"] .autocomplete-item:active {
  background: rgba(255,255,255,0.08);
}

/* Адаптация под iPhone SE — ничего не обрезается */
@media (max-width: 380px) {
  .autocomplete-item img {
    width: 64px;
    height: 64px;
  }
  .autocomplete-add {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
}
/* ===================================================== */
/* МОБИЛЬНЫЙ ПОИСК — ПОЛНОСТЬЮ НЕПРОЗРАЧНАЯ ШТОРКА 2025 */
/* Чёрная в тёмной теме, белая в светлой — как в нативных приложениях */
/* ===================================================== */

/* ===================================================== */
/* МОБИЛЬНЫЙ ПОИСК — ФИНАЛЬНАЯ ВЕРСИЯ ДЛЯ iPhone SE и ВСЕХ ЭКРАНОВ */
/* Крестик есть ✓   Центровка идеальная ✓   Адаптация 100% ✓     */
/* ===================================================== */

.mobile-search-sheet {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.58s cubic-bezier(0.22, 1, 0.36, 1);
  overscroll-behavior: contain;
}

.mobile-search-sheet.active { transform: translateY(0); }

html[data-theme="light"] .mobile-search-sheet { background: #fff !important; }

/* Ручка сверху */
.sheet-handle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.45);
  border-radius: 2px;
  z-index: 10;
}
html[data-theme="light"] .sheet-handle { background: rgba(0,0,0,0.35); }

/* Хедер */
.mobile-search-header {
  position: relative;
  flex-shrink: 0;
  padding: 16px 12px 10px;
  padding-top: calc(16px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Кнопка ← */
.mobile-search-back {
  width: 40px;
  height: 40px;
  font-size: 21px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  flex-shrink: 0;
}
html[data-theme="light"] .mobile-search-back { background: rgba(0,0,0,0.1); color: #000; }

/* Строка ввода */
.mobile-search-input-wrapper {
  flex: 1;
  height: 42px;
  background: rgba(255,255,255,0.14);
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  position: relative;
}
html[data-theme="light"] .mobile-search-input-wrapper { background: rgba(0,0,0,0.08); }

.mobile-search-input-wrapper i { color: #888; font-size: 18px; }

#mobileSearchInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px !important;
  font-weight: 500;
}
html[data-theme="light"] #mobileSearchInput { color: #000 !important; }
#mobileSearchInput::placeholder { color: #888; }

/* КРЕСТИК ОЧИСТКИ — ВЕРНУЛСЯ И РАБОТАЕТ! */
.mobile-search-clear {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.22);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}
html[data-theme="light"] .mobile-search-clear { background: rgba(0,0,0,0.18); color: #000; }

/* Показываем крестик, когда есть текст */
#mobileSearchInput:not(:placeholder-shown) ~ .mobile-search-clear,
.mobile-search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ПУСТОЕ СОСТОЯНИЕ — ИДЕАЛЬНАЯ ЦЕНТРОВКА */
#mobileEmptyState {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.empty-content {
  text-align: center;
  width: 100%;
}

.empty-icon i {
  font-size: 68px;
  opacity: 0.25;
  color: #bbb;
  margin-bottom: 28px;
  display: block;
}
html[data-theme="light"] .empty-icon i { color: #ccc; }

.empty-title {
  font-size: 19px;
  font-weight: 600;
  color: #ddd;
  margin: 0 0 10px 0;
}
html[data-theme="light"] .empty-title { color: #111 !important; }

.empty-subtitle {
  font-size: 14px;
  color: #999;
  line-height: 1.45;
  max-width: 260px;
  margin: 0 auto;
}
html[data-theme="light"] .empty-subtitle { color: #666 !important; }

/* Адаптация под iPhone SE и меньше */
@media (max-width: 380px) {
  .empty-icon i { font-size: 60px; margin-bottom: 24px; }
  .empty-title { font-size: 18px; }
  .empty-subtitle { font-size: 13.5px; max-width: 240px; }
}
/* ПОЛНОЭКРАННАЯ ШТОРКА СВЕРХУ — НОУТБУКИ 1025–1887px */
.tablet-search-full {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color, #0f0f0f);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.tablet-search-full.active {
  transform: translateY(0);
}

.tablet-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
}

.tablet-search-header-full {
  position: relative;
  background: var(--bg-color, #0f0f0f);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  z-index: 2;
}

.tablet-search-back {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tablet-search-input-wrapper-full {
  flex: 1;
  height: 56px;
  background: rgba(255,255,255,0.1);
  border-radius: 18px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  backdrop-filter: blur(10px);
}

.tablet-search-input-wrapper-full i {
  color: #aaa;
  font-size: 20px;
}

#tabletSearchInput {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  outline: none;
}

#tabletSearchInput::placeholder { color: #888; }

.tablet-search-clear {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#tabletSearchInput:not(:placeholder-shown) ~ .tablet-search-clear {
  opacity: 1;
  pointer-events: auto;
}

.tablet-search-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 18px;
}

.tablet-search-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.tablet-autocomplete-list-full {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: none;
}

.tablet-autocomplete-list-full.active {
  display: block;
}

/* Светлая тема */
html[data-theme="light"] .tablet-search-full,
html[data-theme="light"] .tablet-search-header-full {
  background: #fff;
}

html[data-theme="light"] #tabletSearchInput { color: #000; }
html[data-theme="light"] .tablet-search-input-wrapper-full { background: rgba(0,0,0,0.08); }
html[data-theme="light"] .tablet-search-input-wrapper-full i { color: #666; }
html[data-theme="light"] .tablet-search-clear { background: rgba(0,0,0,0.15); color: #000; }
html[data-theme="light"] .tablet-search-back { background: rgba(0,0,0,0.1); color: #000; }
html[data-theme="light"] .tablet-search-header-full { border-bottom: 1px solid #eee; }

/* ===================================================== */
/* НОУТБУК (1025–1887px) — КРАСИВЫЕ КАРТОЧКИ ТОВАРОВ     */
/* Полноэкранная шторка — стиль Apple + Wildberries     */
/* ===================================================== */

.tablet-autocomplete-list-full {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 120px;
  background: transparent;
  -webkit-overflow-scrolling: touch;
}

/* Карточка товара — главное */
.tablet-autocomplete-list-full .autocomplete-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tablet-autocomplete-list-full .autocomplete-item:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Фото товара */
.tablet-autocomplete-list-full .autocomplete-item img {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  object-fit: cover;
  flex-shrink: 0;
  background: #111;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s ease;
}

.tablet-autocomplete-list-full .autocomplete-item:hover img {
  transform: scale(1.08);
}

/* Название и тип */
.tablet-autocomplete-list-full .item-title {
  font-size: 19px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.tablet-autocomplete-list-full .item-title strong {
  color: #5ac8fa;
  font-weight: 700;
}

.tablet-autocomplete-list-full .item-type {
  font-size: 13.5px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

/* Цена */
.tablet-autocomplete-list-full .autocomplete-item small {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

/* Кнопка "+" — как в Wildberries */
.tablet-autocomplete-list-full .autocomplete-add {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #007aff, #0066dd);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.45);
  transition: all 0.3s ease;
}

.tablet-autocomplete-list-full .autocomplete-add:hover {
  transform: scale(1.15);
  background: linear-gradient(135deg, #0066cc, #0044aa);
  box-shadow: 0 12px 36px rgba(0, 122, 255, 0.6);
}

.tablet-autocomplete-list-full .autocomplete-add:active {
  transform: scale(0.92);
}

/* Пустое состояние — красиво */
.tablet-search-empty {
  color: #888;
  font-size: 20px;
  font-weight: 500;
}

.tablet-search-empty i {
  font-size: 72px;
  margin-bottom: 24px;
  opacity: 0.35;
}

/* ===================================================== */
/* СВЕТЛАЯ ТЕМА — НОУТБУК ПОИСК                         */
/* ===================================================== */
html[data-theme="light"] .tablet-autocomplete-list-full .autocomplete-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .tablet-autocomplete-list-full .autocomplete-item:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .tablet-autocomplete-list-full .autocomplete-item img {
  background: #f7f7f7;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .tablet-autocomplete-list-full .item-title,
html[data-theme="light"] .tablet-autocomplete-list-full .autocomplete-item small {
  color: #000000;
}

html[data-theme="light"] .tablet-autocomplete-list-full .item-title strong {
  color: #007aff;
}

html[data-theme="light"] .tablet-autocomplete-list-full .item-type {
  color: #666666;
}

html[data-theme="light"] .tablet-search-empty {
  color: #666666;
}
/* ===================================================== */
/* ИСПРАВЛЕНИЕ БАГА: иконка поиска на ноутбуках 1025–1887px */
/* Должна оставаться круглой, НЕ расширяться!              */
/* ===================================================== */
/* ===================================================== */
/* ФИНАЛЬНОЕ ИСПРАВЛЕНИЕ: лупа НЕ РАСКРЫВАЕТСЯ на 1025–1887px */
/* Работает даже при светлой теме и любых !important       */
/* ===================================================== */

@media (min-width: 1025px) and (max-width: 1887px) {
  /* Сам контейнер — всегда 48×48, даже с классом .active */
  .search-container,
  .search-container.active {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
  }

  /* Полностью убиваем поле ввода и крестик */
  .search-container .search-input,
  .search-container.active .search-input,
  .search-container .search-clear,
  .search-container.active .search-clear {
    opacity: 0 !important;
    width: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  /* Лупа остаётся видимой и по центру */
  .search-container .search-icon,
  .search-container.active .search-icon {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Красивое наведение как у обычной иконки */
  .search-container:hover {
    transform: scale(1.12) !important;
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3) !important;
  }
}

/* Десктоп ≥1888px — оставляем старое поведение (расширение до 360px) */
@media (min-width: 1888px) {
  .search-container.active {
    width: 360px !important;
    border-radius: 24px !important;
  }
  

}

