/* =========================
   SEARCH — CLEAN WORKING (ONE BLOCK)
   УДАЛИ ВСЕ СТАРЫЕ СТИЛИ ПОИСКА и вставь этот блок ОДИН РАЗ
   ========================= */

/* ---------- DESKTOP LEFT FILTER ---------- */
.catalog-filter{
  position: fixed;
  left: 18px;
  top: 190px;
  width: 260px;
  z-index: 999;
  display:block;
}

/* чтобы каталог не залезал под фильтр */
@media (min-width:901px){
  #catalog .grid#products{ margin-left: 300px; }
}

/* mobile: левый фильтр скрываем */
@media (max-width:900px){
  .catalog-filter{ display:none; }
  #catalog .grid#products{ margin-left:0; }
}

/* ---------- SEARCH FIELD (NO BOX, ONLY LINE) ---------- */
.search-dark{
  position: relative;
  height: 44px;

  /* ✅ без плашки/рамки/скругления */
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;

  display:flex;
  align-items:center;
  padding: 0 38px; /* слева лупа, справа крест */
}

/* лупа */
.search-dark::before{
  content:"";
  position:absolute;
  left:14px;
  top:50%;
  transform: translateY(-50%);
  width:22px;
  height:22px;
  background: rgba(255,255,255,.70);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10 2a8 8 0 105.293 14.293l3.707 3.707a1 1 0 001.414-1.414l-3.707-3.707A8 8 0 0010 2zm0 2a6 6 0 110 12a6 6 0 010-12z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10 2a8 8 0 105.293 14.293l3.707 3.707a1 1 0 001.414-1.414l-3.707-3.707A8 8 0 0010 2zm0 2a6 6 0 110 12a6 6 0 010-12z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* input */
.search-dark input{
  width:100%;
  height:100%;
  background: transparent;
  border:0;
  outline:0;
  color: rgba(255,255,255,.92);
  font-size:14px;
}
.search-dark input::placeholder{ color: rgba(255,255,255,.45); }

/* серая линия снизу (чтобы поле было видно) */
.search-dark::after{
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  bottom:6px;
  height:2px;
  border-radius:999px;
  background: rgba(255,255,255,.14);
}

/* оранжевая линия */
.search-line{
  position:absolute;
  left:12px;
  right:12px;
  bottom:6px;
  height:2px;
  border-radius:999px;
  background: rgba(255,138,26,.95);
  transform: scaleX(0);
  transform-origin:left;
  transition: transform .22s ease, opacity .22s ease;
  opacity:0;
  box-shadow: 0 0 10px rgba(255,138,26,.18);
}

/* крестик */
.search-clear{
  position:absolute;
  right:10px;
  top:50%;
  transform: translateY(calc(-50% - 2px));
  width:22px;
  height:22px;
  border-radius:999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  cursor:pointer;
  opacity:0;
  pointer-events:none;
  transition: opacity .15s ease, background .15s ease, border-color .15s ease;
}
.search-clear::before{
  content:"";
  position:absolute;
  inset:0;
  margin:auto;
  width:11px;
  height:11px;
  background: rgba(255,255,255,.78);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 5.71a1 1 0 010 1.41L13.41 12l4.89 4.88a1 1 0 01-1.42 1.42L12 13.41l-4.88 4.89a1 1 0 01-1.42-1.42L10.59 12L5.7 7.12A1 1 0 017.12 5.7L12 10.59l4.88-4.88a1 1 0 011.42 0z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 5.71a1 1 0 010 1.41L13.41 12l4.89 4.88a1 1 0 01-1.42 1.42L12 13.41l-4.88 4.89a1 1 0 01-1.42-1.42L10.59 12L5.7 7.12A1 1 0 017.12 5.7L12 10.59l4.88-4.88a1 1 0 011.42 0z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ✅ Оранжевое поведение (как раньше) */
.search-dark.is-focus::before,
.search-dark.has-value::before,
.search-dark.is-loading::before{
  background: rgba(255,138,26,.95);
}
.search-dark.is-focus .search-line,
.search-dark.has-value .search-line{
  transform: scaleX(1);
  opacity:1;
}

/* показываем крестик когда есть текст */
.search-dark.has-value .search-clear{
  opacity:1;
  pointer-events:auto;
}
.search-clear:hover{
  border-color: rgba(255,138,26,.95);
}
.search-clear:hover::before{
  background: rgba(255,138,26,.95);
}

/* ---------- SPINNER (если используешь загрузку) ---------- */
.search-spinner{
  position:absolute;
  right:10px;
  top:50%;
  transform: translateY(calc(-50% - 2px));
  width:22px;
  height:22px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.18);
  border-top-color: rgba(255,138,26,.95);
  opacity:0;
  pointer-events:none;
}
.search-dark.is-loading .search-clear{ opacity:0; pointer-events:none; }
.search-dark.is-loading .search-spinner{
  opacity:1;
  animation: searchSpin .7s linear infinite;
}
@keyframes searchSpin{
  to{ transform: translateY(calc(-50% - 2px)) rotate(360deg); }
}

/* ---------- MOBILE HEADER SEARCH BUTTON ---------- */
.header-searchBtn{
  display:none;
  width:46px;
  height:46px;
  border-radius:16px;
  border:1px solid rgba(11,18,32,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.58));
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(11,18,32,.10), inset 0 1px 0 rgba(255,255,255,.55);
  cursor:pointer;
  align-items:center;
  justify-content:center;
  padding:0;
  -webkit-tap-highlight-color: transparent;
}
.header-searchBtn__icon{
  width:26px;
  height:26px;
  display:block;
  background: rgba(11,18,32,.82);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10.5 3a7.5 7.5 0 105.01 13.04l3.22 3.22a1.2 1.2 0 001.7-1.7l-3.22-3.22A7.5 7.5 0 0010.5 3zm0 2.4a5.1 5.1 0 110 10.2a5.1 5.1 0 010-10.2z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10.5 3a7.5 7.5 0 105.01 13.04l3.22 3.22a1.2 1.2 0 001.7-1.7l-3.22-3.22A7.5 7.5 0 0010.5 3zm0 2.4a5.1 5.1 0 110 10.2a5.1 5.1 0 010-10.2z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.header-searchBtn:hover .header-searchBtn__icon{
  background: rgba(255,138,26,.95);
}

/* показываем лупу в шапке на мобилке и прижимаем к корзине */
@media (max-width:900px){
  .header-searchBtn{ display:inline-flex; margin-left:auto; }
  .header__row{ gap:6px; }
}

/* ---------- MOBILE SEARCH PAGE ---------- */
.mobile-searchPage{
  position: fixed;
  inset: 0;
  z-index: 200;
  color: #e9edf3;
  background: linear-gradient(180deg, #141618 0%, #101214 100%);
  transform: translateX(110%);
  transition: transform .22s ease;
  pointer-events:none;
  display:none;
  flex-direction: column;
  overflow: hidden;
}
@media (max-width:900px){
  .mobile-searchPage{
    display:flex;
  }
}

.mobile-searchPage__top{
  height: 64px;
  display:flex;
  align-items:center;
  gap:12px;
  padding: 0 14px;
  background: rgba(18,20,22,.96);
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.mobile-searchPage__back{
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 0;
  background: rgba(255,255,255,.06);
  color:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:8px;
  -webkit-tap-highlight-color: transparent;
  justify-content: center;
}

.mobile-searchPage__title{
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .2px;
}

.mobile-searchPage__body{
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.mobile-searchPage__hint{
  margin: 10px 2px 12px;
  color: rgba(233,237,243,.58);
}

/* lock body when search page open */
body.is-lock{
  overflow:hidden;
}

/* ---------- MOBILE RESULTS (tiles) ---------- */
.mobile-searchResults{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 0 18px;
  align-content: start;
}
@media (max-width:360px){
  .mobile-searchResults{ gap:10px; }
}

.msr-tile{
  position: relative;
  border-radius: 18px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
  overflow:hidden;
  min-height: 270px;

  display: flex;
  flex-direction: column;
  transition: box-shadow .18s ease, border-color .18s ease, filter .18s ease;
  
}

.msr-tile::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(260px 160px at 50% 10%, rgba(255,255,255,.045), transparent 70%),
    radial-gradient(240px 160px at 20% 30%, rgba(255,138,26,.06), transparent 72%);
  opacity:.7;
}
.msr-tile::before{ display:none !important; }

/* сбрасываем только msr-like (а не кнопку "В корзину") */
.msr-like{
  display:none !important;
  -webkit-appearance:none;
  appearance:none;
  background:transparent;
  border:0;
  box-shadow:none;
}

.msr-tile *{
  -webkit-tap-highlight-color: transparent;
}


.msr-badges{
  position:absolute;
  top:10px;
  left:10px;
  display:flex;
  gap:6px;
  z-index:2;
  flex-wrap:wrap;
  max-width: calc(100% - 54px);
}
.msr-badge{
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius:999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
}
.msr-badge--hit{
  background: rgba(255, 64, 64, .16);
  border-color: rgba(255, 64, 64, .28);
}
.msr-badge--sale{
  background: rgba(55, 210, 120, .14);
  border-color: rgba(55, 210, 120, .26);
}

.msr-photo{
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 10 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(238,242,247,.97));
  border: 1px solid rgba(11,18,32,.10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 8px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.96),
    0 10px 20px rgba(11,18,32,.06);
}

.msr-photo::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,0) 42%);
  pointer-events:none;
}

.msr-photo img{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .25s ease;
  transform: none;
  filter: none;
}

.msr-title{
  font-weight: 800;
  font-size: 14px;
  line-height: 1.18;
  color: rgba(233,237,243,.96);
  margin: 2px 2px 4px;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
  min-height: 28px;
}
.msr-weight{
  font-size: 12px;
  color: rgba(233,237,243,.60);
  margin: 0 2px 10px;
}

.msr-buy{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.msr-pricePill{
  border-radius: 12px;
  padding: 9px 10px;
  font-weight: 800;
  text-align:center;
  font-size: 14px;  
  color: rgba(233,237,243,.62);

  border: 0;                 /* ✅ убрали обводку */
  background: transparent;   /* ✅ убрали плашку (если хочешь оставить плашку — удали эту строку) */
}

.msr-add{
  border: 0;
  height: 38px;
  border-radius: 11px;
  cursor:pointer;

 font-weight: 800;     /* или 500 если хочешь ещё тоньше */
font-size: 14px;
letter-spacing: 0; /* чуть “дороже” */
  color:#fff;

  background: linear-gradient(180deg, rgba(255,138,26,.98), rgba(201,95,8,.98));
  box-shadow: 0 14px 26px rgba(255,138,26,.18);

  /* ✅ ЦЕНТРОВКА ТЕКСТА */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  padding: 0 12px !important;

  /* на всякий случай, если где-то задано */
  white-space: nowrap;
}

.msr-add:active{ filter: brightness(.96); }

/* =========================
   EXTRA POLISH (MOBILE CARDS)
   вставить сюда: после .msr-add и до @media (min-width:901px)
   ========================= */

.msr-tile:active{
  filter: brightness(.98);
}
.msr-tile:hover{
  border-color: rgba(255,138,26,.22);
  box-shadow: 0 18px 40px rgba(0,0,0,.34);
}

/* 3) Убрать дубль названия (если сверху повторяется) */
.msr-tile > .msr-title:first-of-type{
  display:none;
}

/* =========================
   FIX: DESKTOP search visible on LIGHT background
   (мобилку не трогаем)
   ========================= */
@media (min-width:901px){
  .search-dark input{
    color: rgba(11,18,32,.92) !important;
  }
  .search-dark input::placeholder{
    color: rgba(11,18,32,.42) !important;
  }

  /* нижняя “серая” линия на светлом фоне */
  .search-dark::after{
    background: rgba(11,18,32,.18) !important;
  }

  /* лупа в обычном состоянии — тёмная, чтобы была видна */
  .search-dark::before{
    background: rgba(11,18,32,.55) !important;
  }

  /* крестик (когда появляется) */
  .search-clear{
    border-color: rgba(11,18,32,.18) !important;
    background: rgba(11,18,32,.06) !important;
  }
  .search-clear::before{
    background: rgba(11,18,32,.70) !important;
  }

  /* ✅ при фокусе/значении лупа остаётся оранжевой как ты хотел */
  .search-dark.is-focus::before,
  .search-dark.has-value::before,
  .search-dark.is-loading::before{
    background: rgba(255,138,26,.95) !important;
  }
}/* FIX: orange hover for X (desktop only) */
@media (min-width:901px){
  .search-clear:hover{
    border-color: rgba(255,138,26,.95) !important;
    background: rgba(255,138,26,.12) !important; /* приятная подсветка */
  }
  .search-clear:hover::before{
    background: rgba(255,138,26,.95) !important;
  }
}

/* FIX: "Назад" — твоя точная посадка */
.mobile-searchPage__back{
  display:flex;
  align-items:center;
}

.mobile-searchPage__backText{
  display:inline-block;
  line-height: 1;
  transform: translateY(2px); /* 1–4px */
  margin-left: -8px;          /* 2–8px */
}
/* =========================================
   MOBILE SEARCH — FINAL CLEAN
   ========================================= */
@media (max-width:900px){
  .mobile-searchPage{
    top: 64px;
    bottom: 0;
    height: calc(100vh - 64px);
    z-index: 40;
    display: flex;
  }

  .mobile-searchPage.is-open{
    transform: translateX(0);
    pointer-events: auto;
  }

  .mobile-searchPage__top{
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    flex: 0 0 auto;
  }

  .mobile-searchPage__body{
    overscroll-behavior: contain;
  }

  body.mobile-search-open .header{
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.mobile-search-open .header--hidden{
    transform: translateY(0) !important;
  }

  body.mobile-search-open{
    overflow: hidden;
  }

  body.mobile-search-open #catalog,
  body.mobile-search-open .catalog,
  body.mobile-search-open .catalogFrame{
    pointer-events: none;
  }
}