/* 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;
}

/* Search Overlay */
.bsb-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.bsb-search-overlay.active {
  opacity: 1;
  pointer-events: auto;
  display: block !important;
}

/* Side Search Panel */
.bsb-side-search-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 450px;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  z-index: 99999;
  box-shadow: 0px 0 0px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex !important;
  flex-direction: column;
}
.bsb-side-search-panel.active {
  transform: translateX(0);
  box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.bsb-side-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.bsb-side-search-title {
  margin: 0;
  font-size: 20px;
  color: var(--e-global-color-1f7a474);
}

.bsb-side-search-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  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-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.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: 26px 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;
  flex-grow: 1;
  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 is now just the side panel filling the screen on mobile */
@media (max-width: 767px) {
  .bsb-side-search-panel {
    max-width: 100%;
  }
}
