/* BSB Pesquisa - Widget Styles */

.bsb-search-widget-container {
  position: relative;
  display: inline-block;
  font-family: inherit;
}

/* Toggle Button */
button.bsb-search-toggle {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

button.bsb-search-toggle:hover {
  background: rgb(255 255 255 / 10%);
}

.bsb-search-toggle svg {
  width: 18px;
  height: 18px;
}

/* The Panel (Input + Dropdown) */
.bsb-search-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 400px;
  background: #fff;
  /* border: 1px solid #eee; */
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  border-radius: 0px;
  z-index: 9999;
  margin-top: 10px;
  overflow: hidden;
}

/* Inside Panel Input */
.bsb-search-input {
  flex-grow: 1;
  border: none !important;
  background: transparent;
  padding: 15px 0 !important;
  font-size: 16px !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--e-global-color-1f7a474);
}

.bsb-search-panel .bsb-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px;
  /* border-bottom: 1px solid #f0f0f0; */
  background: #fff;
}

.bsb-search-panel .bsb-search-input-wrapper svg {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 3px;
}

.bsb-search-icon {
  width: 20px;
  height: 20px;
  color: #666;
  margin-right: 10px;
  flex-shrink: 0;
}

.bsb-search-input {
  flex-grow: 1;
  border: none !important;
  background: transparent;
  padding: 15px 0 !important;
  font-size: 16px !important;
  outline: none !important;
  box-shadow: none !important;
  color: #333;
}

.bsb-search-close-btn {
  background: transparent;
  border: none !important;
  padding: 0px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.bsb-search-close-btn:hover {
  background: var(--e-global-color-fe7ff33);
}

.bsb-search-close-btn svg {
  width: 24px;
  height: 24px;
}

/* Results Area */
.bsb-search-results-dropdown {
  border-top: 1px solid var(--e-global-color-65d0ca5);
  background: #fff;
  max-height: 400px;
  overflow-y: auto;
}

/* Highlighting */
.bsb-search-item-title .highlight {
  background-color: #dcd2c6;
  padding: 0 2px;
  border-radius: 2px;
}

/* Loading & Empty */
.bsb-search-loading,
.bsb-search-no-results,
.bsb-search-error {
  padding: 20px;
  text-align: center;
  color: #666;
}
.bsb-search-loading .spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top-color: #333;
  border-radius: 50%;
  animation: bsb-spin 1s linear infinite;
}
@keyframes bsb-spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Skeleton Loader */
.bsb-search-skeleton-wrapper {
  padding: 0;
}
.bsb-skeleton-group {
  border-bottom: 1px solid #f5f5f5;
  padding: 15px 20px;
}
.bsb-skeleton-group:last-child {
  border-bottom: none;
}
.bsb-skeleton-title {
  width: 80px;
  height: 14px;
  border-radius: 3px;
  margin-bottom: 15px;
}
.bsb-skeleton-item {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}
.bsb-skeleton-item:last-child {
  margin-bottom: 0;
}
.bsb-skeleton-thumb {
  width: 30px;
  height: 40px;
  border-radius: 3px;
  flex-shrink: 0;
}
.bsb-skeleton-text {
  flex-grow: 1;
  height: 16px;
  border-radius: 3px;
  margin-right: 15px;
}

/* Shimmer Animation */
.bsb-shimmer {
  background: #f6f7f8;
  background-image: linear-gradient(
    to right,
    #f6f7f8 0%,
    #edeef1 20%,
    #f6f7f8 40%,
    #f6f7f8 100%
  );
  background-repeat: no-repeat;
  background-size: 800px 100%;
  animation-duration: 1s;
  animation-fill-mode: forwards;
  animation-iteration-count: infinite;
  animation-name: placeholderShimmer;
  animation-timing-function: linear;
}

@keyframes placeholderShimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

/* Groups and Items */
.bsb-search-group {
  border-bottom: 1px solid #f5f5f5;
  padding: 12px 24px;
}
.bsb-search-group:last-child {
  border-bottom: none;
}

.bsb-search-group-title {
  font-size: 16px;
  color: var(--e-global-color-1f7a474);
  text-transform: capitalize;
}

.bsb-search-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bsb-search-item {
  margin-bottom: 10px;
}
.bsb-search-item:last-child {
  margin-bottom: 0;
}

.bsb-search-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: #333;
  padding: 5px 0;
  transition: opacity 0.2s;
}
.bsb-search-link:hover {
  opacity: 0.7;
}

.bsb-search-item-info {
  flex-grow: 1;
  padding-right: 15px;
  display: flex;
  align-items: center;
}

.bsb-search-item-title {
  font-size: 16px;
  font-weight: 500;
}

.bsb-search-item-thumb {
  width: 42px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bsb-search-item-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Fullscreen Mode (Driven by JS and Breakpoint) */
.bsb-search-panel.is-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  z-index: 99999;
  margin-top: 0;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

.bsb-search-panel.is-fullscreen .bsb-search-input-wrapper {
  border-bottom: 1px solid #eee;
  padding: 10px 20px;
  background: #fafafa;
}

.bsb-search-panel.is-fullscreen .bsb-search-results-dropdown {
  flex-grow: 1;
  max-height: none;
}
