/* =========================================================
   Maz Autopartes v2 — Home: "Encuentra tu refacción"
   Sección: section.auto-parts
   Estilo: Bosch (naranja #E85230, Roboto, radius 6px)
   ========================================================= */

:root {
  --thm-base: #E85230;
  --thm-base-hover: #c8421f;
  --thm-black: #0e1422;
  --thm-gray: #6b7280;
  --thm-border: #e5e7eb;
  --thm-bg-soft: #f7f7f9;
  --thm-white: #ffffff;
  --thm-radius: 6px;
  --thm-font: "Roboto", "Helvetica Neue", Arial, sans-serif;
}

/* Contenedor principal de la sección */
.auto-parts {
  background-color: var(--thm-bg-soft);
  padding: 60px 0;
  font-family: var(--thm-font);
}

.auto-parts .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Encabezado de la sección */
.auto-parts .sec-title,
.auto-parts .section-title {
  text-align: center;
  margin-bottom: 36px;
}

.auto-parts .sec-title h2,
.auto-parts .section-title h2,
.auto-parts h2 {
  font-family: var(--thm-font);
  font-size: 28px;
  font-weight: 700;
  color: var(--thm-black);
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}

.auto-parts .sec-title p,
.auto-parts .section-title p {
  color: var(--thm-gray);
  font-size: 15px;
  margin: 0;
}

/* Grid de los 4 selects + botón */
.auto-parts .find-parts,
.auto-parts .auto-parts-form,
.auto-parts form {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 14px;
  align-items: end;
  background: var(--thm-white);
  border: 1px solid var(--thm-border);
  border-radius: var(--thm-radius);
  padding: 22px;
  box-shadow: 0 2px 8px rgba(14, 20, 34, 0.04);
}

/* Wrappers de cada campo */
.auto-parts .form-group,
.auto-parts .field,
.auto-parts .select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.auto-parts label {
  font-size: 12px;
  font-weight: 600;
  color: var(--thm-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Selects estilizados Bosch con flecha custom */
.auto-parts select,
.auto-parts .form-control select,
.auto-parts .nice-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  height: 48px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--thm-border);
  border-radius: var(--thm-radius);
  background-color: var(--thm-white);
  color: var(--thm-black);
  font-family: var(--thm-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 48px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  /* Flecha custom (chevron SVG inline) */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%230e1422' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

.auto-parts select:hover {
  border-color: #c4c8cf;
  background-color: #fafbfc;
}

.auto-parts select:focus,
.auto-parts select:active {
  border-color: var(--thm-base);
  box-shadow: 0 0 0 3px rgba(232, 82, 48, 0.15);
}

.auto-parts select:disabled {
  background-color: var(--thm-bg-soft);
  color: var(--thm-gray);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Botón naranja Bosch */
.auto-parts .btn,
.auto-parts button[type="submit"],
.auto-parts .thm-btn,
.auto-parts .auto-parts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  background-color: var(--thm-base);
  color: var(--thm-white);
  border: none;
  border-radius: var(--thm-radius);
  font-family: var(--thm-font);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.05s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}

.auto-parts .btn:hover,
.auto-parts button[type="submit"]:hover,
.auto-parts .thm-btn:hover,
.auto-parts .auto-parts-btn:hover {
  background-color: var(--thm-base-hover);
  box-shadow: 0 4px 12px rgba(232, 82, 48, 0.25);
}

.auto-parts .btn:active,
.auto-parts button[type="submit"]:active {
  transform: translateY(1px);
}

.auto-parts .btn:focus-visible,
.auto-parts button[type="submit"]:focus-visible {
  outline: 2px solid var(--thm-base);
  outline-offset: 2px;
}

/* Ícono opcional dentro del botón */
.auto-parts .btn i,
.auto-parts button[type="submit"] i {
  margin-right: 8px;
  font-size: 16px;
}

/* ---------- Responsive ---------- */

/* Desktop chico / laptops */
@media (max-width: 1199.98px) {
  .auto-parts .find-parts,
  .auto-parts form {
    grid-template-columns: repeat(4, 1fr);
  }
  .auto-parts .btn,
  .auto-parts button[type="submit"] {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

/* Tablet: 2 columnas */
@media (max-width: 767.98px) {
  .auto-parts {
    padding: 44px 0;
  }
  .auto-parts h2 {
    font-size: 22px;
  }
  .auto-parts .find-parts,
  .auto-parts form {
    grid-template-columns: repeat(2, 1fr);
    padding: 16px;
    gap: 12px;
  }
}

/* Móvil: 1 columna */
@media (max-width: 479.98px) {
  .auto-parts .find-parts,
  .auto-parts form {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .auto-parts select,
  .auto-parts .btn,
  .auto-parts button[type="submit"] {
    height: 46px;
  }
}

/* =========================================================
   FIX: forzar selects nativos visibles (anular selectpicker)
   El template Bosch carga bootstrap-select y oculta los <select>
   con display:none — necesitamos los nativos para que el JS de
   cascading Marca→Modelo→Año funcione visualmente.
   ========================================================= */
.auto-parts #hp-marca,
.auto-parts #hp-modelo,
.auto-parts #hp-anio,
.auto-parts #hp-tipo {
  display: block !important;
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  -moz-appearance: menulist !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  width: 100%;
  height: 44px;
  padding: 0 36px 0 14px;
  background: #ffffff;
  border: 1.5px solid #eef0f4;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  outline: 0;
  transition: border-color .15s ease;
}
.auto-parts #hp-marca:hover,
.auto-parts #hp-marca:focus,
.auto-parts #hp-modelo:hover:not([disabled]),
.auto-parts #hp-modelo:focus:not([disabled]),
.auto-parts #hp-anio:hover,
.auto-parts #hp-anio:focus,
.auto-parts #hp-tipo:hover,
.auto-parts #hp-tipo:focus {
  border-color: #E85230;
}
.auto-parts #hp-modelo[disabled] {
  background: #f5f6f9;
  color: #8993a4;
  cursor: not-allowed;
}

/* Ocultar el widget custom del bootstrap-select si aparece */
.auto-parts .bootstrap-select,
.auto-parts .dropdown.bootstrap-select,
.auto-parts .filter-option,
.auto-parts button.dropdown-toggle.btn[data-toggle="dropdown"] {
  display: none !important;
}
