@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@600;700&display=swap");

:root {
  --rojo: #e20311;
  --tinta: #1c1c1c;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  color: var(--tinta);
  background: #f4f4f4;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}
a { color: inherit; }
.art-img img, .hero img { max-width: 100%; height: auto; }

.barra {
  background: var(--rojo);
  color: #fff;
  border-bottom: 1px solid #000;
  position: sticky;
  top: 0;
  z-index: 40;
}
.barra-inner {
  display: flex;
  align-items: stretch;
  min-height: 100px;
  padding: 0 8px;
  gap: 0;
}
.logo { display: flex; align-items: center; padding: 4px 16px 4px 10px; flex: 0 0 auto; }
.logo img { height: 92px; width: auto; object-fit: contain; display: block; }
.menu-toggle {
  display: none;
  margin: 18px 8px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 4px;
  padding: 6px 10px;
  font-weight: 700;
}
.mainnav {
  display: flex;
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  padding: 0;
  list-style: none;
  flex-wrap: nowrap;
  overflow: visible;
  font-family: "Quicksand", "Segoe UI", Helvetica, Arial, sans-serif;
}
.mainnav > li {
  position: relative;
  flex: 0 1 128px;
  min-width: 96px;
  max-width: 150px;
  border-left: 1px solid #e36a6a;
  border-right: 1px solid #9c3737;
  text-align: center;
}
.mainnav > li.nav-cuenta { margin-left: auto; }
.mainnav > li.nav-cuenta ~ li.nav-cuenta { margin-left: 0; }
.nav-cuenta > .menu-panel { left: auto; right: 0; }
.mainnav > li > form { margin: 0; height: 100%; }
.mainnav > li > a,
.mainnav > li > button.navbtn,
.mainnav > li > form > button.navbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 100px;
  padding: 6px 8px 8px;
  color: #fff;
  background: transparent;
  border: 0;
  width: 100%;
  text-decoration: none;
  font-family: "Quicksand", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  cursor: pointer;
  text-shadow: 1px 1px 1px rgba(0,0,0,.2);
}
.mainnav img { width: 54px; height: 54px; max-width: none; object-fit: contain; flex: 0 0 auto; }
.mainnav > li:hover,
.mainnav > li.abierto { background: rgba(0,0,0,.12); }
.menu-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 520px;
  max-width: 92vw;
  background: #fff;
  color: #222;
  padding: 8px;
  z-index: 50;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  grid-template-columns: repeat(4, 1fr);
  gap: 2px 6px;
  text-align: left;
}
.mainnav > li:hover > .menu-panel,
.mainnav > li.abierto > .menu-panel { display: grid; }
.menu-panel a {
  display: block;
  padding: 5px 6px;
  color: #333;
  text-decoration: none;
  font-family: "Quicksand", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.menu-panel a:hover { background: #f4f4f4; color: var(--rojo); }
.user-panel { width: 220px; grid-template-columns: 1fr; }
.user-panel form { margin: 0; }
.user-panel button.link {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 5px 6px;
  font-family: "Quicksand", "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 700;
  cursor: pointer;
  color: #333;
}
.flota {
  position: fixed;
  right: 16px;
  z-index: 30;
  width: 48px;
  height: 48px;
}
.flota img { width: 48px; height: 48px; }
.flota.maps { bottom: 118px; }
.flota.wp { bottom: 54px; }
.flota.cart { bottom: 182px; }
.modal-login {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; z-index: 80; padding: 24px 16px;
}
.modal-login.abierto { display: flex; align-items: center; justify-content: center; }
.modal-login .caja {
  background: #fff; color: #222; width: 380px; max-width: 100%;
  border-radius: 8px; padding: 22px 20px 18px; box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
.modal-login h2 { margin: 0 0 16px; text-align: center; font-size: 22px; }
.modal-login .campo input { width: 100%; display: block; }
.modal-acciones { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.modal-acciones .btn, .modal-acciones a.btn { width: 100%; text-align: center; }
.flota .badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #009688;
  color: #fff;
  border-radius: 10px;
  font-size: 12px;
  padding: 1px 6px;
  font-weight: 700;
}

.wrap { max-width: 1880px; margin: 0 auto; padding: 8px 10px; }
.aviso {
  background: #fff8e8;
  border: 1px solid #f0d48a;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.cerrado {
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  text-align: center;
}

.buscar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.buscar input, .buscar select, .campo input, .campo select, .tabla input, .tabla select {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}
.buscar input[type=search] { flex: 1; min-width: 180px; }
.buscador-central {
  max-width: 680px;
  margin: 4px auto 16px;
  display: flex;
}
.buscador-central input {
  flex: 1;
  border: 1px solid #ccc;
  border-right: 0;
  padding: 9px 12px;
  font-size: 16px;
}
.buscador-central button {
  background: #5bc0de;
  color: #fff;
  border: 1px solid #46b8da;
  padding: 8px 18px;
  font-weight: 700;
  cursor: pointer;
}
.catalogo { display: flex; gap: 8px; align-items: flex-start; }
.catalogo-main { flex: 1; min-width: 0; container-type: inline-size; }
.filtros { width: 176px; flex: none; }
.filtro {
  background: #fff;
  border: 1px solid #ddd;
  margin-bottom: 8px;
  overflow: hidden;
}
.filtro .cab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #323232;
  color: #fff;
  border: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
  text-align: left;
}
.filtro .cab-titulo { flex: none; }
.filtro .elegido {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  letter-spacing: 0;
  color: #ffd0d3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filtro .flecha {
  margin-left: auto;
  flex: none;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #fff;
}
.filtro.abierto .flecha {
  border-top: 0;
  border-bottom: 5px solid #fff;
}
.filtro .cuerpo { display: none; max-height: 240px; overflow: auto; }
.filtro.abierto .cuerpo { display: block; }
.filtro .busca {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  padding: 4px;
  border-bottom: 1px solid #eee;
}
.filtro .busca input { width: 100%; border: 1px solid #ddd; padding: 4px 6px; font-size: 12px; }
.filtro a {
  display: block;
  padding: 4px 8px;
  color: #333;
  text-decoration: none;
  font-size: 12px;
}
.filtro a:hover, .filtro a.activo { background: #f7f7f7; color: var(--rojo); font-weight: 700; }
.limpiar-filtros { display: inline-block; margin-bottom: 8px; font-size: 12px; }
.btn {
  background: var(--rojo);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn.sec { background: #444; }
.btn.ghost { background: #fff; color: var(--tinta); border: 1px solid #ccc; }
.btn.ok { background: #1d7a32; }
.btn.sm { padding: 4px 8px; font-size: 13px; }

.hero { position: relative; margin: 0 auto 12px; background: #fff; overflow: hidden; }
.hero-slide { display: none; }
.hero-slide.activo { display: block; }
.hero img { width: 100%; height: auto; max-height: none; object-fit: contain; display: block; background: #fff; }
.hero-nav {
  position: absolute; top: 0; bottom: 0; width: 46px;
  background: none; color: #fff; border: 0; cursor: pointer;
  font-size: 42px; line-height: 1; text-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.hero-nav.prev { left: 0; }
.hero-nav.next { right: 0; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
.hero-dots button {
  width: 10px; height: 10px; border-radius: 50%; padding: 0;
  border: 1px solid #fff; background: rgba(255,255,255,.7); cursor: pointer;
}
.hero-dots button.activo { background: #f39c12; }
.foto-previa {
  width: 220px; height: 220px; margin-bottom: 14px;
  background: #fafafa; border: 1px solid #eee;
  display: flex; align-items: center; justify-content: center; color: #888;
}
.foto-previa img { max-width: 100%; max-height: 100%; object-fit: contain; }
.foto-slot { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.foto-slot img, .foto-vacia {
  width: 72px; height: 72px; object-fit: contain; background: #fafafa; border: 1px solid #eee;
}
.foto-vacia { display: flex; align-items: center; justify-content: center; font-size: 11px; color: #888; text-align: center; }
.tabla td.mini { width: 56px; }
.tabla td.mini img { width: 48px; height: 48px; object-fit: contain; background: #fafafa; display: block; }
.tabla-scroll { overflow-x: auto; }
.banner-admin .ayuda { color: #777; font-size: 13px; }
.banner-alta { display: grid; grid-template-columns: 1.3fr 1fr 1.4fr auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.banner-thumb { width: 240px; max-height: 72px; object-fit: contain; background: #f7f7f7; display: block; }
.banner-admin .tabla input { width: 100%; min-width: 140px; }
.nowrap { white-space: nowrap; }
.nowrap form { display: inline; }

.grilla {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
}
@container (min-width: 1200px) {
  .grilla { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
.card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
}
.art-img { position: relative; background: #fafafa; height: 118px; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.art-img img { max-height: 110px; max-width: 100%; width: auto; object-fit: contain; }
.tag {
  position: absolute; top: 8px; left: 8px;
  color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 7px; border-radius: 4px; letter-spacing: .03em;
}
.tag-NOVEDAD { background: #1d7a32; }
.tag-PREVENTA { background: #0b6aa2; }
.tag-OFERTA { background: #e6a100; color: #1c1c1c; }
.tag-PROXIMAMENTE { background: #3d4db7; }
.tag-SINSTOCK { background: var(--rojo); }
.fotos-n { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 10px; }
.elegir {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 28px; height: 28px; margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.28); cursor: pointer;
}
.elegir input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.card.elegida { outline: 2px solid var(--rojo); outline-offset: -2px; }
.sel-ayuda { color: #666; font-size: 13px; }
.sel-bar {
  position: fixed; left: 12px; right: 76px; bottom: 12px; z-index: 35;
  display: none; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e6e6e6; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16); padding: 10px 12px;
}
.sel-bar.visible { display: flex; }
.sel-bar span { font-weight: 700; margin-right: auto; }
.sel-bar em { font-style: normal; font-weight: 600; color: var(--rojo); margin-left: 6px; }
body.con-seleccion { padding-bottom: 76px; }
.sel-fondo {
  position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45);
  display: none; align-items: flex-end; justify-content: center;
}
.sel-fondo.abierto { display: flex; }
.sel-caja {
  width: min(880px, 100%); max-height: min(86vh, 720px);
  background: #fff; border-radius: 14px 14px 0 0; padding: 16px 16px 20px;
  display: flex; flex-direction: column; box-shadow: 0 -8px 30px rgba(0,0,0,.2);
}
.sel-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sel-cabeza h2 { margin: 0; font-size: 22px; }
.sel-cuerpo { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; min-height: 0; margin-top: 12px; }
.sel-rotulo { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #555; }
.sel-lista { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: 46vh; border: 1px solid #eee; border-radius: 8px; }
.sel-lista li { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-bottom: 1px solid #f2f2f2; font-size: 13px; }
.sel-lista li:last-child { border-bottom: 0; }
.sel-lista .cod { color: #666; font-size: 11px; }
.sel-lista .txt { flex: 1; min-width: 0; }
.sel-lista .txt b, .sel-lista .txt span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-lista .txt span { text-transform: uppercase; }
.sel-quitar-uno { border: 0; background: transparent; color: #888; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.sel-o { margin: 14px 0 8px; color: #666; font-size: 13px; }
.sel-acciones { display: flex; gap: 8px; }
.sel-acciones .btn { flex: 1; }
.sel-msg { min-height: 20px; margin: 10px 0; font-weight: 700; }
.sel-msg.mal { color: var(--rojo); }
.sel-msg.ok { color: #1d7a32; }
#selVer { display: none; text-align: center; }
#selVer.visible { display: block; }
.card h2 { font-size: 13px; margin: 6px 8px 0; line-height: 1.25; min-height: 32px; text-transform: uppercase; }
.filtro a, .filtro .elegido, .mayus { text-transform: uppercase; }
.codigo { margin: 2px 8px 4px; color: #666; font-size: 11px; }
.precio { margin: 0 8px 6px; font-size: 13px; }
.costo { color: #0b57d0; font-weight: 800; }
.venta { color: var(--rojo); font-weight: 800; }
.resumen { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.margen-box { display: none; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 700; }
body.ver-margen .margen-box { display: flex; }
.margen-box input { width: 72px; text-align: center; padding: 4px 6px; }
.margen-box.ok input { border-color: #1d7a32; }
.margen-box.mal input { border-color: var(--rojo); }
.card form, .card .acciones { margin: 0 8px 8px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.card form input[type=number] { width: 64px; }
.card form select { max-width: 120px; }

.mas-estado { text-align: center; color: #666; font-size: 13px; margin: 12px 0 0; min-height: 18px; }
.paginador { display: flex; gap: 6px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.paginador a, .paginador span {
  min-width: 34px; text-align: center; padding: 6px 8px; border-radius: 6px;
  background: #fff; text-decoration: none; border: 1px solid #e5e5e5;
}
.paginador .actual { background: var(--rojo); color: #fff; border-color: var(--rojo); }

.tabla { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.tabla th, .tabla td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; font-size: 14px; }
.tabla th { background: #fafafa; }
.panel { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.panel h2 { margin: 0 0 8px; font-size: 20px; }
.pestanas { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 2px solid #e6e6e6; }
.pestanas a {
  padding: 10px 16px;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  color: #444;
  font-weight: 700;
  text-decoration: none;
}
.pestanas a.activa { color: var(--rojo); border-bottom-color: var(--rojo); }
.pestanas .pill {
  display: inline-block;
  margin-left: 6px;
  background: var(--rojo);
  color: #fff;
  border-radius: 10px;
  font-size: 12px;
  padding: 1px 7px;
}
.pasos { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.paso { background: #f6f7f8; border-radius: 8px; padding: 8px 12px; min-width: 140px; font-size: 13px; color: #444; }
.paso b { display: block; font-size: 20px; color: #222; }
.pasos-txt { margin: 0 0 12px; padding-left: 18px; color: #444; }
.pasos-txt li { margin: 4px 0; }
.nota { color: #444; margin: 10px 0; }
.revision-scroll { max-height: 480px; overflow: auto; }
.campo { margin-bottom: 10px; }
.campo label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.campo input, .campo select { width: 100%; }
.fila { display: flex; gap: 10px; flex-wrap: wrap; }
.fila .campo { flex: 1; min-width: 140px; }

.modal-fotos {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 56px 20px 20px;
}
.modal-fotos.abierto { display: flex; }
.modal-fotos .marco {
  width: min(720px, 92vw);
  height: min(720px, 78vh);
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.modal-fotos img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.modal-fotos .cerrar { position: absolute; top: 12px; right: 12px; z-index: 2; }

@media (max-width: 760px) {
  .catalogo { flex-direction: column; align-items: stretch; }
  .catalogo-main, .filtros { width: 100%; }
  .grilla { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sel-cuerpo { grid-template-columns: 1fr; }
  .sel-lista { max-height: 28vh; }
  .sel-bar { right: 12px; bottom: 112px; }
  body.con-seleccion { padding-bottom: 190px; }
  .banner-alta { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .barra-inner { flex-wrap: wrap; min-height: 72px; }
  .logo img { height: 58px; }
  .menu-toggle { display: inline-block; margin-left: auto; }
  .mainnav { display: none; flex: 1 0 100%; max-width: none; margin-left: 0; overflow: visible; background: var(--rojo); }
  .mainnav.abierto { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mainnav > li { min-width: 0; max-width: none; margin-left: 0; }
  .mainnav > li > a,
  .mainnav > li > button.navbtn,
  .mainnav > li > form > button.navbtn { min-height: 96px; }
  .mainnav img { width: 44px; height: 44px; }
  .menu-panel { position: static; width: auto; grid-column: 1 / -1; }
}
@media print {
  .barra, .no-print, .flota, .sel-bar, .sel-fondo { display: none !important; }
  body { background: #fff; }
}
