/* =============================================
   WC Header Search — лупичка + modal overlay
   ============================================= */

/* ── Лупичка бутон ── */
.wchs-trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  line-height: 1;
  vertical-align: middle;
}

.wchs-trigger:hover {
  opacity: 1;
  transform: scale(1.12);
}

/* ── Overlay — директно на body, покрива всичко ── */
.wchs-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999; /* над Elementor, над всичко */
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.wchs-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* ── Модал ── */
.wchs-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: 92%;
  max-width: 580px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  transform: translateY(-20px) scale(0.98);
  transition: transform 0.25s ease;
}

.wchs-overlay.is-active .wchs-modal {
  transform: translateY(0) scale(1);
}

/* Заглавие */
.wchs-modal__title {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin: 0 0 14px 0;
  padding-right: 32px;
}

/* ── Затвори бутон ── */
.wchs-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #999;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.wchs-close:hover {
  background: #f0f0f0;
  color: #222;
}

/* ── Скрий scroll на body ── */
body.wchs-no-scroll {
  overflow: hidden;
}

/* ── Select2 вътре в модала ── */
.wchs-wrap {
  width: 100%;
}

.wchs-wrap .select2-container {
  width: 100% !important;
}

.wchs-wrap .select2-container--default .select2-selection--single {
  height: 48px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  padding: 0 16px;
  transition: border-color 0.2s, background 0.2s;
}

.wchs-wrap .select2-container--default .select2-selection--single:hover,
.wchs-wrap .select2-container--default.select2-container--open .select2-selection--single {
  border-color: #333;
  background: #fff;
}

.wchs-wrap .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 48px;
  color: #777;
  padding: 0;
  font-size: 15px;
}

/* Скрий стрелката */
.wchs-wrap .select2-container--default .select2-selection--single .select2-selection__arrow {
  display: none;
}

/* ── Dropdown — anchorован в модала ── */
.wchs-modal .select2-dropdown {
  border-radius: 10px;
  border: 1px solid #e5e5e5;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  margin-top: 4px;
}

.wchs-modal .select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.wchs-modal .select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: #444;
}

/* ── Резултат ред ── */
.wchs-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.wchs-result__img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid #eee;
}

.wchs-result__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wchs-result__name {
  font-size: 14px;
  font-weight: 500;
  color: #222;
  line-height: 1.3;
}

.wchs-result__price {
  font-size: 13px;
  color: #d63031;
  font-weight: 600;
}

.wchs-result__price .woocommerce-Price-amount {
  color: #d63031;
}

/* Hover */
.wchs-modal .select2-container--default .select2-results__option--highlighted {
  background: #f5f5f5 !important;
  color: #222 !important;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .wchs-overlay {
    padding-top: 6vh;
  }

  .wchs-modal {
    width: 96%;
    padding: 20px 16px 18px;
    border-radius: 12px;
  }
}

/* ── Search row — поле + бутон ── */
.wchs-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wchs-search-row .wchs-wrap {
  flex: 1;
}

.wchs-search-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: none;
  background: #222;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
}

.wchs-search-btn:hover {
  background: #444;
  transform: scale(1.05);
}
