/* ============================================================
   BASE
============================================================ */

.mmyu-search {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem 0.75rem;
  margin: 0 0 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
}

.mmyu-search form {
  width: 100%;
}

.mmyu-field {
  display: flex;
  flex-direction: column;
}

.mmyu-field label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.mmyu-field select {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  box-sizing: border-box;
}

/* ============================================================
   GRID / STACK EN MÓVIL
============================================================ */

.mmyu-fields {
  display: grid;
  width: 100%;
  gap: 0.5rem;
  box-sizing: border-box;
  grid-template-columns: 1fr; /* móvil */
}

/* ============================================================
   BOTÓN
============================================================ */

.mmyu-actions {
  width: 100%;
  text-align: center; /* móvil */
  margin-top: 0.5rem;
}

.mmyu-btn {
  display: inline-block;
  width: 100%;
  padding: 0.6rem 1rem;
  background: #1ba200;
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-align: center;
  font-size: 0.95rem;
}

.mmyu-btn:hover {
  background: #005f87;
}

/* ============================================================
   DESKTOP: 4 COLUMNAS CON FLEX
   (Marca, Año, Modelo, Botón en la misma fila)
============================================================ */

@media (min-width: 900px) {

  .mmyu-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
  }

  /* Cada campo y el botón ocupan 1/4 aprox. */
  .mmyu-fields {
    display: contents; /* dejamos que .mmyu-field se conviertan en items flex */
  }

  .mmyu-field,
  .mmyu-actions {
    flex: 1 1 25%;
    min-width: 0;
  }

  .mmyu-actions {
    margin-top: 0;       /* ya alineado abajo por flex */
    text-align: right;
  }

  .mmyu-btn {
    width: auto;
    padding: 0.45rem 1.3rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}

/* ============================================================
   MOBILE COLLAPSE (FUNCIONAL)
============================================================ */

/* ======== BOTÓN DE TOGGLE (MÓVIL) ======== */
.mmyu-toggle {
  width: 100%;
  background: #f5f5f5;
  border: 2px solid #ccc;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center; /* Centra el texto */
  gap: 10px;
  transition: all 0.25s ease;
}

.mmyu-toggle:hover {
  background: #e9e9e9;
  border-color: #bbb;
}

.mmyu-toggle-text {
  display: inline-block;
}

.mmyu-toggle-icon {
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  margin-left: 6px;
}

/* Cuando está abierto */
.mmyu-open .mmyu-toggle {
  background: #0073aa;
  color: #fff;
  border-color: #005f8d;
}

.mmyu-open .mmyu-toggle:hover {
  background: #006799;
  border-color: #004f70;
}

/* -------- MÓVIL -------- */
@media (max-width: 700px) {

  /* Mostrar botón */
  .mmyu-toggle {
    display: flex;
  }

  /* Panel cerrado */
  .mmyu-collapsible {
    display: none;
  }

  /* Panel abierto */
  .mmyu-search.mmyu-open .mmyu-collapsible {
    display: block;
  }
}

/* -------- ESCRITORIO -------- */
@media (min-width: 701px) {
  .mmyu-toggle {
    display: none !important;
  }
  .mmyu-collapsible {
    display: block !important;
  }
}

/* ============================================================
   RESULTS
============================================================ */

.mmyu-results {
  margin-top: 1rem;
}

.mmyu-product-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.mmyu-product-card img {
  width: 70px;
  height: 70px;
  border-radius: 4px;
  object-fit: cover;
}

.mmyu-product-card-title {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.mmyu-product-card-price {
  font-size: 0.9rem;
  color: #008200;
}

/* ============================================================
   SAFE WRAPPER (evita scroll)
============================================================ */

.mmyu-search * {
  max-width: 100%;
  box-sizing: border-box;
}
