/* =========================================================================
   MOTOLAB · Motos — plantillas Elementor (header + catálogo)
   Esta hoja solo se carga donde el header Elementor realmente renderiza
   (MML_Assets → MML_Templates::header_active(): /shop/ y el árbol
   "Nuevas y seminuevas"). Nunca en la marca "Accesorios" ni en el single
   de producto: esas vistas se renderizan igual que hasta hoy.
   ========================================================================= */

/* El offset real de la barra fija (68px + safe-area-inset). motolab.js escribe
   --ml-hdr en línea buscando un <header> con position:fixed; aquí ese <header>
   es el wrapper .elementor-location-header (estático), así que forzamos el
   valor correcto. Un !important de autor le gana a un estilo inline normal. */
:root { --ml-hdr: var(--hdr-top) !important; }

/* El <body> ya está desplazado por el header fijo: no hace falta ningún
   padding-top extra en los contenedores de la plantilla. */
body.ml-has-fixed-header { padding-top: var(--hdr-top); }
body.ml-has-fixed-header .ml-tpl .e-con.ml-pagehead { padding-top: clamp(28px, 4vw, 56px); }

/* =========================================================================
   1 · Header (Theme Builder · tipo "header")
   ========================================================================= */
.elementor-location-header { display: block; }

.ml-header,
.ml-header .e-con {
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
  max-width: none;
  border: 0;
  box-shadow: none;
  background: transparent;
}
/* El selector lleva `.elementor-location-header` para ganarle a
   `.e-con{position:var(--position);z-index:var(--z-index)}` de Elementor
   (misma especificidad 0,1,0): cuando Elementor imprime su CSS DESPUÉS del
   nuestro (el orden de colas cambia según la página) ganaba él, la barra
   quedaba en flujo normal y `body.ml-has-fixed-header` la bajaba los 68px
   de padding. `body.admin-bar .ml-header` (0,2,1) sigue mandando en `top`. */
.elementor-location-header .ml-header,
.ml-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
}

/* La barra es una fila flex con logo · lockup · nav · acciones. */
.ml-header .e-con.ml-header__bar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 20px;
  height: var(--header-h);
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Cada widget de la barra es un elemento flex de ancho propio. */
.ml-header__bar > .elementor-widget {
  width: auto !important;
  max-width: 100%;
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 0 !important;
}
.ml-header__bar > .elementor-widget > .elementor-widget-container {
  width: auto !important;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}
.ml-header__bar > .elementor-widget-ml_header_nav { flex: 1 1 auto; min-width: 0; }
.ml-header__bar > .elementor-widget-ml_header_nav > .elementor-widget-container {
  display: flex;
  justify-content: center;
  min-width: 0;
}
.ml-header__bar > .elementor-widget-ml_header_actions { margin-left: auto; }

/* El logo de categoría (lockup) solo aparece dentro del árbol de motos
   (body.has-lockup, generado por MML_Data::body_class). */
.ml-header__bar > .elementor-widget-ml_lockup > .elementor-widget-container {
  display: flex;
  align-items: center;
}
.has-lockup .ml-lockup { display: inline-flex; }
/* Lockup con la imagen de marca subida en WooCommerce → Marcas (thumbnail_id). */
.ml-lockup--img::before { height: 28px; }
.ml-lockup .ml-lockup__img { display: block; height: 28px; width: auto; max-width: 170px; object-fit: contain; }

/* Superposiciones (menú móvil y buscador): fuera del header fijo, sin espacio. */
.ml-overlays { position: relative !important; display: block !important; min-height: 0; overflow: visible; }
.ml-overlays > .elementor-widget { width: 100% !important; margin: 0 !important; padding: 0 !important; }
.ml-overlays .ml-mobile,
.ml-overlays .ml-search { width: 100%; }

/* =========================================================================
   2 · Plantilla de catálogo (Theme Builder · product-archive)
   ========================================================================= */

/* La retícula de filtros vive en un contenedor Elementor, no en un <div>. */
.ml-tpl .e-con.ml-cat__body {
  display: grid !important;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  padding-bottom: 120px;
  align-items: start;
}
.ml-tpl .e-con.ml-main,
.ml-tpl .e-con.ml-toolbar-holder,
.ml-tpl .e-con.ml-loop-holder,
.ml-tpl .e-con.ml-stack { display: block !important; }

/* Widgets: el contenedor de Elementor no aporta medida ni margen. */
.ml-tpl .elementor-widget,
.ml-tpl .elementor-widget > .elementor-widget-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.ml-tpl .e-con.ml-cat__top .elementor-widget { width: auto; }

/* Barra lateral: sticky en escritorio, cajón inferior en móvil. */
@media (min-width: 981px) {
  .ml-tpl .e-con.ml-side {
    position: sticky !important;
    top: calc(var(--hdr-top) + 20px) !important;
    display: grid !important;
    gap: 18px;
    align-content: start;
  }
}
@media (max-width: 980px) {
  .ml-tpl .e-con.ml-cat__body { grid-template-columns: minmax(0, 1fr); }
  .ml-tpl .e-con.ml-side {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    top: auto !important;
    z-index: 120;
    display: grid !important;
    gap: 18px;
    align-content: start;
    max-height: 82vh;
    overflow-y: auto;
    background: var(--carbon);
    border-radius: 24px 24px 0 0;
    padding: 20px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -30px 80px -20px #000;
    transform: translateY(105%);
    transition: transform .6s var(--ease-out);
  }
  .ml-tpl .e-con.ml-side.is-open { transform: none; }
  .ml-tpl .e-con.ml-side::before {
    content: "";
    justify-self: center;
    width: 44px;
    height: 5px;
    border-radius: 5px;
    background: var(--line-2);
    margin-bottom: 4px;
  }
}

/* =========================================================================
   3 · Los controles del prototipo son <a>, no <button>
   motolab.css (copiado del prototipo) solo apunta a button.
   ========================================================================= */

/* Interruptor Nuevas / Semi-nuevas */
.ml-seg a {
  position: relative;
  z-index: 1;
  height: 48px;
  padding: 0 26px;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 999px;
  font: 800 14px/1 var(--f-display);
  font-stretch: 115%;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mist);
  transition: color .35s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}
.ml-seg a small { font: 500 11px var(--f-mono); opacity: .8; letter-spacing: .04em; }
.ml-seg a[aria-pressed="true"] { color: var(--brand-ink); }

/* Chips (marcas, usos, cilindraje) */
.ml-chip[aria-current="true"] { background: var(--bone); color: var(--ink); box-shadow: none; }
.ml-chip i { flex: none; }

/* Árbol de categorías de la barra lateral */
.ml-tree a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 0;
  background: none;
  cursor: pointer;
  color: #CFCFCB;
  font: 500 14.5px/1.2 var(--f-body);
  text-align: left;
  text-decoration: none;
  transition: background .25s, color .25s;
}
.ml-tree a:hover { background: rgba(244, 244, 242, .06); color: var(--bone); }
.ml-tree a[aria-current="true"] { color: var(--bone); background: rgba(244, 244, 242, .08); }
.ml-tree a[aria-current="true"] .lvl { color: var(--brand-hi); }
.ml-tree li.is-open > a .car { transform: rotate(90deg); }

/* =========================================================================
   4 · Ajustes sueltos de la plantilla
   ========================================================================= */
.ml-tpl .ml-h1 { margin: 0; }
.ml-tpl .ml-lead { margin: 0; }
.ml-tpl .ml-toolbar { margin-bottom: 22px; }
.ml-tpl .ml-catnote { margin-top: 28px; }
.ml-tpl .ml-card__media { position: relative; }

/* =========================================================================
   5 · Recarga AJAX de los filtros
   ========================================================================= */
#catHead,
.ml-tpl .e-con.ml-cat__body { transition: opacity .18s ease; }
body.cat-loading #catHead,
body.cat-loading .ml-tpl .e-con.ml-cat__body { opacity: .4; pointer-events: none; }

/* =========================================================================
   6 · Ficha de producto (plantilla Elementor · ml-tpl--pdp)
   El header del tema no es fijo: el offset habitual no aplica.
   ========================================================================= */
.ml-tpl--pdp{--hdr-top:env(safe-area-inset-top,0px)}

/* ---------- 6.1 · Contenedores .e-con (ganan a .ml-tpl .e-con) ---------- */
.ml-tpl .e-con.ml-pdp{display:block;position:relative;padding:calc(var(--hdr-top) + 24px) 0 0}
.ml-tpl .e-con.ml-pdp__top{display:grid;grid-template-columns:minmax(0,1.28fr) minmax(0,1fr);gap:clamp(24px,4vw,64px);padding:0 0 clamp(48px,6vw,80px)}
.ml-tpl .e-con.ml-quote{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:16px;padding:0}
.ml-tpl .e-con.ml-form{display:grid;gap:18px;align-content:start;min-width:0;padding:clamp(22px,3vw,40px);border-radius:var(--r-l);background:var(--graphite);box-shadow:inset 0 0 0 1px var(--line)}
/* El aside (ficha de datos + mapa en /contacto/) también es un contenedor
   .e-con: hay que elevarlo como el resto para no perder display:grid. */
.ml-tpl .e-con.ml-aside{display:grid;gap:14px;min-width:0;padding:0}

/* La galería debe poder moverse dentro de su celda (sticky). */
.ml-tpl .e-con.ml-pdp__top>.ml-pdpgal{align-self:stretch;display:flex;flex-direction:column;min-width:0}
.ml-tpl .e-con.ml-pdp__top>.ml-pdpgal>.elementor-widget-container{flex:1;min-width:0}
.ml-tpl .e-con.ml-quote>.elementor-widget{align-self:stretch;display:flex;flex-direction:column;min-width:0}
.ml-tpl .e-con.ml-quote>.elementor-widget>.elementor-widget-container{flex:1;min-width:0}
.ml-tpl--pdp .ml-aside{align-content:start}

/* ---------- 6.2 · Anclas de las pestañas ---------- */
.ml-tpl--pdp #p-desc,
.ml-tpl--pdp #p-specs,
.ml-tpl--pdp #p-cotizar,
.ml-tpl--pdp #p-similares{scroll-margin-top:calc(var(--hdr-top) + 78px)}

/* Anclas internas de /contacto/ (secciones con id). */
.ml-tpl .e-con[id]{scroll-margin-top:calc(var(--ml-hdr,0px) + 78px)}

/* ---------- 6.3 · Ficha técnica ---------- */
.ml-specs__panels{display:grid;gap:14px}
.ml-specs__panel[hidden]{display:none}

/* Tiras de datos clave: no todas las motos traen asiento (o cilindrada). */
.ml-tpl--pdp .ml-keyspecs{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}

/* ---------- 6.4 · Puente: widget "form" de Elementor ----------
   El CSS generado por Elementor (post-{id}.css) se imprime DESPUÉS de
   motos.css y usa selectores de 6-7 clases, así que aquí subimos la
   especificidad con .ml-tpl .e-con.ml-form (3 clases): el puente cuelga de
   la tarjeta .ml-form, igual en la ficha (cotización) y en /contacto/. */
.ml-tpl .e-con.ml-form .elementor-form{margin:0}
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;width:100%}
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group:not(.e-form__buttons){
	display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;
	gap:8px;grid-column:1/-1;width:auto;margin:0;padding:0;min-width:0;
}
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group:not(.e-form__buttons).elementor-col-50,
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group:not(.e-form__buttons).elementor-col-33,
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group:not(.e-form__buttons).elementor-col-25{grid-column:span 1}

.ml-tpl .e-con.ml-form .elementor-field-type-hidden{display:none!important}

.ml-tpl .e-con.ml-form .elementor-form .elementor-field-label{
	display:block;font:500 12px/1.2 var(--f-mono);letter-spacing:.1em;text-transform:uppercase;
	color:var(--mist);margin:0;max-width:none;width:100%;order:0;
}

.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group .elementor-field:not([type="radio"]):not([type="checkbox"]),
.ml-tpl .e-con.ml-form .elementor-form textarea.elementor-field{
	width:100%;height:52px;min-height:52px;border-radius:14px;border:0;background:#0E0F12;
	box-shadow:inset 0 0 0 1px var(--line-2);color:var(--bone);padding:0 16px;
	font:500 16px var(--f-body);transition:box-shadow .3s,background .3s;
}
.ml-tpl .e-con.ml-form .elementor-form textarea.elementor-field{height:auto;min-height:110px;padding:14px 16px;resize:vertical;line-height:1.5}
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group .elementor-field:focus,
.ml-tpl .e-con.ml-form .elementor-form textarea.elementor-field:focus{outline:none;box-shadow:inset 0 0 0 2px var(--brand-hi);background:#121317}
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group .elementor-field::placeholder,
.ml-tpl .e-con.ml-form .elementor-form textarea.elementor-field::placeholder{color:var(--mist-2)}

/* Píldoras de forma de pago / motivo */
.ml-tpl .e-con.ml-form .elementor-field-subgroup.ml-radios{display:flex;gap:8px;flex-wrap:wrap;width:100%}
.ml-tpl .e-con.ml-form .ml-radios .elementor-field-option{
	position:relative;display:inline-flex;height:auto;padding:0;border-radius:0;box-shadow:none;
}
.ml-tpl .e-con.ml-form .ml-radios .elementor-field-option label{
	display:inline-flex;align-items:center;height:44px;padding:0 16px;border-radius:999px;margin:0;
	box-shadow:inset 0 0 0 1px var(--line-2);transition:background .3s,color .3s,box-shadow .3s;
	font:500 15px var(--f-body);color:#D6D6D2;
}
.ml-tpl .e-con.ml-form .ml-radios .elementor-field-option input:checked + label{background:var(--bone);color:var(--ink);box-shadow:none}
.ml-tpl .e-con.ml-form .ml-radios .elementor-field-option input:focus-visible + label{outline:2px solid var(--brand-hi);outline-offset:2px}

/* Casilla de parte de pago */
.ml-tpl .e-con.ml-form .elementor-field-subgroup.ml-check{display:block;width:100%}
.ml-tpl .e-con.ml-form .ml-check .elementor-field-option{display:flex;gap:12px;align-items:flex-start}
.ml-tpl .e-con.ml-form .ml-check .elementor-field-option label{
	font:400 15px/1.45 var(--f-body);color:#D2D2CE;cursor:pointer;margin:0;
	text-transform:none;letter-spacing:0;position:static;height:auto;padding:0;box-shadow:none;
}
.ml-tpl .e-con.ml-form .ml-check .elementor-field-option input{width:20px;height:20px;accent-color:var(--brand-fill);margin:1px 0 0;flex:none;position:static;opacity:1;box-shadow:none}

/* Aviso legal */
.ml-tpl .e-con.ml-form .elementor-field-type-html{width:100%;display:block}
.ml-tpl .e-con.ml-form .ml-disclaimer{margin:0;font-size:13px;line-height:1.5;color:var(--mist-2);max-width:46ch}

/* Botón de envío */
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group.e-form__buttons,
.ml-tpl .e-con.ml-form .e-form__buttons{
	display:flex;flex-flow:row;justify-content:flex-end;align-items:center;gap:12px;
	grid-column:1/-1;width:100%;margin:0;padding:14px 0 0;border-top:1px solid var(--line);
}
.ml-tpl .e-con.ml-form .e-form__buttons__wrapper{width:auto}
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group.e-form__buttons .elementor-button,
.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group.e-form__buttons .elementor-button[type="submit"],
.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button,
.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button[type="submit"]{
	display:inline-flex;align-items:center;justify-content:center;gap:10px;flex:0 0 auto;
	height:54px;min-height:54px!important;width:auto;padding:0 26px;border:0;border-radius:999px;
	background:var(--brand-fill);color:var(--brand-ink);fill:var(--brand-ink);
	box-shadow:0 14px 34px -14px var(--brand-fill);
	font:600 16px/1 var(--f-body);letter-spacing:.01em;text-align:center;
	position:relative;overflow:hidden;isolation:isolate;cursor:pointer;white-space:nowrap;
	transition:transform .45s var(--ease),box-shadow .45s var(--ease),background-color .3s;
}
.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button::before{
	content:"";position:absolute;inset:0;z-index:-1;
	background:linear-gradient(105deg,transparent 30%,rgba(255,255,255,.38) 50%,transparent 70%);
	transform:translateX(-130%);transition:transform .8s var(--ease);
}
.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button:hover::before{transform:translateX(130%)}
.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button:active{transform:scale(.97)}
.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button .elementor-button-content-wrapper{gap:8px;flex-wrap:nowrap}
.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button .elementor-button-text{
	font:inherit;color:inherit;white-space:nowrap;flex:0 0 auto;
}
.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button .elementor-button-text::after{
	content:"";display:inline-block;width:17px;height:17px;margin-left:8px;vertical-align:-4px;
	background:currentColor;
	-webkit-mask:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
	mask:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}
.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button[disabled]{opacity:.6;cursor:progress}

/* Mensajes del formulario */
.ml-tpl .e-con.ml-form .elementor-message,
.ml-tpl .e-con.ml-form .elementor-message-success{
	border-radius:14px;padding:14px 16px;background:rgba(59,214,113,.1);
	box-shadow:inset 0 0 0 1px rgba(59,214,113,.3);color:#8BE7B0;font-size:15px;
}
.ml-tpl .e-con.ml-form .elementor-message-danger{
	background:rgba(255,90,61,.1);box-shadow:inset 0 0 0 1px rgba(255,90,61,.35);color:#FFB3A6;
}

/* ---------- 6.5 · Responsive ---------- */
@media (max-width:980px){
	.ml-tpl .e-con.ml-pdp__top,
	.ml-tpl .e-con.ml-quote{grid-template-columns:minmax(0,1fr)}
	.ml-tpl .e-con.ml-pdp__top>.ml-pdpgal,
	.ml-tpl .e-con.ml-quote>.elementor-widget{align-self:auto}
}
@media (max-width:767px){
	.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper{grid-template-columns:minmax(0,1fr)}
	.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group,
	.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group.elementor-col-50{grid-column:1/-1}
	.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group.e-form__buttons .elementor-button,
	.ml-tpl .e-con.ml-form .elementor-form-fields-wrapper>.elementor-field-group.e-form__buttons .elementor-button[type="submit"],
	.ml-tpl .e-con.ml-form .e-form__buttons .elementor-button{width:100%}
}

/* ---------- 7 · Productos de categoría en la ficha (foto / engranaje) ---------- */
/* Las motos conservan la silueta; los repuestos usan su foto o un engranaje
   de placeholder en galería, resumen, barra de compra y tarjetas. */
.ml-stage__img .ml-shot{width:100%;height:100%;display:grid;place-items:center}
.ml-stage__img .ml-shot[hidden]{display:none}
.ml-stage__img .ml-shot img.ml-photo{
	display:block;width:100%;height:100%;object-fit:contain;
	padding:clamp(12px,4%,36px);
}
.ml-stage__img .ml-shot__icon{display:grid;place-items:center;width:100%;height:100%}
.ml-stage__img .ml-shot__icon svg{
	position:relative;width:min(34%,220px);height:auto;color:var(--mist);opacity:.5;
}
.ml-thumb img{
	position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
}
.ml-thumb span.ml-shot__icon{
	position:absolute;inset:0;display:grid;place-items:center;
	font:inherit;letter-spacing:normal;text-transform:none;color:var(--mist);opacity:.55;
}
.ml-thumb .ml-shot__icon svg{position:relative;inset:auto;width:52%;height:auto;opacity:1}
.ml-summary__media img.ml-photo{
	width:100%;height:100%;object-fit:contain;padding:16px 20px;
}
.ml-summary__media img.ml-photo--ref{
	object-fit:contain;padding:0;background:#0A0A0C;
}
.ml-summary__media .ml-ico-gear{width:38%;height:auto;color:var(--mist);opacity:.45}
.ml-buybar img.ml-photo{width:96px;height:58px;object-fit:contain;flex:none}
.ml-buybar .ml-ico-gear{width:42px;height:42px;flex:none;color:var(--mist);opacity:.55}
.ml-card__media .ml-ico-gear{
	position:absolute;left:19%;bottom:4%;width:62%;height:auto;
	color:color-mix(in srgb,var(--c) 70%,var(--mist));opacity:.8;
}
@media (max-width:767px){
	.ml-buybar img.ml-photo,.ml-buybar .ml-ico-gear{display:none}
}

/* =========================================================================
   4 · Página de marca (/brand/honda/ y compañía)
   ========================================================================= */

/* El hero no debe repetir el offset que <body> ya aplica por el header fijo
   (el prototipo suma --hdr-top aquí porque allí no hay padding en <body>). */
body.ml-has-fixed-header .ml-tpl .e-con.ml-bhero { padding-top: clamp(28px, 4vw, 56px); }
body.ml-has-fixed-header .ml-tpl .ml-bhero { padding-top: clamp(32px, 5vw, 64px); }

/* Imagen propia del hero (campo "Imagen del hero" de la marca): toma el
   sitio de la ilustración SVG con la misma escala, sombra y entrada.
   max-width:100% replica el tope global img,svg{max-width:100%} que hoy
   recorta el 112% del SVG: así ambas variantes miden lo mismo. */
.ml-bhero__art img {
	display: block;
	width: 112%;
	max-width: 100%;
	height: auto;
	max-height: min(43vh, 420px);
	object-fit: contain;
	filter: drop-shadow(0 40px 40px rgba(0, 0, 0, .5));
	animation: mlRideIn 1.4s .15s var(--ease-out) both;
}
@media (max-width: 1100px) {
	.ml-bhero__art img { width: 100%; max-height: min(52vh, 460px); margin-inline: auto; }
}

/* Fondo propio de una línea de propósito (campo "Propósitos · fondo de cada
   tarjeta" de la ficha de la marca). El PHP emite la paleta derivada del
   color elegido (--brand-fill / --brand-deep) ya resuelta dentro del propio
   botón, así que el ::before del prototipo pinta el color del propósito en
   vez del de la marca, y se ve siempre, no solo al pasar el cursor. */
.ml-line.has-c::before { opacity: .55; }
.ml-line.has-c:hover::before { opacity: .8; }

/* Imagen propia del propósito: a pantalla completa con un velo para que el
   texto siga legible. Sustituye a la silueta SVG (z-index negativo, dentro
   del stacking context que crea isolation:isolate en .ml-line). */
.ml-line__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	z-index: -2;
	transition: transform .9s var(--ease-out);
}
.ml-line.has-img::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(8, 9, 11, .32), rgba(8, 9, 11, .84));
	pointer-events: none;
}
.ml-line:hover .ml-line__img { transform: scale(1.06); }
/* Con imagen el fondo de color solo asoma por debajo del velo. */
.ml-line.has-c.has-img::before { opacity: .3; }
.ml-line.has-c.has-img:hover::before { opacity: .45; }

/* Las tarjetas y los chips del filtrado se ocultan con [hidden]; los estilos
   de autor (.ml-card{display:flex}, .ml-empty{display:grid}…) ganarían al
   atributo por venir de la hoja de agente. */
.ml-brandpage [hidden] { display: none !important; }

/* Anclas de la sub-navegación: por debajo de la barra fija. */
.ml-tpl #b-lineas,
.ml-tpl #b-modelos,
.ml-tpl #b-repuestos,
.ml-tpl #b-taller { scroll-margin-top: calc(var(--ml-hdr, 0px) + 74px); }

/* Cabeceras de sección puestas por los widgets (divs, no contenedores):
   misma maqueta que .ml-tpl .e-con.ml-sec__head. */
.ml-tpl .elementor-widget .ml-sec__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 22px 48px;
	flex-wrap: wrap;
	margin-bottom: clamp(32px, 4.4vw, 60px);
	padding: 0;
}
.ml-tpl .elementor-widget .ml-sec__head > div:first-child {
	display: grid;
	gap: 18px;
	max-width: 780px;
	min-width: 0;
}
@media (max-width: 1100px) {
	.ml-tpl .elementor-widget .ml-sec__head { align-items: flex-start; flex-direction: column; gap: 18px; }
}
@media (max-width: 860px) {
	.ml-tpl .elementor-widget .ml-sec__head { gap: 14px; }
}

/* La sub-navegación es sticky: dentro del widget sus wrappers formaban una
   caja del mismo alto que el nav, así que el sticky no tenía dónde viajar.
   display:contents la suelta y su contenedor pasa a ser la raíz de la
   plantilla (alta como la página). */
.ml-tpl .elementor-widget:has(> .elementor-widget-container > nav.ml-subnav),
.ml-tpl .elementor-widget:has(> .elementor-widget-container > nav.ml-subnav) > .elementor-widget-container { display: contents; }

/* El admin bar de WordPress (solo sesión iniciada) tapa el header fijo y la
   sub-navegación: se compensa su altura con la variable del core. */
/* El propio html ya baja por el margin-top del admin bar: al body solo le
   corresponde la altura del header, si no se duplicaría el hueco. */
body.admin-bar .ml-header { top: var(--wp-admin--administrative-bar--height, 32px); }
body.admin-bar .ml-mobile { padding-top: calc(var(--wp-admin--administrative-bar--height, 32px) + var(--hdr-top) + 24px); }
body.admin-bar .ml-subnav { top: calc(var(--hdr-top) + var(--wp-admin--administrative-bar--height, 32px)); }
body.admin-bar.hdr-hidden .ml-subnav { top: var(--wp-admin--administrative-bar--height, 32px); }
@media screen and (max-width: 782px) {
	body.admin-bar .ml-header { top: 46px; }
	body.admin-bar .ml-subnav { top: calc(var(--hdr-top) + 46px); }
	body.admin-bar.hdr-hidden .ml-subnav { top: 46px; }
}

/* ===== Sale price & offer badge ===== */
.ml-card__media { position: relative; }
.ml-card__offer-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	max-width: 70px;
	border-radius: 4px;
	box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.ml-card__offer-badge img { display: block; width: 100%; height: auto; }

.ml-price--sale { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ml-price__regular {
	text-decoration: line-through;
	color: var(--mist, #9aa0a6);
	font-size: 0.78em;
	line-height: 1.2;
}
.ml-price__sale {
	color: var(--danger, #e22718);
	font-weight: 700;
	font-size: 1em;
	line-height: 1.2;
}

/* Small label above price */
.ml-price small { display: block; font-size: 0.75em; color: var(--mist, #9aa0a6); margin-bottom: 2px; }

/* ---- PDP gallery layout: stage full width, thumbs horizontal ---- */
.ml-gallery {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ml-stage {
    width: 100%;
}
.ml-thumbs {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.ml-thumb {
    flex: 0 0 auto;
}

/* Mega · carrusel del destacado al pasar por una columna Por propósito */
.ml-mega__feat-wrap{position:relative;display:flex;min-height:250px}
.ml-mega__feat-wrap > .ml-mega__feature{flex:1;min-height:0}
.ml-mega__feat-wrap.is-carousel > .ml-mega__feature{opacity:0;pointer-events:none;transition:opacity .2s}
.ml-mega__carousel{position:absolute;inset:0;border-radius:var(--r-m);overflow:hidden;visibility:hidden;opacity:0;pointer-events:none;transition:opacity .3s var(--ease),visibility 0s .3s}
.ml-mega__carousel.is-on{visibility:visible;opacity:1;pointer-events:auto;transition:opacity .3s var(--ease)}
.ml-mega__slide{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:space-between;padding:24px;border-radius:var(--r-m);overflow:hidden;text-decoration:none;background:radial-gradient(80% 80% at 70% 70%,color-mix(in srgb,var(--c,#FF6600) 55%,transparent),transparent 70%),var(--graphite-2);opacity:0;visibility:hidden;transition:opacity .45s var(--ease),visibility 0s .45s}
.ml-mega__slide.is-on{opacity:1;visibility:visible;transition:opacity .45s var(--ease);z-index:1}
.ml-mega__slide-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:0}
.ml-mega__slide-shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.6),rgba(0,0,0,.08) 45%,rgba(0,0,0,.65));z-index:1;pointer-events:none}
.ml-mega__slide svg.ml-bike{position:absolute;right:-6%;bottom:2%;width:86%;height:auto;z-index:1;--spin-play:running}
.ml-mega__slide .ml-eyebrow{position:relative;z-index:2;font:500 11px/1 var(--f-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--mist);margin:0}
.ml-mega__slide strong{position:relative;z-index:2;font:800 24px/1 var(--f-display);font-stretch:112%;text-transform:uppercase;color:var(--bone)}
.ml-mega__dots{position:absolute;top:20px;right:20px;z-index:5;display:flex;gap:6px}
.ml-mega__count{position:absolute;top:20px;right:20px;z-index:5;font:500 11px/1 var(--f-mono);letter-spacing:.08em;color:var(--mist)}
.ml-mega__arrow{position:absolute;top:50%;z-index:6;display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid rgba(244,244,242,.24);border-radius:50%;background:rgba(18,18,18,.52);color:var(--bone);cursor:pointer;transform:translateY(-50%);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);transition:background .2s var(--ease),border-color .2s var(--ease),color .2s var(--ease)}
.ml-mega__arrow--prev{left:12px}
.ml-mega__arrow--next{right:12px}
.ml-mega__arrow--prev .ml-mega__arrow-ico{transform:rotate(180deg)}
.ml-mega__arrow:hover{background:var(--brand-hi);border-color:var(--brand-hi);color:#111}
.ml-mega__arrow:focus-visible{outline:2px solid var(--brand-hi);outline-offset:2px}
.ml-mega__arrow-ico{width:16px;height:16px}
.ml-mega__dot{width:6px;height:6px;padding:0;border:0;border-radius:99px;background:rgba(244,244,242,.35);cursor:pointer;transition:width .3s var(--ease),background .3s}
.ml-mega__dot.is-on{width:18px;background:var(--brand-hi)}
@media (max-width:1180px){.ml-mega__feat-wrap{display:none}}
/* Lista de confianza: viñeta en filas sin icono (ocupa el mismo hueco de
   20px que los iconos, así el texto de todas las filas queda alineado). */
.ml-trust li.ml-trust--bullet::before{content:"•";width:20px;flex:none;margin-top:1px;font-size:17px;line-height:20px;color:var(--brand-hi,#FF6600)}
