/**
 * Franja «Filtra por tu moto» de la categoría (diseño «ACMOTOS Categoría»,
 * `CategoryMotoFilter` y `.r-cat-moto`). §4.28 del CLAUDE.md de ACMOTOS-NEW.
 *
 * Los tokens van scopeados aquí, como en el selector de la portada: el módulo no
 * da por hecho que el tema los traiga.
 *
 * La banda ya llega a los bordes porque la cabecera de la categoría se pinta
 * fuera del contenedor (`category-header.tpl`); no hace falta el truco del
 * `::before` a 100vw del selector de la portada.
 */
#ac-moto-finder.ac-catmoto {
  --ac-red: #dc1f1a;
  --ac-red-deep: #b81710;
  --ac-ink: #0e0e10;
  --ac-display: "Oswald", "Arial Narrow", Arial, sans-serif;
  --ac-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  padding: 18px 0;
  color: #fff;
  background: var(--ac-ink);
}

.ac-catmoto__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.ac-catmoto__label {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-family: var(--ac-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}

.ac-catmoto__icon {
  display: inline-flex;
  flex-shrink: 0;
}

.ac-catmoto__moto {
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.85);
}

/* ── Los tres pasos ─────────────────────────────────────────────────────── */

.ac-catmoto__form {
  display: contents;
}

.ac-catmoto__field {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  margin: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: opacity 0.2s ease;
}

.ac-catmoto__field.is-disabled {
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.4;
}

.ac-catmoto__num {
  padding-left: 14px;
  font-family: var(--ac-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

.ac-catmoto__field select {
  flex: 1;
  width: 100%;
  height: 100%;
  padding: 0 28px 0 10px;
  font-family: var(--ac-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  background-color: transparent;
  /* La flechita, en blanco: la del sistema desaparece sobre el fondo oscuro. */
  background-image:
    linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position: calc(100% - 16px) center, calc(100% - 12px) center;
  background-size: 5px 5px, 5px 5px;
  border: 0;
  outline: none;
  appearance: none;
}

.ac-catmoto__field select:disabled {
  cursor: not-allowed;
}

.ac-catmoto__field select:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* El desplegable lo pinta el navegador sobre fondo claro: el blanco del select
   no puede bajar a las opciones. */
.ac-catmoto__field select option {
  color: var(--ac-ink);
  background: #fff;
}

/* ── Botón y enlaces ────────────────────────────────────────────────────── */

.ac-catmoto__submit {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  font-family: var(--ac-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: var(--ac-red);
  border: 0;
  border-radius: 2px;
  transition: background 0.15s ease;
}

.ac-catmoto__submit:hover {
  color: #fff;
  background: var(--ac-red-deep);
}

.ac-catmoto__submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ac-catmoto__count {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
}

.ac-catmoto__count strong {
  color: #fff;
}

.ac-catmoto__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: center;
}

.ac-catmoto__alt {
  font-family: var(--ac-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}

.ac-catmoto__alt:hover {
  color: #fff;
}

/* ── Anchos ─────────────────────────────────────────────────────────────── */

@media (min-width: 768px) {
  .ac-catmoto__inner {
    grid-template-columns: 1fr 1fr;
  }

  .ac-catmoto__label {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .ac-catmoto--moto .ac-catmoto__count {
    text-align: left;
  }

  .ac-catmoto--moto .ac-catmoto__actions {
    justify-content: flex-end;
  }
}

@media (min-width: 1024px) {
  .ac-catmoto__inner {
    grid-template-columns: auto 1fr 1fr 1fr auto;
  }

  .ac-catmoto__label {
    grid-column: auto;
  }

  .ac-catmoto--moto .ac-catmoto__inner {
    grid-template-columns: auto 1fr auto;
  }
}

/* Objetivos táctiles donde no hay ratón, como el resto de la web (§29). */
@media (hover: none) and (pointer: coarse) {
  .ac-catmoto__field,
  .ac-catmoto__submit {
    min-height: 44px;
  }

  .ac-catmoto__alt {
    padding: 8px 0;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   Aviso flotante «¿Buscas para tu moto?» (diseño, `moto-nudge`)
   ════════════════════════════════════════════════════════════════════════ */

.ac-catmoto-nudge {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 1030;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  max-width: 560px;
  margin-left: auto;
  padding: 14px 44px 14px 16px;
  color: var(--ac-ink);
  background: #fff;
  border: 1px solid #e4dfd4;
  border-left: 3px solid var(--ac-red);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ac-catmoto-nudge[hidden] {
  display: none;
}

.ac-catmoto-nudge.is-on {
  opacity: 1;
  transform: none;
}

.ac-catmoto-nudge__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--ac-red);
  background: #fee9e7;
  border-radius: 999px;
}

.ac-catmoto-nudge__text {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6e6a60;
}

.ac-catmoto-nudge__text strong {
  display: block;
  font-family: var(--ac-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ac-ink);
}

.ac-catmoto-nudge__cta {
  flex-shrink: 0;
  min-height: 40px;
  padding: 10px 16px;
  font-family: var(--ac-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  background: var(--ac-red);
  border: 0;
  border-radius: 2px;
}

.ac-catmoto-nudge__cta:hover {
  background: var(--ac-red-deep);
}

.ac-catmoto-nudge__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #9a958a;
  cursor: pointer;
  background: none;
  border: 0;
}

.ac-catmoto-nudge__close:hover {
  color: var(--ac-ink);
}

@media (prefers-reduced-motion: reduce) {
  .ac-catmoto-nudge {
    transition: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .ac-catmoto-nudge__cta {
    min-height: 44px;
  }

  .ac-catmoto-nudge__close {
    width: 40px;
    height: 40px;
  }
}
