/**
 * Search Bar - Elegancka wyszukiwarka fullscreen
 */

/* ===============================================
   UKRYJ STARY OVERLAY
   =============================================== */
.search-overlay,
#searchOverlay {
  display: none !important;
}

/* ===============================================
   PANEL WYSZUKIWARKI - FULLSCREEN OVERLAY
   =============================================== */
.search-panel {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: rgba(1, 34, 65, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: none !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

/* ===============================================
   PANEL AKTYWNY
   =============================================== */
.search-panel.search-panel--toggled {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding-top: 15vh !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ===============================================
   TYTUŁ WYSZUKIWARKI
   =============================================== */
.search-panel.search-panel--toggled::before {
  content: 'Czego szukasz?';
  display: block;
  color: #fff;
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
  letter-spacing: 1px;
}

/* ===============================================
   KONTENER WYSZUKIWARKI
   =============================================== */
.search-panel .dgwt-wcas-search-wrapp {
  width: 90% !important;
  max-width: 650px !important;
  margin: 0 auto !important;
  background: #fff !important;
  border-radius: 60px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.1) !important;
  position: relative !important;
  z-index: 10 !important;
  overflow: hidden !important;
}

/* ===============================================
   FORMULARZ
   =============================================== */
.search-panel .dgwt-wcas-search-wrapp form {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.search-panel .dgwt-wcas-sf-wrapp {
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  border-radius: 60px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  position: relative !important;
}

/* ===============================================
   INPUT WYSZUKIWARKI
   =============================================== */
.search-panel .dgwt-wcas-search-input,
.search-panel input.dgwt-wcas-search-input,
.search-panel .dgwt-wcas-sf-wrapp input[type="search"],
.search-panel input[type="search"].dgwt-wcas-search-input {
  width: 100% !important;
  height: 70px !important;
  min-height: 70px !important;
  max-height: 70px !important;
  padding: 20px 60px 20px 70px !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  color: #333 !important;
  background: #fff !important;
  border: none !important;
  border-radius: 60px !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  line-height: normal !important;
  margin: 0 !important;
}

.search-panel .dgwt-wcas-search-input::placeholder {
  color: #aaa !important;
  font-size: 18px !important;
  font-weight: 400 !important;
}

.search-panel .dgwt-wcas-search-input:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  height: 70px !important;
  min-height: 70px !important;
  max-height: 70px !important;
}

/* ===============================================
   IKONA LUPY
   =============================================== */
.search-panel .dgwt-wcas-sf-wrapp::before {
  content: '';
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23205bab' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 10;
  pointer-events: none;
}

/* Ukryj oryginalną ikonę pluginu */
.search-panel .dgwt-wcas-ico-magnifier,
.search-panel .dgwt-wcas-ico-magnifier-handler {
  display: none !important;
}

/* ===============================================
   UKRYJ PRZYCISK SUBMIT PLUGINU
   =============================================== */
.search-panel .dgwt-wcas-search-submit,
.search-panel button.dgwt-wcas-search-submit {
  display: none !important;
}

/* ===============================================
   PRZYCISK ZAMKNIJ (X)
   =============================================== */
.search-close-btn {
  position: fixed !important;
  top: 40px !important;
  right: 40px !important;
  width: 60px !important;
  height: 60px !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1000000 !important;
  transition: all 0.3s ease !important;
  font-size: 0 !important;
}

.search-panel.search-panel--toggled .search-close-btn {
  display: flex !important;
}

.search-close-btn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: rotate(90deg) !important;
}

.search-close-btn::before,
.search-close-btn::after {
  content: '' !important;
  position: absolute !important;
  width: 24px !important;
  height: 3px !important;
  background: #fff !important;
  border-radius: 3px !important;
}

.search-close-btn::before {
  transform: rotate(45deg) !important;
}

.search-close-btn::after {
  transform: rotate(-45deg) !important;
}

/* ===============================================
   WYNIKI WYSZUKIWANIA
   =============================================== */
.search-panel .dgwt-wcas-suggestions-wrapp {
  position: absolute !important;
  top: calc(100% + 15px) !important;
  left: 0 !important;
  right: 0 !important;
  background: #fff !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
  max-height: 50vh !important;
  overflow-y: auto !important;
  z-index: 1000001 !important;
  border: none !important;
}

/* Global suggestions (może być poza panelem) */
.dgwt-wcas-suggestions-wrapp {
  background: #ffffff !important;
  border-radius: 24px !important;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2) !important;
  border: none !important;
  z-index: 1000001 !important;
  overflow: hidden !important;
}

/* Upewnij się że kontener ma białe tło niezależnie od klas */
.dgwt-wcas-suggestions-wrapp.woocommerce,
.dgwt-wcas-suggestions-wrapp.dgwt-wcas-has-img,
.dgwt-wcas-suggestions-wrapp.dgwt-wcas-has-headings,
.dgwt-wcas-suggestions-wrapp.js-dgwt-wcas-initialized {
  background: #ffffff !important;
  border-radius: 24px !important;
  overflow: hidden !important;
}

.dgwt-wcas-suggestion {
  padding: 15px 24px !important;
  border-bottom: 1px solid #f0f0f0 !important;
  transition: background 0.2s ease !important;
}

.dgwt-wcas-suggestion:last-child {
  border-bottom: none !important;
}

.dgwt-wcas-suggestion:hover,
.dgwt-wcas-suggestion-selected {
  background: #f5f8fc !important;
}

.dgwt-wcas-st-title {
  font-weight: 500 !important;
  color: #222 !important;
  font-size: 15px !important;
}

.dgwt-wcas-sp {
  color: #1C5EA8 !important;
  font-weight: 700 !important;
  font-size: 15px !important;
}

.dgwt-wcas-si {
  border-radius: 12px !important;
  overflow: hidden !important;
}

.dgwt-wcas-st-headline {
  background: #f8f9fa !important;
  color: #666 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  padding: 12px 24px !important;
}

/* Preloader / Close */
.search-panel .dgwt-wcas-preloader {
  right: 25px !important;
}

.search-panel .dgwt-wcas-close {
  right: 25px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

/* ===============================================
   PODPOWIEDŹ POD WYSZUKIWARKĄ
   =============================================== */
.search-panel.search-panel--toggled::after {
  content: 'Wpisz nazwę produktu, markę lub kategorię';
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin-top: 20px;
  text-align: center;
}

/* ===============================================
   MOBILE - DO 768px
   =============================================== */
@media screen and (max-width: 768px) {
  .search-panel.search-panel--toggled {
    padding-top: 12vh !important;
  }
  
  .search-panel.search-panel--toggled::before {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  .search-panel .dgwt-wcas-search-wrapp {
    width: 92% !important;
    border-radius: 50px !important;
  }
  
  .search-panel .dgwt-wcas-search-input,
  .search-panel input.dgwt-wcas-search-input,
  .search-panel .dgwt-wcas-sf-wrapp input[type="search"],
  .search-panel input[type="search"].dgwt-wcas-search-input {
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    padding: 15px 50px 15px 55px !important;
    font-size: 16px !important;
    line-height: normal !important;
  }
  
  .search-panel .dgwt-wcas-search-input:focus {
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
  }
  
  .search-panel .dgwt-wcas-search-input::placeholder {
    font-size: 15px !important;
  }
  
  .search-panel .dgwt-wcas-sf-wrapp::before {
    left: 20px;
    width: 22px;
    height: 22px;
  }
  
  .search-close-btn {
    top: 20px !important;
    right: 20px !important;
    width: 50px !important;
    height: 50px !important;
  }
  
  .search-close-btn::before,
  .search-close-btn::after {
    width: 20px !important;
    height: 2px !important;
  }
  
  .search-panel .dgwt-wcas-suggestions-wrapp {
    border-radius: 20px !important;
    max-height: 45vh !important;
  }
  
  .search-panel.search-panel--toggled::after {
    font-size: 12px;
    margin-top: 15px;
    padding: 0 20px;
  }
}

/* ===============================================
   TABLET - 769px - 1024px
   =============================================== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .search-panel.search-panel--toggled {
    padding-top: 18vh !important;
  }
  
  .search-panel .dgwt-wcas-search-wrapp {
    max-width: 600px !important;
  }
}

/* ===============================================
   BLOKADA SCROLL BODY
   =============================================== */
body.search-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
}

/* ===============================================
   MOBILE OVERLAY PLUGIN
   =============================================== */
.dgwt-wcas-overlay-mobile-on .dgwt-wcas-om-bar {
  background: #fff !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.dgwt-wcas-om-return {
  background: #1C5EA8 !important;
  border-radius: 50% !important;
}

/* ===============================================
   ANIMACJA WEJŚCIA
   =============================================== */
@keyframes searchFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-panel.search-panel--toggled .dgwt-wcas-search-wrapp {
  animation: searchFadeIn 0.4s ease forwards;
}
