.wds-search-form-wrapper {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  padding: 20px;
}

.wds-search-form-wrapper .input-group {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-radius: 50px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: #fff;
}

.wds-search-form-wrapper .input-group:focus-within {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.wds-search-form-wrapper .form-control.search-field {
  border: none;
  padding: 10px 5px; /* Comfortable padding */
  height: 60px; /* Taller input */
  font-size: 16px;
  background: transparent;
}

.wds-search-form-wrapper .form-control.search-field:focus {
  box-shadow: none;
  outline: none;
  padding: 10px 25px !important;
}

@media (max-width: 991px) {
  a.wds-search-toggle.wds-desktop-search-trigger,
  i.fas.fa-search {
    display: none !important;
  }
}

.wds-search-form-wrapper .btn {
  padding: 0 30px;
  border: none;
  border-radius: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.wds-search-form-wrapper .btn i {
  font-size: 16px;
}

/* Search Results Page Tweaks */
.wds-search-header {
  background: #f8f9fa;
  padding: 3rem 0;
  margin-bottom: 3rem;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.wds-search-header h1 {
  font-weight: 800;
  color: #333;
}

/* Menu Item Icon */
li.wds-menu-search-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
}

li.wds-menu-search-item a i {
  font-size: 18px;
  color: inherit;
}

/* Fullscreen Search Overlay */
.wds-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.wds-search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.wds-search-overlay .wds-search-container {
  width: 100%;
  max-width: 800px;
  padding: 20px;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.wds-search-overlay.active .wds-search-container {
  transform: scale(1);
}

.wds-search-close {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 40px;
  color: #333;
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wds-search-close:hover {
  color: #e4002b; /* Assuming brand color or red */
  transform: rotate(90deg);
}

/* Override form styles for overlay */
.wds-search-overlay .wds-search-form-wrapper {
  max-width: 100%;
}

.wds-search-overlay .form-control.search-field {
  height: 80px;
  font-size: 24px;
  border-bottom: 2px solid #ddd !important;
  border-radius: 0;
  padding: 0;
  box-shadow: none !important;
}

.wds-search-overlay .input-group {
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

.wds-search-overlay .btn {
  font-size: 20px;
  background: transparent;
  color: #333;
  padding: 0;
}

.wds-search-overlay .btn:hover {
  color: #e4002b;
  background: transparent;
}

/* Manual Search Icon */
.wds-manual-search-icon {
  display: inline-block;
  padding: 10px;
  font-size: 18px;
  color: inherit;
  cursor: pointer;
}

.wds-search-form-wrapper .form-control.search-field:focus {
  padding: 0 15px !important;
}

button.btn.btn-primary {
  background-color: #2196f3 !important;
  color: #ffffff !important;
  padding: 0 15px !important;
}

/* Fix Mobile/Sidebar Menu Appearance */
@media (max-width: 991px) {
  li.wds-menu-search-item a {
    justify-content: flex-start !important; /* Align left to match text items */
    padding: 15px 0 !important; /* Vertical spacing */
    width: 100%;
    font-size: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Subtle separator */
  }

  li.wds-menu-search-item a i {
    font-size: 20px; /* Larger icon on mobile */
    width: 30px; /* Fixed width for alignment */
  }

  /* Ensure the list item itself takes space */
  li.wds-menu-search-item {
    display: block;
    width: 100%;
  }
}

/* Styles for the Search Label */
.wds-menu-label {
  margin-left: 10px;
  display: inline-block;
}

/* Hide label on desktop (if desired, generally > 992px) */
@media (min-width: 992px) {
  .wds-menu-label {
    display: none;
  }
}

/* Mobile Direct Search Box Logic */
.wds-mobile-search-form {
  display: none; /* Hidden by default (desktop) */
  padding: 10px 0;
}

.wds-desktop-search-trigger {
  display: flex; /* Visible by default */
}

@media (max-width: 991px) {
  /* Hide the clickable icon/link on mobile */
  .wds-desktop-search-trigger {
    display: none !important;
  }

  /* Show the form directly on mobile */
  .wds-mobile-search-form {
    display: block !important;
    width: 100%;
  }

  /* Adjust the form style for the menu sidebar context */
  .wds-mobile-search-form .wds-search-form-wrapper {
    padding: 0;
    max-width: 100%;
    margin: 0;
  }

  .wds-mobile-search-form .input-group {
    box-shadow: none;
    border: 1px solid #eee;
  }

  .wds-mobile-search-form .form-control.search-field {
    height: 45px; /* Smaller height for mobile menu */
    font-size: 14px;
  }

  .wds-mobile-search-form .btn {
    height: 45px;
    padding: 0 15px;
  }
}

/* Mobile Injection Fixes */
@media (max-width: 991px) {
  /* Hide the original magnifying glass link in mobile menu */
  .wds-menu-search-item > a.wds-desktop-search-trigger {
    display: none !important;
  }

  /* Ensure the injected form stays visible and looks good */
  .wds-mobile-search-injected {
    display: block !important;
    width: 100%;
    padding: 10px 15px;
    background: #fdfdfd;
    border-top: 1px solid #eee;
  }

  .wds-mobile-search-injected .input-group {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  }
}

/* On desktop, keep the injected form hidden if it exists */
@media (min-width: 992px) {
  .wds-mobile-search-injected {
    display: none !important;
  }
}

/* Premium Mobile Injection Styles */
.wds-mobile-input-group {
  display: flex;
  align-items: center;
  background: #f1f3f5;
  border-radius: 50px;
  padding: 5px;
  margin: 10px 0;
  width: 100%;
}

.wds-mobile-search-field {
  background: transparent;
  border: none;
  padding: 10px 15px;
  flex-grow: 1;
  font-size: 14px;
  outline: none !important;
  color: #333;
}

.wds-mobile-search-btn {
  background: #2196f3;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s;
  cursor: pointer;
}

.wds-mobile-search-btn:hover {
  background: #1976d2;
}

@media (max-width: 991px) {
  .wds-mobile-search-injected {
    display: block !important;
    padding: 5px 15px;
  }
}

/* Ultimate Mobile Hide for Icons/Links in Search Item */
@media (max-width: 991px) {
  /* Hide EVERY link and icon inside the search menu item on mobile */
  .wds-menu-search-item a,
  .wds-menu-search-item i,
  .wds-menu-search-item .fas,
  .wds-menu-search-item .fa {
    display: none !important;
  }

  /* Ensure the search box is definitely visible */
  .wds-mobile-search-injected,
  .wds-mobile-search-form {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Refined Mobile Input Group Styles */
.wds-mobile-input-group {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 50px;
  overflow: hidden;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wds-mobile-input-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
}

.wds-mobile-search-field {
  width: 100%;
  border: none !important;
  padding: 10px 20px;
  font-size: 14px;
  background: transparent !important;
  outline: none !important;
  height: 48px;
}

.wds-mobile-search-btn {
  background: #2196f3 !important;
  color: #fff !important;
  border: none !important;
  padding: 0 25px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  border-radius: 0; /* Let group provide rounding */
}

.wds-mobile-search-btn:hover {
  background: #1976d2 !important;
}

@media (max-width: 991px) {
  .wds-mobile-search-injected {
    display: block !important;
    padding: 0 15px;
    width: 100%;
  }
}
input#woocommerce-product-search-field-0 {
  background-color: #ffffff !important;
}
