/* Modern CSS variables and reset for Pet Pro Home Search */
:root {
  --ppf-home-primary: #F03E74;
  --ppf-home-primary-shadow: rgba(240, 62, 116, 0.2);
  --ppf-home-bg-color: #F9FAFB;
  --ppf-home-card-bg: #FFFFFF;
  --ppf-home-field-bg: #F9FAFB;
  --ppf-home-text-main: #374151;
  --ppf-home-text-muted: #9CA3AF;
  --ppf-home-border-color: #F3F4F6;
  --ppf-home-border-focus: #E5E7EB;
  --ppf-home-shadow-widget: 0 8px 30px rgba(0, 0, 0, 0.08);
  --ppf-home-shadow-dropdown: 0 12px 32px rgba(0, 0, 0, 0.15);
  --ppf-home-font-family: 'Plus Jakarta Sans', sans-serif;
}

/* BEM: Search Widget Block */
.search-widget {
  background-color: var(--ppf-home-card-bg);
  border-radius: 24px;
  padding: 12px;
  box-shadow: var(--ppf-home-shadow-widget);
  border: 1px solid #FFE4E6; /* rose-50 */
  position: relative;
  z-index: 10;
  box-sizing: border-box;
  font-family: var(--ppf-home-font-family);
  margin: 20px auto;
  max-width: 896px;
}

.search-widget__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 768px) {
  .search-widget__form {
    flex-direction: row;
    align-items: stretch;
  }
}

/* Elements: Field */
.search-widget__field {
  width: 100%;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  border-radius: 16px;
  background-color: var(--ppf-home-field-bg);
  border: 1px solid var(--ppf-home-border-color);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.search-widget__field:focus-within {
  border-color: #FCA5A5; /* border-rose-300 / red-300 */
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px #FFE4E6; /* ring-rose-100 */
}

@media (min-width: 768px) {
  .search-widget__field {
    flex: 1;
    min-width: 0;
  }
}

.search-widget__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ppf-home-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: block;
  line-height: 1;
}

.search-widget__input-group {
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-widget__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--ppf-home-primary);
}

.search-widget__input {
  width: 100%;
  min-width: 0;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  font-family: inherit;
  font-size: 15px;
  color: var(--ppf-home-text-main);
  margin-left: 10px;
  padding: 0 !important;
  height: 24px;
  line-height: normal;
  box-sizing: border-box;
}

.search-widget__input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.search-widget__input::placeholder {
  color: var(--ppf-home-text-muted);
}

.search-widget__chevron {
  color: var(--ppf-home-text-muted);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

/* Element: Divider */
.search-widget__divider {
  display: none;
}

@media (min-width: 768px) {
  .search-widget__divider {
    display: block;
    width: 1px;
    background-color: #E5E7EB; /* gray-200 */
    flex-shrink: 0;
    align-self: stretch;
    margin: 8px 0;
  }
}

/* Element: Action / Button */
.search-widget__action {
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.search-widget__button {
  width: 100%;
  color: #FFFFFF;
  background-color: var(--ppf-home-primary);
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 10px 15px -3px var(--ppf-home-primary-shadow), 0 4px 6px -4px var(--ppf-home-primary-shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

.search-widget__button:hover {
  background-color: #e03265;
  transform: translateY(-1px);
}

.search-widget__button:active {
  transform: scale(0.98);
}

@media (min-width: 768px) {
  .search-widget__button {
    width: auto;
  }
}

/* Element: Dropdown Suggestions Box */
.search-widget__dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 12px;
  background-color: var(--ppf-home-card-bg);
  border-radius: 16px;
  box-shadow: var(--ppf-home-shadow-dropdown);
  border: 1px solid var(--ppf-home-border-color);
  overflow: hidden;
  z-index: 200;
}

/* Modifier: Hidden dropdown state */
.search-widget__dropdown--hidden {
  display: none;
}

.search-widget__list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  max-height: 320px;
  overflow-y: auto;
}

/* Reset heredado del tema sobre los <li> dentro del dropdown */
.search-widget__list .search-widget__item {
  margin: 0 !important;
  padding: 12px 16px !important;
  list-style: none !important;
  padding-left: 16px !important;
}

/* Custom Scrollbar for suggestions */
.search-widget__list::-webkit-scrollbar {
  width: 6px;
}

.search-widget__list::-webkit-scrollbar-thumb {
  background-color: #E5E7EB;
  border-radius: 10px;
}

.search-widget__list::-webkit-scrollbar-track {
  background: transparent;
}

/* Suggestions Items */
.search-widget__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: left;
}

.search-widget__item:hover,
.search-widget__item--active {
  background-color: #FFF1F2; /* rose-50 */
}

.search-widget__item--empty {
  color: var(--ppf-home-text-muted);
  cursor: default;
  justify-content: center;
  text-align: center;
  font-style: italic;
  padding: 16px;
}

.search-widget__item--empty:hover {
  background-color: transparent;
}

.search-widget__item-icon-box {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modifiers for suggestions item icon colors */
.search-widget__item-icon-box--service {
  background-color: #FEF3C7; /* amber-100 */
}

.search-widget__item-icon-box--location {
  background-color: #FCE7F3; /* pink-100 */
}

.search-widget__item-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.search-widget__item-text {
  color: var(--ppf-home-text-main);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
