/* ROVEX · tienda */
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); transition: top 160ms var(--ease-out); }
.skip:focus { top: 12px; }

/* Encabezado */
.top { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 24px; min-height: 72px; padding-block: 8px; }
.brand { display: block; line-height: 0; margin-left: -10px; }
.brand img { height: 52px; width: auto; }
.search { position: relative; max-width: 640px; width: 100%; justify-self: center; }
.search .input { padding-left: 46px; border-radius: 99px; background: var(--tile); border-color: transparent; }
.search .input:hover { border-color: var(--line-strong); }
.search .input:focus { background: #fff; border-color: var(--ink); }
.search-ico { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--ink-2); pointer-events: none; }
.search-ico svg { width: 20px; height: 20px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-link { font-size: 0.875rem; font-weight: 600; text-decoration: none; padding: 10px 12px; border-radius: 99px; transition: background-color 160ms ease; }
.cart-btn { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--ink); color: #fff; transition: transform 160ms var(--ease-out); touch-action: manipulation; }
.cart-btn:active { transform: scale(0.94); }
.cart-btn svg { width: 22px; height: 22px; }
.cart-count { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--orange); color: var(--ink); font-size: 0.75rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.cart-count.bump { animation: bump 320ms var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.25); } }
@media (hover: hover) and (pointer: fine) { .top-link:hover { background: var(--tile); } }

@media (max-width: 720px) {
  .top-row { grid-template-columns: 1fr auto; min-height: 0; gap: 8px 12px; }
  .brand img { height: 44px; }
  .top-link { display: none; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .top-actions { grid-column: 2; grid-row: 1; }
}

/* Carrusel de anuncios */
.hero { padding-top: 20px; }
.carousel { position: relative; border-radius: 16px; overflow: hidden; background: var(--tile); aspect-ratio: 2056 / 765; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.car-skeleton { position: absolute; inset: 0; background: linear-gradient(100deg, var(--tile) 30%, #fff 50%, var(--tile) 70%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.car-track { display: flex; height: 100%; transition: transform 520ms var(--ease-drawer); will-change: transform; }
.car-track.dragging { transition: none; }
.car-slide { position: relative; flex: 0 0 100%; height: 100%; display: block; }
.car-slide img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.car-btn { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.92); color: var(--ink); display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); transition: transform 160ms var(--ease-out), background-color 160ms ease, opacity 200ms ease; }
.car-btn:active { transform: scale(0.92); }
.car-btn svg { width: 22px; height: 22px; }
.car-btn.prev { left: 12px; }
.car-btn.next { right: 12px; }
.car-dots { position: absolute; left: 50%; bottom: 10px; translate: -50% 0; display: flex; gap: 2px; padding: 2px 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.85); }
.car-dot { width: 24px; height: 24px; border: 0; background: transparent; display: grid; place-items: center; padding: 0; }
.car-dot::after { content: ""; width: 8px; height: 8px; border-radius: 99px; background: #b8b5ad; transition: width 240ms var(--ease-out), background-color 240ms ease; }
.car-dot[aria-current="true"]::after { width: 22px; background: var(--ink); }
@media (hover: hover) and (pointer: fine) { .car-btn:hover { background: #fff; } }
@media (max-width: 720px) {
  .hero { padding-top: 12px; }
  .carousel { border-radius: 12px; }
  .car-btn { display: none; }
  .car-dots { bottom: 4px; }
}

/* Buscador por marca y pieza */
.finder { padding-top: 0; }
.finder-head { margin-bottom: 20px; }
.finder-head h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem); font-weight: 800; }
.finder-head p { margin-top: 6px; }
.chip-block { display: grid; gap: 8px; margin-top: 16px; }
.chip-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line-strong); border-radius: 99px; background: #fff; font-size: 0.9375rem; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease; touch-action: manipulation; }
.chip small { font-size: 0.75rem; color: var(--muted); font-weight: 500; transition: color 160ms ease; }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] small { color: #d6d3cc; }
@media (hover: hover) and (pointer: fine) { .chip:hover:not([aria-pressed="true"]) { border-color: var(--ink); } }
@media (max-width: 720px) {
  /* En móvil las marcas se deslizan en una sola fila para no ocupar toda la pantalla */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; scroll-snap-type: x proximity; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; scroll-snap-align: start; }
}

/* Resultados */
.results { padding-top: 40px; padding-bottom: 72px; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.res-title { font-size: 1.25rem; }
.res-count { font-size: 0.875rem; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.sort select { min-height: 44px; width: auto; min-width: 210px; font-size: 0.9375rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .sort select { min-width: 0; } }

.card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 200ms ease, box-shadow 200ms ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.card-img { position: relative; aspect-ratio: 1; background: var(--tile); border: 0; padding: 0; display: block; width: 100%; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.card-badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 16px; flex: 1; }
.card-brands { font-size: 0.75rem; font-weight: 600; color: var(--orange-ink); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-name { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: left; background: none; border: 0; padding: 0; }
.card-name::after { content: ""; position: absolute; inset: 0; }
.card-compat { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.price { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.add-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--orange); color: var(--ink); display: grid; place-items: center; flex: none; transition: transform 160ms var(--ease-out), background-color 160ms ease; touch-action: manipulation; }
.add-btn svg { width: 22px; height: 22px; }
.add-btn:active:not(:disabled) { transform: scale(0.92); }
.add-btn:disabled { background: var(--tile); color: #9a978f; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { border-color: var(--ink); }
  .add-btn:hover:not(:disabled) { background: var(--orange-press); }
}
@media (max-width: 560px) { .card-body { padding: 10px 10px 12px; } .price { font-size: 1.0625rem; } .card-name { font-size: 0.875rem; } }

.empty { grid-column: 1 / -1; text-align: center; padding: 56px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); }
.empty h3 { font-size: 1.125rem; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.more { display: flex; justify-content: center; margin-top: 32px; }

/* Pie */
.foot { background: var(--tile); border-top: 1px solid var(--line); }
.foot-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-top: 40px; padding-bottom: 24px; }
.foot-row img { height: 49px; width: auto; margin-left: -8px; }
.foot-tag { margin-top: 8px; font-size: 0.875rem; max-width: 28ch; }
.foot-info { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 0.9375rem; align-content: start; }
.foot-info li { display: flex; gap: 10px; align-items: flex-start; }
.foot-info svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--ink-2); }
.foot-info a { font-weight: 600; }
.foot-legal { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-block: 16px 100px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); }

/* WhatsApp flotante */
.wa-float { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45; display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 18px 0 16px; border-radius: 99px; background: var(--wa); color: #fff; text-decoration: none; font-weight: 600; font-size: 0.9375rem; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); transition: transform 160ms var(--ease-out), box-shadow 160ms ease; touch-action: manipulation; }
.wa-float svg { width: 28px; height: 28px; }
.wa-float:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .wa-float:hover { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3); } }
@media (max-width: 560px) { .wa-float { width: 56px; padding: 0; justify-content: center; } .wa-text { display: none; } }

/* Ventanas: producto y carrito */
dialog { border: 0; padding: 0; color: inherit; }
dialog::backdrop { background: rgba(18, 18, 18, 0.5); opacity: 0; transition: opacity 220ms ease; }
dialog[data-open]::backdrop { opacity: 1; }
body.lock { overflow: hidden; }

.modal { width: min(920px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border-radius: 20px; background: #fff; overflow: auto; opacity: 0; transform: scale(0.96) translateY(8px); transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-out); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3); overscroll-behavior: contain; }
.modal[data-open] { opacity: 1; transform: none; }
.pd { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 420px; }
.pd-media { background: var(--tile); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.pd-main { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #fff; }
.pd-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-thumb { width: 60px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #fff; transition: border-color 160ms ease, transform 160ms var(--ease-out); }
.pd-thumb:active { transform: scale(0.95); }
.pd-thumb[aria-current="true"] { border-color: var(--ink); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.pd-close { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, 0.9); z-index: 2; }
.pd-sku { font-size: 0.8125rem; color: var(--muted); }
.pd-name { font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem); font-weight: 700; }
.pd-price { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.pd-desc { color: var(--ink-2); font-size: 0.9375rem; }
.pd-meta { display: grid; gap: 4px; font-size: 0.875rem; }
.pd-meta b { font-weight: 600; }
.pd-brands { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-actions { display: flex; gap: 10px; align-items: stretch; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.pd-actions .btn-add { flex: 1; min-width: 160px; }
.stock-line { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600; }
.stock-line::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--ok); }
.stock-line.low { color: var(--warn); } .stock-line.low::before { background: #d98a00; }
.stock-line.out { color: var(--bad); } .stock-line.out::before { background: var(--bad); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: var(--radius); }
.qty button { width: 44px; height: 44px; border: 0; background: transparent; border-radius: var(--radius); display: grid; place-items: center; transition: background-color 160ms ease, transform 160ms var(--ease-out); touch-action: manipulation; }
.qty button:active:not(:disabled) { transform: scale(0.9); }
.qty button:disabled { opacity: 0.35; }
.qty button svg { width: 18px; height: 18px; }
.qty output { min-width: 32px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .qty button:hover:not(:disabled) { background: var(--tile); } }
@media (max-width: 720px) {
  .modal { width: 100vw; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; transform: translateY(40px); }
  .pd { grid-template-columns: 1fr; }
  .pd-media { padding: 12px; }
  .pd-info { padding: 20px 16px 24px; }
}

/* Carrito lateral */
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: none; width: min(430px, 100vw); background: #fff; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 320ms var(--ease-drawer); box-shadow: -12px 0 48px rgba(0, 0, 0, 0.18); }
.drawer[open] { display: flex; }
.drawer[data-open] { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.25rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; overscroll-behavior: contain; }
.drawer-foot { padding: 16px 20px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 12px; background: #fff; }
.ci { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ci:last-child { border-bottom: 0; }
.ci img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--tile); }
.ci-name { font-weight: 600; font-size: 0.9375rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ci-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.ci .qty button { width: 38px; height: 38px; }
.ci-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.ci-del { color: var(--muted); }
.sum { display: grid; gap: 6px; font-size: 0.9375rem; }
.sum > div { display: flex; justify-content: space-between; }
.sum .total { font-size: 1.125rem; font-weight: 700; padding-top: 8px; border-top: 1px solid var(--line); }
.ship-bar { font-size: 0.8125rem; color: var(--ink-2); }
.ship-bar i { display: block; height: 6px; border-radius: 99px; background: var(--tile); margin-top: 6px; overflow: hidden; }
.ship-bar i b { display: block; height: 100%; background: var(--orange); border-radius: 99px; transition: width 400ms var(--ease-out); }
.cart-empty { text-align: center; padding: 64px 12px; }
.cart-empty p { margin-bottom: 16px; }

/* Pausa del carrusel */
.car-pause { position: absolute; left: 12px; bottom: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.9); color: var(--ink); display: grid; place-items: center; transition: transform 160ms var(--ease-out); }
.car-pause:active { transform: scale(0.92); }
.car-pause svg { width: 16px; height: 16px; }
@media (max-width: 720px) { .car-pause { left: 6px; bottom: 2px; width: 32px; height: 32px; } }
