/* Efectos y formas suaves. Se carga después de los estilos base y los ajusta. */

/* ---------- Formas menos geométricas ---------- */
.btn, .chip, .campo, .linkver, .menu-btn, .opcion span, .plazos button { border-radius: 999px; }
.finder { border-radius: 16px; overflow: hidden; }
.finder .btn { border-radius: 0 14px 14px 0; }
.ficha { border-radius: 16px; overflow: hidden; }
.ficha__tipo { border-radius: 0 0 12px 0; }
dialog.det { border-radius: 20px; }
.cuota, .yo__foto { border-radius: 20px; }
.form input[type=text], .form input[type=number], .form select, .form textarea { border-radius: 10px; }
.det__thumbs button { border-radius: 8px; overflow: hidden; }
.det__nav { border-radius: 50%; margin-left: 8px; margin-right: 8px; }
.det__close { border-radius: 50%; top: 10px; right: 10px; }
.hero__ficha .nombre { border-radius: 10px 10px 0 0; }
.hero__ficha .data { border-radius: 0 0 10px 10px; }
@media (max-width: 640px) { .finder .btn { border-radius: 0 0 14px 14px; } }

/* ---------- Intro (una vez por visita) ---------- */
.intro-capa { display: none; }
.intro .intro-capa { display: grid; place-items: center; align-content: center; gap: 28px; position: fixed; inset: 0; z-index: 100; overflow: hidden; }
.intro-capa::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: -45vh; right: -45vh; background: var(--negro); transform: skewX(-21deg); will-change: transform; }
.intro-capa img { width: 120px; height: auto; }
html.intro { overflow: hidden; }
.intro .hero * { animation-play-state: paused !important; }
.intro .intro-capa img { animation: intro-logo .7s cubic-bezier(.16,.84,.24,1) both, intro-fuera .3s ease-in 1.15s forwards; }
.intro .intro-capa .franjas { animation: intro-fuera .3s ease-in 1.15s forwards; }
.intro .intro-capa .franjas span { animation: intro-franja .45s cubic-bezier(.2,.8,.2,1) both; }
.intro .intro-capa .franjas span:nth-child(2) { animation-delay: .06s; } .intro .intro-capa .franjas span:nth-child(3) { animation-delay: .12s; }
.intro .intro-capa .franjas span:nth-child(4) { animation-delay: .18s; } .intro .intro-capa .franjas span:nth-child(5) { animation-delay: .24s; }
.intro .intro-capa::before { animation: intro-sale .6s cubic-bezier(.7,0,.2,1) 1.2s both; }
@keyframes intro-logo { from { opacity: 0; transform: scale(.6); } }
@keyframes intro-franja { from { opacity: 0; transform: skewX(-21deg) translateX(-80px); } }
@keyframes intro-sale { to { transform: translate3d(calc(100vw + 90vh), 0, 0) skewX(-21deg); } }
@keyframes intro-fuera { to { opacity: 0; transform: scale(.9); } }

/* ---------- Recién ingresados ---------- */
.nuevos { padding: clamp(64px, 9vw, 128px) 0 0; overflow: hidden; }
.nuevos__head { margin-bottom: var(--s8); }
.nuevos__head .intro { margin-top: var(--s4); }
.nuevos__track { display: flex; gap: var(--s6); padding: 0 var(--gut) var(--s4); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.nuevos__track::-webkit-scrollbar { display: none; }
.nuevo { flex: 0 0 min(46vw, 620px); background: none; border: 0; padding: 0; color: var(--ink); text-align: left; cursor: pointer; scroll-snap-align: start; }
.nuevo__foto { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #222; border-radius: 22px; }
.nuevo__foto img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); transition: filter .4s; }
.nuevo:hover .nuevo__foto img { filter: brightness(1.08); }
.nuevo__info { display: grid; gap: 4px; padding: var(--s4) var(--s2); }
.nuevo__nombre { font-size: clamp(20px, 2vw, 28px); line-height: 1.05; font-stretch: 125%; font-weight: 800; text-transform: uppercase; }
.nuevos.pin .nuevos__track { overflow: visible; width: max-content; scroll-snap-type: none; }
.nuevos.pin .nuevos__pin { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 104px 0 var(--s8); }
.nuevos.pin .nuevos__head { width: 100%; }
.nuevos.pin { padding-top: 0; }
@media (max-width: 900px) { .nuevo { flex-basis: 82vw; } }

/* ---------- Reservar visita ---------- */
.turno { border: 0; padding: 0; margin: auto; width: min(640px, calc(100vw - 32px)); max-height: calc(100svh - 32px); background: var(--surface-raised); color: var(--ink); overflow: auto; border-radius: 24px; }
.turno::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(6px); }
@media (prefers-reduced-motion: no-preference) { .turno[open] { animation: abre .4s cubic-bezier(.2,.8,.2,1); } }
.turno__form { padding: clamp(24px, 4vw, 40px); display: grid; gap: var(--s6); }
.turno h2 { margin: 0; padding-right: 48px; font-size: clamp(26px, 3vw, 36px); line-height: 1; font-stretch: 125%; font-weight: 800; text-transform: uppercase; }
.turno__sub { margin: -12px 0 0; color: var(--ink-muted); }
.turno fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.turno legend { font-weight: 700; font-size: 14px; margin-bottom: var(--s3); padding: 0; }
.turno__dias { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.turno__dias button { flex: 0 0 66px; display: grid; justify-items: center; gap: 2px; padding: 10px 0; border-radius: 16px; border: 1px solid var(--line-strong); background: none; color: var(--ink); cursor: pointer; transition: background-color .2s, border-color .2s; }
.turno__dias b { font-size: 22px; line-height: 1.1; font-stretch: 125%; }
.turno__dias small { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; }
.turno__horas { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--s2); }
.turno__horas button { height: 44px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; color: var(--ink); font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; transition: background-color .2s, border-color .2s; }
.turno__dias button:hover, .turno__horas button:hover { border-color: var(--ink); }
.turno [aria-pressed="true"], .turno [aria-pressed="true"]:hover { background: var(--rojo-accion); border-color: var(--rojo-accion); color: var(--on-rojo); }
.turno [aria-pressed="true"] small { color: var(--on-rojo); }
.turno__fila { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.turno label > span { display: block; font-weight: 700; font-size: 14px; margin-bottom: var(--s2); }
.turno input, .turno select { width: 100%; height: 48px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 var(--s3); }
.turno__resumen { margin: 0; font-weight: 600; }
.turno__ctas { display: flex; flex-wrap: wrap; gap: var(--s3); }
@media (max-width: 640px) { .turno__fila { grid-template-columns: 1fr; } .turno__ctas .btn { flex: 1 1 100%; } }

/* ---------- Tarjetas con profundidad ---------- */
.grid { perspective: 1200px; }
.ficha { will-change: transform; }

/* Turnos: campos y horarios ocupados */
.turno__ancho { grid-column: 1 / -1; }
.turno__horas button:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.turno__ok { margin: 0; border: 0; border-radius: 0; padding: clamp(24px, 4vw, 40px); }

/* Lo que tiene el atributo hidden no se muestra, aunque su clase defina display. */
[hidden] { display: none !important; }

/* ---------- Celular: tarjetas del stock compactas (foto a la izquierda) ---------- */
@media (max-width: 640px) {
  .grid { gap: 12px; }
  .ficha { flex-direction: row; min-height: 156px; }
  .ficha__foto { flex: 0 0 40%; aspect-ratio: auto; }
  .ficha__foto img { position: absolute; inset: 0; }
  .ficha__tipo { padding: 4px 8px; font-size: 10px; gap: 4px; }
  .ficha__tipo .ph { font-size: 14px; }
  .ficha__body { padding: 12px; gap: 4px; min-width: 0; }
  .ficha__body .estado { font-size: 10px; }
  .ficha__titulo { font-size: 15px; line-height: 20px; }
  .ficha .data { font-size: 13px; line-height: 18px; }
  .ficha__honesto { font-size: 12px; gap: 4px 10px; }
  .ficha__pie { padding-top: 8px; margin-top: 6px; }
  .ficha__precio { font-size: 17px; line-height: 22px; }
  .ficha__pie .flecha { display: none; }
  .preview .ficha { flex-direction: column; }
  .preview .ficha__foto { flex: none; aspect-ratio: 4 / 3; }
}

/* ---------- Celular: ficha y reserva a pantalla completa ---------- */
.det__nav--prev { left: 8px; margin: 0; } .det__nav--next { right: 8px; margin: 0; }
@media (max-width: 640px) {
  dialog.det, .turno { width: 100vw; max-width: 100vw; height: 100svh; max-height: 100svh; margin: 0; border-radius: 0; }
  dialog.det .det__close, .turno .det__close { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 5; background: rgba(0, 0, 0, .7); }
  /* El botón de consultar queda siempre a mano al pie de la ficha. */
  .det__ctas { position: sticky; bottom: 0; z-index: 2; margin: 0 calc(-1 * var(--s4)); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .det__ctas .btn { flex: 1 1 100%; }
  .det__ctas { gap: 8px; }
  .det__ctas .btn--secundario { flex: 1 1 0; min-width: 0; white-space: normal; text-align: center; font-size: 12px; line-height: 16px; padding: 10px 8px; }
  .ficha__tipo, .ficha__body .estado { font-size: 11px; }
  .opcion span .ph { margin-right: 2px; }
}

/* ---------- Tablet: el buscador en dos líneas para que el campo respire ---------- */
@media (max-width: 900px) { .finder { width: 100%; margin-inline: auto; } }
@media (min-width: 641px) and (max-width: 1100px) {
  .finder { grid-template-columns: auto minmax(0, 1fr); max-width: 560px; }
  .finder .btn { grid-column: 1 / -1; margin: 0; border-radius: 0 0 14px 14px; }
  .finder input { border-bottom: 1px solid var(--line); }
}

/* ---------- Fotos cargando: brillo suave en vez de un rectángulo negro ---------- */
.hero__photo, .ficha__foto, .nuevo__foto, .det__foto, .yo__foto {
  background-color: #161616;
  background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .06) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: cargando 1.4s linear infinite;
}
.hero__photo:has(img.activo), .ficha__foto:has(img[data-ok]), .nuevo__foto:has(img[data-ok]), .det__foto:has(img[data-ok]), .yo__foto:has(img[data-ok]),
.preview .ficha__foto { animation: none; background-image: none; }
.ficha__foto[style], .nuevo__foto[style], .det__foto[style] { background-size: cover; background-position: center; animation: none; }
.foto-falla { animation: none !important; }
.ficha__foto img, .nuevo__foto img, .det__foto img, .det__thumbs img { opacity: 0; transition: opacity .45s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.ficha__foto img[data-ok], .nuevo__foto img[data-ok], .det__foto img[data-ok], .det__thumbs img[data-ok] { opacity: 1; }
:root { --carga-auto: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 40%22%3E%3Cstyle%3E.t,.d%7Bfill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round%7D.t%7Bstroke:%233d3d3d%7D.d%7Bstroke:%23fff;stroke-dasharray:1;stroke-dashoffset:1;animation:a 2s cubic-bezier(.6,0,.4,1) infinite%7D.t.r%7Bstroke:%234a1a17%7D.d.r%7Bstroke:%23ea392c%7D%40keyframes a%7B55%25%7Bstroke-dashoffset:0%7D100%25%7Bstroke-dashoffset:-1%7D%7D%40media (prefers-reduced-motion:reduce)%7B.d%7Banimation:none;stroke-dashoffset:0%7D%7D%3C/style%3E%3Cpath d=%22M8.6 30H6.5A2.5 2.5 0 0 1 4 27.5V23.5a3 3 0 0 1 2.4-2.9L15.5 19l7-9.8a3 3 0 0 1 2.4-1.2h13.6a3 3 0 0 1 2.2 1L49 19h7a4 4 0 0 1 4 4v4.5A2.5 2.5 0 0 1 57.5 30h-1.1%22 pathLength=%221%22 class=%22t%22/%3E%3Cpath d=%22M21.8 30h21.4%22 pathLength=%221%22 class=%22t%22/%3E%3Cpath d=%22M22.3 15.8l3.4-4.3h5.5v4.3z%22 pathLength=%221%22 class=%22t%22/%3E%3Cpath d=%22M35.2 11.5h3.6l3.9 4.3h-7.5z%22 pathLength=%221%22 class=%22t%22/%3E%3Ccircle cx=%2215%22 cy=%2230%22 r=%225.2%22 pathLength=%221%22 class=%22t r%22/%3E%3Ccircle cx=%2250%22 cy=%2230%22 r=%225.2%22 pathLength=%221%22 class=%22t r%22/%3E%3Cpath d=%22M8.6 30H6.5A2.5 2.5 0 0 1 4 27.5V23.5a3 3 0 0 1 2.4-2.9L15.5 19l7-9.8a3 3 0 0 1 2.4-1.2h13.6a3 3 0 0 1 2.2 1L49 19h7a4 4 0 0 1 4 4v4.5A2.5 2.5 0 0 1 57.5 30h-1.1%22 pathLength=%221%22 class=%22d%22/%3E%3Cpath d=%22M21.8 30h21.4%22 pathLength=%221%22 class=%22d%22/%3E%3Cpath d=%22M22.3 15.8l3.4-4.3h5.5v4.3z%22 pathLength=%221%22 class=%22d%22/%3E%3Cpath d=%22M35.2 11.5h3.6l3.9 4.3h-7.5z%22 pathLength=%221%22 class=%22d%22/%3E%3Ccircle cx=%2215%22 cy=%2230%22 r=%225.2%22 pathLength=%221%22 class=%22d r%22/%3E%3Ccircle cx=%2250%22 cy=%2230%22 r=%225.2%22 pathLength=%221%22 class=%22d r%22/%3E%3C/svg%3E"); --carga-moto: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 64 40%22%3E%3Cstyle%3E.t,.d%7Bfill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round%7D.t%7Bstroke:%233d3d3d%7D.d%7Bstroke:%23fff;stroke-dasharray:1;stroke-dashoffset:1;animation:a 2s cubic-bezier(.6,0,.4,1) infinite%7D.t.r%7Bstroke:%234a1a17%7D.d.r%7Bstroke:%23ea392c%7D%40keyframes a%7B55%25%7Bstroke-dashoffset:0%7D100%25%7Bstroke-dashoffset:-1%7D%7D%40media (prefers-reduced-motion:reduce)%7B.d%7Banimation:none;stroke-dashoffset:0%7D%7D%3C/style%3E%3Cpath d=%22M19.5 26.5L23 18h15l6 8%22 pathLength=%221%22 class=%22t%22/%3E%3Cpath d=%22M23 18l3-5.5h9l3 5.5%22 pathLength=%221%22 class=%22t%22/%3E%3Cpath d=%22M51 26l-6.5-15.5h5%22 pathLength=%221%22 class=%22t%22/%3E%3Ccircle cx=%2212%22 cy=%2228%22 r=%227.5%22 pathLength=%221%22 class=%22t r%22/%3E%3Ccircle cx=%2252%22 cy=%2228%22 r=%227.5%22 pathLength=%221%22 class=%22t r%22/%3E%3Cpath d=%22M19.5 26.5L23 18h15l6 8%22 pathLength=%221%22 class=%22d%22/%3E%3Cpath d=%22M23 18l3-5.5h9l3 5.5%22 pathLength=%221%22 class=%22d%22/%3E%3Cpath d=%22M51 26l-6.5-15.5h5%22 pathLength=%221%22 class=%22d%22/%3E%3Ccircle cx=%2212%22 cy=%2228%22 r=%227.5%22 pathLength=%221%22 class=%22d r%22/%3E%3Ccircle cx=%2252%22 cy=%2228%22 r=%227.5%22 pathLength=%221%22 class=%22d r%22/%3E%3C/svg%3E"); }
/* Mientras carga una foto: el contorno del auto (o la moto) se dibuja y se borra, sobre la vista previa borrosa. */
.ficha__foto:has(img:not([data-ok]))::before, .nuevo__foto:has(img:not([data-ok]))::before, .det__foto:has(img:not([data-ok]))::before {
  content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 76px; height: 48px; margin: -24px 0 0 -38px;
  background: var(--carga-auto) center / contain no-repeat; filter: drop-shadow(0 1px 4px rgba(0,0,0,.7)); pointer-events: none; }
[data-tipo="moto"]:has(img:not([data-ok]))::before { background-image: var(--carga-moto); }
.preview .ficha__foto:has(img:not([data-ok]))::before { width: 150px; height: 94px; margin: -47px 0 0 -75px; filter: none; }
.preview .ficha__foto:has(img:not([data-ok])) .ph { display: none; }
.nuevo__foto { position: relative; }
.foto-falla { display: grid; place-items: center; }
.foto-falla::before { content: "Foto no disponible"; position: relative; z-index: 1; color: var(--ink-muted); font-size: 13px; font-weight: 600; background: rgba(0,0,0,.6); padding: 4px 10px; border-radius: 999px; }
.det__thumbs button:has(img:not([data-ok])) { background: linear-gradient(100deg, #1c1c1c 30%, #2a2a2a 50%, #1c1c1c 70%) 0 0 / 250% 100%; animation: cargando 1.4s linear infinite; }
@keyframes cargando { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .hero__photo, .ficha__foto, .nuevo__foto, .det__foto, .yo__foto { animation: none; } }

/* Intro: las franjas miden lo mismo que el dibujo del monograma (≈74 % del ancho del SVG) y quedan centradas debajo. */
.intro-capa { gap: 18px; }
.intro-capa .franjas { width: 90px; height: 12px; gap: 6px; justify-content: center; }
.intro-capa .franjas span { flex: 1 1 0; }

/* ---------- Opciones con ícono: separación entre ícono y texto ---------- */
.form .opcion > span { display: inline-flex; gap: 10px; margin-bottom: 0; font-size: 14px; }

/* ---------- Desplegables propios (reemplazan la lista nativa del sistema) ---------- */
.despl { position: relative; display: inline-block; }
.form .despl, .turno .despl { display: block; }
.despl__nativo { display: none !important; }
.despl__btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 48px; padding: 0 14px 0 16px;
  background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; font-size: 15px; font-weight: 500; text-align: left; cursor: pointer; transition: border-color .15s; }
.turno .despl__btn { background: var(--surface); }
.despl__btn:hover, .despl.abierto .despl__btn { border-color: var(--ink); }
.despl__btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.despl__btn .ph { font-size: 16px; color: var(--ink-muted); transition: transform .2s; flex: none; }
.despl.abierto .despl__btn .ph { transform: rotate(180deg); }
.filtros .despl__btn { height: 40px; border-radius: 999px; font-size: 14px; font-weight: 600; padding: 0 12px 0 16px; }
.despl__lista { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; min-width: 100%; max-height: min(300px, 50vh); overflow: auto;
  margin: 0; padding: 6px; list-style: none; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s; overscroll-behavior: contain; }
.despl.arriba .despl__lista { top: auto; bottom: calc(100% + 6px); transform: translateY(4px); }
.despl.abierto .despl__lista { opacity: 1; transform: none; pointer-events: auto; }
.despl__lista li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 8px; font-size: 14px; white-space: nowrap; cursor: pointer; color: var(--ink-muted); }
.despl__lista li.activa { background: rgba(255, 255, 255, .07); color: var(--ink); }
[data-theme="dia"] .despl__lista li.activa { background: rgba(0, 0, 0, .06); }
.despl__lista li[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.despl__lista li[aria-selected="true"]::after { content: ""; width: 10px; height: 10px; flex: none; background: var(--rojo-arce); transform: skewX(-21deg); }

/* Simulador en ventana flotante: el recuadro de la cuota se ve siempre (su efecto de aparición
   depende del scroll de la página, que dentro de la ventana no ocurre). */
.simu__cuerpo .cuota { opacity: 1 !important; transform: none !important; visibility: visible !important; }
.simu__cuerpo .cuota__monto { font-size: clamp(34px, 4.4vw, 58px); white-space: nowrap; }
