/**
 * DRAK Search Overlay - Wyszukiwarka z autouzupełnianiem
 */

/* Overlay */
.drak-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.95);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(10px);
}

.drak-search-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Container */
.drak-search-container {
  width: 100%;
  max-width: 600px;
  padding: 0 20px;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.drak-search-overlay.active .drak-search-container {
  transform: translateY(0);
}

/* Close button - ukryty, zamykanie przez kliknięcie poza lub ESC */
.drak-search-close {
  display: none;
}

/* Input wrapper */
.drak-search-input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.drak-search-input-icon {
  display: none;
}

.drak-search-input {
  width: 100%;
  padding: 20px;
  font-size: 18px;
  font-family: 'Exo 2', sans-serif;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--draki-white, #fff);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drak-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.drak-search-input:focus {
  border-color: var(--draki-red, #dc2626);
  background: rgba(255, 255, 255, 0.08);
}

/* Ukryj domyślny X w input type search */
.drak-search-input::-webkit-search-cancel-button,
.drak-search-input::-webkit-search-decoration,
.drak-search-input::-webkit-search-results-button,
.drak-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.drak-search-input::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

/* Results */
.drak-search-results {
  max-height: 50vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--draki-red, #dc2626) rgba(255, 255, 255, 0.1);
}

.drak-search-results::-webkit-scrollbar {
  width: 6px;
}

.drak-search-results::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.drak-search-results::-webkit-scrollbar-thumb {
  background: var(--draki-red, #dc2626);
  border-radius: 3px;
}

/* Empty state */
.drak-search-results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.drak-search-results-empty svg {
  margin-bottom: 20px;
  opacity: 0.5;
}

.drak-search-results-empty p {
  font-size: 16px;
  margin: 0;
  font-family: 'Exo 2', sans-serif;
}

.drak-search-query {
  color: var(--draki-red, #dc2626);
  font-weight: 600;
}

/* Search groups */
.drak-search-group {
  margin-bottom: 20px;
}

.drak-search-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
  padding: 10px 15px;
  font-family: 'Exo 2', sans-serif;
  text-transform: uppercase;
}

/* Search items */
.drak-search-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  color: var(--draki-white, #fff);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s ease;
  font-family: 'Exo 2', sans-serif;
}

.drak-search-item:hover,
.drak-search-item.focused {
  background: rgba(255, 255, 255, 0.08);
}

.drak-search-item.focused {
  outline: 1px solid var(--draki-red, #dc2626);
}

.drak-search-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--draki-red, #dc2626);
  flex-shrink: 0;
}

.drak-search-item-name {
  font-size: 16px;
  font-weight: 500;
}

.drak-search-item-name mark {
  background: transparent;
  color: var(--draki-red, #dc2626);
  font-weight: 700;
}

/* Produkty w wynikach */
.drak-search-item--product {
  align-items: center;
}

.drak-search-item-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.drak-search-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drak-search-item-price {
  font-size: 14px;
  color: var(--draki-red, #dc2626);
  font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .drak-search-overlay {
    padding-top: 10vh;
  }

  .drak-search-close {
    top: 15px;
    right: 15px;
  }

  .drak-search-input {
    font-size: 16px;
    padding: 16px;
  }

  .drak-search-item {
    padding: 12px;
    gap: 12px;
  }

  .drak-search-item-icon {
    width: 36px;
    height: 36px;
  }

  .drak-search-item-name {
    font-size: 15px;
  }

  .drak-search-results {
    max-height: 60vh;
  }
}
