/* assets/css/search-v6.css — /search/ de ESCRITORIO (≥1024px), estructura de la referencia B2B:
 * pestañas Productos · Proveedores · Mundial, título de resultados, filas de chips (atributos y
 * "Seleccionar por") con "Más filtros", grid de 6 columnas, proveedores recomendados, paginación y
 * el drawer de filtros que entra desde la izquierda.
 *
 * MÓVIL NO CAMBIA: todo el marcado nuevo lleva el atributo `hidden` (clase .d6) y TODAS las reglas de
 * este archivo viven dentro de @media (min-width: 1024px). Por debajo de ese ancho el navegador ignora
 * este archivo y la página es exactamente la de antes (.sr-tabs, .mk4-search, drawer móvil…).
 */
@media (min-width: 1024px) {
  :root {
    --d6-ink: #222; --d6-ink-2: #555; --d6-muted: #767676; --d6-line: #e6e6e6; --d6-line-2: #f2f2f2;
    --d6-accent: var(--sv-accent, #AB733C); --d6-accent-ink: #8a5a2b; --d6-accent-soft: var(--sv-accent-soft, #fbf3ea);
    --d6-ok: #16a34a; --d6-radius: 12px;
  }
  /* El marcado de escritorio reemplaza al móvil en la vista de productos (la de proveedores conserva su cuerpo) */
  .d6[hidden] { display: block !important; }
  .sr-tabs { display: none !important; }
  .mk-layout.d6-legacy { display: none !important; }
  .d6, .d6 * { box-sizing: border-box; }
  .d6-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
  .d6 .material-symbols-outlined { font-size: 18px; line-height: 1; }

  /* ── Pestañas ── */
  .d6-tabs { max-width: 1440px; margin: 6px auto 0; padding: 0 24px; }
  .d6-tabs[hidden] { display: flex !important; }
  .d6-tabs { align-items: flex-end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--d6-line); }
  .d6-tabs-nav { display: flex; gap: 36px; }
  .d6-tabs-nav a { position: relative; display: block; padding: 10px 0 12px; font-size: 18px; font-weight: 600; color: var(--d6-muted); text-decoration: none; }
  .d6-tabs-nav a:hover { color: var(--d6-ink); }
  .d6-tabs-nav a.is-active { color: var(--d6-ink); font-weight: 700; }
  .d6-tabs-nav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--d6-ink); }
  .d6-seg { display: flex; align-items: center; gap: 4px; padding-bottom: 10px; font-size: 13px; }
  .d6-seg-label { color: var(--d6-muted); margin-right: 4px; }
  .d6-seg a { padding: 5px 12px; border-radius: 999px; color: var(--d6-ink-2); text-decoration: none; border: 1px solid transparent; }
  .d6-seg a:hover { background: var(--d6-line-2); }
  .d6-seg a.is-active { border-color: var(--d6-ink); color: var(--d6-ink); font-weight: 600; }

  /* ── Contenedor de resultados ── */
  .d6-wrap { max-width: 1440px; margin: 0 auto; padding: 0 24px 32px; color: var(--d6-ink); }
  .d6-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 10px; }
  .d6-title { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 20px; font-weight: 700; line-height: 1.3; min-width: 0; }
  .d6-title-accent { display: inline-flex; align-items: center; gap: 6px; color: var(--d6-accent); }
  .d6-title-accent .material-symbols-outlined { font-size: 20px; align-self: center; }
  .d6-q { color: var(--d6-ink); overflow-wrap: anywhere; }
  .d6-count { font-size: 13px; font-weight: 500; color: var(--d6-muted); }
  .d6-sub { margin: 2px 0 0; font-size: 13px; color: var(--d6-muted); }
  .d6-sort { display: flex; align-items: center; gap: 8px; flex: none; font-size: 13px; color: var(--d6-muted); }
  .d6-sort select { height: 34px; padding: 0 30px 0 12px; border: 1px solid var(--d6-line); border-radius: 999px; background-color: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--d6-ink); cursor: pointer; }
  .d6-sort label { white-space: nowrap; }
  .d6-sort .ik-select { width: auto; min-width: 200px; }
  .d6-sort .ik-select-trigger { height: 34px; min-height: 34px; padding: 0 12px 0 14px; border: 1px solid var(--d6-line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 600; color: var(--d6-ink); box-shadow: none; }
  .d6-sort .ik-select-trigger:hover { border-color: var(--d6-ink); background: #fff; }
  .d6-sec .ik-select-trigger { height: 40px; border: 1px solid #d6d6d6; border-radius: 8px; background: #fff; box-shadow: none; }
  .d6-imgq { display: flex; align-items: center; gap: 14px; min-width: 0; }
  .d6-imgq-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid var(--d6-line); flex: none; }
  .d6-imgq-thumb--ic { display: inline-flex; align-items: center; justify-content: center; background: var(--d6-line-2); color: var(--d6-muted); }

  /* ── Filas de chips + "Más filtros" ── */
  .d6-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: start; padding: 4px 0 6px; }
  .d6-rows { display: grid; gap: 10px; min-width: 0; }
  .d6-row { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .d6-row-label { flex: none; font-size: 13px; font-weight: 600; color: var(--d6-ink-2); white-space: nowrap; }
  .d6-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; scroll-behavior: smooth; padding: 1px; }
  .d6-chips::-webkit-scrollbar { display: none; }
  .d6-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid #dcdcdc; border-radius: 999px; background: #fff; color: var(--d6-ink); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: border-color .15s, background .15s; }
  .d6-chip:hover { border-color: var(--d6-ink); }
  .d6-chip:focus-visible, .d6-more:focus-visible, .d6-pill:focus-visible, .d6-page:focus-visible, .d6-arrow:focus-visible, .d6-active-chip:focus-visible { outline: 2px solid var(--d6-accent); outline-offset: 2px; }
  .d6-chip .material-symbols-outlined { font-size: 16px; color: var(--d6-accent); }
  .d6-chip.is-on { border-color: var(--d6-accent); background: var(--d6-accent-soft); color: var(--d6-accent-ink); font-weight: 600; }
  .d6-chip.is-on .material-symbols-outlined:last-child { color: var(--d6-accent-ink); font-size: 15px; }
  .d6-chip.is-empty { color: #b3b3b3; border-color: #ececec; cursor: not-allowed; }
  .d6-chip.is-empty .material-symbols-outlined { color: #c8c8c8; }
  .d6-chip-n { font-size: 11px; color: var(--d6-muted); font-weight: 500; }
  .d6-arrow { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--d6-line); background: #fff; color: var(--d6-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
  .d6-arrow[hidden] { display: none; }
  .d6-arrow:hover { border-color: var(--d6-ink); }
  .d6-side { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-left: 20px; border-left: 1px solid var(--d6-line); }
  .d6-more { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 18px; border: 1.5px solid var(--d6-ink); border-radius: 999px; color: var(--d6-ink); background: #fff; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
  .d6-more:hover { background: var(--d6-ink); color: #fff; }
  .d6-more-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--d6-accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
  .d6-clear { font-size: 13px; color: var(--d6-ink-2); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
  .d6-clear:hover { color: var(--d6-ink); }

  .d6-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0 2px; }
  .d6-active-chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px 0 12px; border-radius: 999px; background: var(--d6-line-2); color: var(--d6-ink); font-size: 12px; font-weight: 600; text-decoration: none; max-width: 100%; }
  .d6-active-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .d6-active-chip .material-symbols-outlined { font-size: 15px; color: var(--d6-muted); }
  .d6-active-chip:hover { background: #e7e7e7; }
  .d6-active-clear { font-size: 12px; color: var(--d6-accent); font-weight: 600; text-decoration: none; margin-left: 4px; }

  /* ── Grid y tarjeta ── */
  .d6-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; padding-top: 16px; }
  .d6-card { position: relative; display: flex; flex-direction: column; min-width: 0; font-size: 12.5px; color: var(--d6-ink-2); }
  .d6-card-media { position: relative; aspect-ratio: 1 / 1; border-radius: var(--d6-radius); overflow: hidden; background: #f4f4f4; }
  .d6-card-img, .d6-card-img .d6-img { position: absolute; inset: 0; display: block; }
  .d6-img { display: block; background: #f4f4f4 center / cover no-repeat; }
  .d6-card:hover .d6-img { transform: scale(1.03); }
  .d6-card-img .d6-img { transition: transform .35s ease; }
  .d6-fav, .d6-similar { position: absolute; width: 32px; height: 32px; border-radius: 8px; border: none; background: rgba(255,255,255,.92); color: var(--d6-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
  .d6-card .d6-fav { top: 8px; right: 8px; left: auto; bottom: auto; }
  .d6-similar { left: 8px; bottom: 8px; }
  .d6-fav:hover, .d6-similar:hover { background: #fff; color: var(--d6-accent); }
  .d6-fav.is-active { color: #e11d48; }
  .d6-fav.is-active .material-symbols-outlined { font-variation-settings: 'FILL' 1; }
  .d6-match { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(29,37,48,.82); color: #fff; font-size: 11px; font-weight: 700; }
  .d6-match.is-exact { background: var(--d6-ok); }
  .d6-card-title { margin-top: 10px; margin-bottom: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.35; min-height: 2.7em; color: var(--d6-ink); text-decoration: none; }
  .d6-card-title:hover { text-decoration: underline; }
  .d6-card-price { margin-top: 6px; font-size: 18px; font-weight: 700; color: var(--d6-ink); letter-spacing: -.01em; overflow-wrap: anywhere; }
  .d6-card-moq { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d6-dim { color: var(--d6-muted); }
  .d6-card-sup { margin-top: 4px; color: var(--d6-ink-2); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d6-card-sup:hover { color: var(--d6-ink); }
  .d6-card-meta, .d6-sup-meta { margin-top: 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; color: var(--d6-muted); font-size: 12px; }
  .d6-cc { display: inline-flex; align-items: center; gap: 4px; }
  .d6-flag { width: 16px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
  .d6-vbadge { display: inline-flex; align-items: center; gap: 2px; color: #1d4ed8; font-weight: 700; }
  .d6-vbadge .material-symbols-outlined { font-size: 15px; color: #1d4ed8; font-variation-settings: 'FILL' 1; }
  .d6-card-actions { margin-top: 10px; display: flex; gap: 8px; }
  .d6-pill { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 10px; border: 1px solid #222; border-radius: 999px; background: #fff; color: var(--d6-ink); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d6-pill:hover { background: var(--d6-ink); color: #fff; }
  .d6-pill--sm { flex: none; height: 30px; padding: 0 14px; font-size: 12px; }
  .d6-card-foot { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--d6-ink-2); }
  .d6-card-foot > span::before { content: "•"; margin-right: 5px; color: var(--d6-muted); }
  .d6-star { font-size: 14px !important; color: #f59e0b; font-variation-settings: 'FILL' 1; vertical-align: -2px; margin-right: 2px; }

  /* ── Proveedores recomendados ── */
  .d6-sups { margin: 28px 0 6px; padding: 18px 20px 20px; border-radius: 16px; background: #fafafa; border: 1px solid var(--d6-line-2); }
  .d6-sups-title { margin: 0 0 14px; font-size: 17px; font-weight: 700; color: var(--d6-ink); }
  .d6-sups-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .d6-sup { min-width: 0; padding: 14px; border-radius: 12px; background: #fff; border: 1px solid var(--d6-line); }
  .d6-sup-head { display: flex; align-items: flex-start; gap: 10px; }
  .d6-sup-logo { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; border: 1px solid var(--d6-line); }
  .d6-sup-logo--ini { display: inline-flex; align-items: center; justify-content: center; background: var(--d6-accent-soft); color: var(--d6-accent-ink); font-weight: 800; font-size: 17px; }
  .d6-sup-id { flex: 1; min-width: 0; }
  .d6-sup-name { display: block; font-size: 14px; font-weight: 700; color: var(--d6-ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d6-sup-name:hover { text-decoration: underline; }
  .d6-sup-prods { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .d6-sup-prod { min-width: 0; text-decoration: none; color: var(--d6-ink); }
  .d6-sup-prod .d6-img { aspect-ratio: 1 / 1; border-radius: 8px; }
  .d6-sup-price { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ── Paginación / vacío / botones ── */
  .d6-pages { display: flex; justify-content: center; gap: 8px; padding: 32px 0 8px; }
  .d6-page { min-width: 36px; height: 36px; padding: 0 8px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--d6-ink); font-size: 14px; font-weight: 600; text-decoration: none; }
  .d6-page:hover { background: var(--d6-line-2); }
  .d6-page.is-on { background: var(--d6-ink); color: #fff; }
  .d6-empty { text-align: center; padding: 56px 16px 40px; }
  .d6-empty > .material-symbols-outlined { font-size: 44px; color: var(--d6-muted); }
  .d6-empty h2 { margin: 10px 0 6px; font-size: 20px; color: var(--d6-ink); }
  .d6-empty p { margin: 0 auto; max-width: 520px; color: var(--d6-muted); font-size: 14px; }
  .d6-empty-actions { margin-top: 18px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
  .d6-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: 1px solid #222; border-radius: 999px; background: #fff; color: var(--d6-ink); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
  .d6-btn:hover { background: var(--d6-line-2); }
  .d6-btn--solid { background: var(--d6-accent); border-color: var(--d6-accent); color: #fff; }
  .d6-btn--solid:hover { background: var(--d6-accent-ink); }
  .d6-btn--ghost { border-color: transparent; color: var(--d6-muted); text-decoration: underline; }

  /* ── Drawer "Más filtros" (izquierda) ── */
  html.d6-lock, html.d6-lock body { overflow: hidden !important; }
  .d6-scrim { position: fixed; inset: 0; z-index: 2147483000; background: rgba(0,0,0,.45); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
  .d6-drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 2147483001; width: 360px; max-width: 92vw; background: #fff; box-shadow: 8px 0 30px rgba(0,0,0,.18); transform: translateX(-100%); visibility: hidden; transition: transform .28s ease, visibility .28s; outline: none; }
  .d6-drawer.is-open, html:not(.d6-js) .d6-drawer:target { transform: none; visibility: visible; }
  .d6-scrim.is-open, html:not(.d6-js) .d6-drawer:target ~ .d6-scrim { opacity: 1; visibility: visible; }
  .d6-drawer-form { display: flex; flex-direction: column; height: 100%; margin: 0; }
  .d6-drawer-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--d6-line); }
  .d6-drawer-head h2 { margin: 0; font-size: 19px; font-weight: 700; color: var(--d6-ink); }
  .d6-drawer-x { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--d6-ink); text-decoration: none; }
  .d6-drawer-x .material-symbols-outlined { font-size: 24px; }
  .d6-drawer-x:hover { background: var(--d6-line-2); }
  .d6-drawer-x:focus-visible, .d6-opt input:focus-visible, .d6-input:focus-visible, .d6-apply:focus-visible, .d6-drawer .d6-clear:focus-visible { outline: 2px solid var(--d6-accent); outline-offset: 2px; }
  .d6-drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 16px; }
  .d6-sec { margin: 0; padding: 16px 0; border: 0; border-bottom: 1px solid var(--d6-line); min-width: 0; }
  .d6-sec:last-child { border-bottom: 0; }
  .d6-sec legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--d6-ink); }
  .d6-sec legend + * { clear: both; }
  .d6-opt { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; color: var(--d6-ink); cursor: pointer; }
  .d6-opt input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--d6-accent); cursor: pointer; }
  .d6-opt-l { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
  .d6-opt-n { flex: none; font-size: 12px; color: var(--d6-muted); }
  .d6-ic-shield { color: var(--d6-accent); font-variation-settings: 'FILL' 1; }
  .d6-hint { margin: -2px 0 6px 27px; font-size: 12px; color: var(--d6-muted); line-height: 1.4; }
  .d6-sec > legend + .d6-hint { margin-left: 0; margin-bottom: 8px; }
  .d6-subs { margin: 4px 0 0 26px; padding-left: 10px; border-left: 2px solid var(--d6-line-2); }
  .d6-input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #d6d6d6; border-radius: 8px; background: #fff; font: inherit; font-size: 14px; color: var(--d6-ink); }
  .d6-input:focus { border-color: var(--d6-ink); }
  .d6-range { display: flex; align-items: center; gap: 10px; }
  .d6-range .d6-input { flex: 1; min-width: 0; }
  .d6-drawer-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--d6-line); background: #fff; box-shadow: 0 -4px 14px rgba(0,0,0,.05); }
  .d6-apply { flex: 0 0 52%; height: 42px; border: 0; border-radius: 999px; background: var(--d6-accent); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
  .d6-apply:hover { background: var(--d6-accent-ink); }
}

@media (min-width: 1200px) { .d6-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1360px) { .d6-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1024px) and (max-width: 1199px) {
  .d6-sups-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d6-sups-grid > .d6-sup:nth-child(3) { display: none; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .d6-drawer, .d6-scrim, .d6-card-img .d6-img { transition: none; }
  .d6-chips { scroll-behavior: auto; }
}
