.search-bar {
    position: relative;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
}

.search-main {
  width: 500px; /* ancho final fijo */
  opacity: 1;
  overflow: hidden;
  border-bottom: 1px solid #ccc;
  background-color: #fff;
  display: flex;
  align-items: center;

  transform-origin: right center; /* importante */
  transform: scaleX(0);
  opacity: 0;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.search-main.expanding {
  animation: expandScaleX 0.25s forwards ease;
}

.search-main.collapsing {
  animation: collapseScaleX 0.25s forwards ease;
}

@keyframes expandScaleX {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes collapseScaleX {
  0% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(0);
    opacity: 0;
  }
}

.search-main:focus-within {
    border-bottom: 1px solid #f7a7c0; /* Rosa pastel */
    background-color: white; /* Fondo rosa muy tenue */
}

.search-main input {
    border: none;
    outline: none;
    font-size: 15px;
    padding: 8px;
    background: transparent;
    color: #222;
}

.btn-search{
    color: black;
}

.btn-search,
.btn-search-cerrar {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid #ccc;
    border-top: none;
    background-color: #fff;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results li {
    list-style: none;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.search-results li:last-child {
    border-bottom: none;
}

.search-results li:hover {
    background-color: #f5f5f5;
}

.btn-search-cerrar {
  display: flex; /* visible solo cuando search-main está visible */
}

