/* ===========================
   BUSCADOR (formulario)
   =========================== */
#bd-search-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-end;
    justify-content: center;
}
#bd-search-form label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 1.5em;
    margin-bottom: 0.3em; /* Mejora microespaciado */
}
#bd-search-form .select2-container {
    min-width: 180px;     /* ancho mínimo para cada Select2 */
    max-width: 240px;
    font-size: .88rem;
    margin-top: 10px;
}
#bd-search-form button[type="submit"] {
    padding: .55rem 1.35rem;
    background: #FCB900;          /* azul WP / Woo */
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background .25s ease;
}
#bd-search-form button[type="submit"]:hover {
    background: #212121;
}

/* === Botón "Limpiar filtros" mismo diseño === */
#bd-search-form button#bd-clear-filters {
    padding: .55rem 1.35rem;
    border-radius: 4px;
    background: #ededed;
    color: grey;
    font-weight: 600;
    cursor: pointer;
    transition: background .22s, color .22s;
    margin-left: .6rem;
}
#bd-search-form button#bd-clear-filters:hover {
    background: #010101;
    color: #fff;
}

/* === Accesibilidad: Estado de foco === */
#bd-search-form select:focus,
#bd-search-form button:focus {
    outline: 2px solid #FCB900;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #b9e3ff;
}

/* Responsive formulario en móvil */
@media (max-width: 700px) {
    #bd-search-form {
        flex-direction: column;
        align-items: stretch;
        gap: .75rem;
    }
    #bd-search-form label {
        font-size: 1.05em;
    }
    #bd-search-form .select2-container {
        min-width: 100%;
        max-width: 100%;
    }
    #bd-search-form button#bd-clear-filters {
        margin-left: 0;
        margin-top: .7rem;
    }
}

/* ===========================
   TABLA DE RESULTADOS
   =========================== */
.bd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}
.bd-table thead {
    background: #f5f5f5;
}
.bd-table th,
.bd-table td {
    padding: .55rem .75rem;
    border: 1px solid #e1e1e1;
    text-align: left;
    vertical-align: middle;
}
.bd-table tbody tr:nth-child(odd) {
    background: #fafafa;          /* efecto ‘zebra’ */
}
.bd-table tbody tr:hover {
    background: #ededed;          /* resalta la fila al pasar el ratón */
}

/* Miniaturas más pequeñas y centradas */
.bd-table td img {
    max-width: 60px;
    height: auto;
    display: block;
}

/* Botón “Ver producto” más vistoso */
.bd-table a {
    display: inline-block;
    padding: .37rem 1.05rem;
    background: #FCB900;
    color: #fff !important;
    border-radius: 4px;
    font-size: .89rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .22s;
    cursor: pointer;
}
.bd-table a:hover {
    background: #212121;
}
/*VERSIÓN MÓVIL*/
/* === SOLO MÓVIL: scroll lateral dentro de #bd-results === */
@media (max-width: 700px) {
  /* El contenedor hace el scroll, no toda la página */
  #bd-results{
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* scroll suave iOS */
    overscroll-behavior-x: contain;    /* evita “arrastrar” la página */
  }

  /* La tabla se mantiene intacta pero más ancha que el viewport */
  .bd-table{
    border-collapse: collapse;
    table-layout: fixed;   /* columnas estables */
    min-width: 680px;      /* fuerza scroll horizontal */
    font-size: .87rem;
    width: max-content;    /* ocupa solo lo necesario */
  }

  .bd-table th,
  .bd-table td{
    padding: .5rem .6rem;
    white-space: nowrap;   /* que no crezca en altura por texto largo */
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Deja que el nombre del producto pueda partirse si prefieres */
  .bd-table td:nth-child(2){
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }

  /* Miniaturas controladas */
  .bd-table td img{
    max-width: 60px;
    height: auto;
    display: block;
  }
}

/* ===========================
   SELECT2 (ligero ajuste visual)
   =========================== */
.select2-container .select2-selection--single {
    height: 36px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #888;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 6px;
    right: 6px;
}

/* ===========================
   EFECTO DE ENTRADA SUAVE EN RESULTADOS
   =========================== */
#bd-results {
    animation: fadein .35s;
}
@keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===========================
   MICROAJUSTES Y ACCESIBILIDAD
   =========================== */
.texto-titulo-label::first-letter {
    text-transform: uppercase;
}

.bd-table a, .bd-table a.button, #bd-search-form button {
    cursor: pointer;
}

.bd-loader {
  width: 40px;
  height: 40px;
  margin: 24px auto;
  border: 4px solid #FCB900;
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

.select2-container--default .select2-results__option {
  background-color: #fff;   /* fondo normal */
  color: #222;              /* color texto normal */
  transition: background .15s;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #FCB900 !important;   /* tu amarillo corporativo */
  color: #111 !important;                 /* texto negro */
}


