.pf-search-form {
  width: 100%;
  transition: all 0.3s ease;
}

.pf-search-form.active {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  z-index: 9999999 !important;
}

.pf-search-wrapper {
  position: relative;
  width: 100%;
  transition: all 0.3s ease;
}

.pf-search-input {
  width: 100%;
  height: 38px;
  padding: 0 42px 0 14px;
  border-radius: 20px;
  border: none;
  outline: none;
  background: #3f4549ff;
  color: #fff;
  font-size: 14px;
  transition: all 0.3s ease;
}

.pf-search-wrapper.active .pf-search-input {
  height: 50px;
  background: #212529;
  font-size: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding-left: 45px;
  padding-right: 45px;
}

.pf-search-input::placeholder {
  color: #b5b5b5;
}

.pf-search-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
}

.pf-search-form.active .pf-search-btn {
  display: none !important;
}

.pf-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
}

.pf-search-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.pf-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  background: #f8f9fa;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.25s ease;
  z-index: 10;
}

.pf-search-wrapper.active .pf-search-results {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pf-search-product-images {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 5px 5px 15px 5px;
}

.pf-search-product-card {
  width: 160px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}

.pf-search-product-image {
  width: 100%;
  height: 120px;
  object-fit: contain;
}

.pf-search-product-name {
  font-size: 14px;
  font-weight: 600;
}

.pf-search-category {
  cursor: pointer;
  padding: 20px 16px;
  background-color: #e9ecef;
  border-radius: 20px;
  font-size: 15px;
}

.pf-search-back-btn {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  font-size: 20px;
  color: #fff;
  cursor: pointer;
  display: none;
}

.pf-search-form.active .pf-search-back-btn {
  display: block !important;
}

.pf-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.pf-search-form.active .pf-search-input::-webkit-search-cancel-button {
  display: block;
  -webkit-appearance: none;
  height: 25px;
  width: 25px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  margin-right: -35px;
}

.pf-search-form.active
  .pf-search-input:placeholder-shown::-webkit-search-cancel-button {
  display: none;
}

.pf-search-category-list {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 15px;
}

.pf-search-category {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 1199.98px) {
  .pf-search-input:not(.active)::placeholder {
    color: transparent !important;
  }

  .pf-search-input:not(.active) {
    background: transparent !important;
    width: 45px !important;
    height: 45px !important;
    padding: 0 !important;
    border: none !important;
    cursor: pointer;
    color: transparent !important;
  }

  .pf-search-wrapper:not(.active) .pf-search-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-size: 22px;
    display: block !important;
    opacity: 1;
  }

  .pf-search-form.active .pf-search-input {
    width: 100% !important;
    height: 50px !important;
    background: #212529 !important;
    padding-left: 45px !important;
    padding-right: 45px !important;
    color: #fff !important;
    border-radius: 25px !important;
  }

  .pf-search-form.active .pf-search-input::placeholder {
    color: #b5b5b5 !important;
  }
}
