/* Mercado en Línea · sistema visual abierto, 2026 */
:root {
	color-scheme: light;
	--radio: 5px;
	--primario: #2547D0;
	--primario-hover: #1935AC;
	--secundario: #182747;
	--acento: #D7F34A;
	--acento-hover: #C5E62D;
	--coral: #FF684D;
	--fondo: #FFFFFF;
	--superficie: #FFFFFF;
	--texto: #20283A;
	--tinta: #182747;
	--apagado: #687184;
	--bordes: #E9E1D7;
	--tinte: #E9EDFF;
	--radius: var(--radio);
	--nav-h: 72px;
	--header-h: 72px;
	--fuente-titulos: 'DM Sans', 'MEL', system-ui, sans-serif;
	--fuente-texto: 'DM Sans', 'MEL', system-ui, sans-serif;
}
@media (max-width: 749px) { :root { --header-h: 65px; --nav-h: 70px; } }

html { scroll-behavior: smooth; }
body, input, select, textarea, button { font-family: var(--fuente-texto); }
body { font-size: 15px; line-height: 1.55; background: var(--fondo); color: var(--texto); -webkit-font-smoothing: antialiased; }
h1, h2, h3, #logo { font-family: var(--fuente-titulos); letter-spacing: -.035em; }
h1, h2 { font-weight: 750; line-height: 1.08; }
a { color: var(--primario); }
a:hover { color: var(--primario-hover); }
small { color: var(--apagado); }
:focus-visible { outline: 3px solid rgb(86 48 79 / 42%); outline-offset: 3px; }

button, .boton, .boton:link, .boton:active, .boton:visited {
	box-sizing: border-box; border: 1px solid transparent; border-radius: var(--radio);
	background: var(--primario); color: #fff; font-weight: 700; box-shadow: none;
}
@media (hover: hover) {
	button:hover, .boton:hover, .boton:focus, button:focus-visible, .boton:focus-visible {
		background: var(--primario-hover); border-color: transparent; color: #fff;
	}
}
@media (max-width: 749px) {
	button, .boton, .boton:link, .boton:active, .boton:visited { justify-content: center; height: 52px; }
}
#cuerpo { gap: 26px; background: transparent; box-shadow: none; }
.boton.secundario, #cuerpo .boton.secundario { background: transparent; color: var(--tinta); border: 1px solid rgb(255 255 255 / 58%); }
.boton.secundario:hover { background: rgb(255 255 255 / 12%); }

/* Navegación lateral de escritorio */
#superior { position: fixed; inset: 0 auto 0 0; z-index: 1002; display: block; width: 264px; height: 100dvh; padding: 26px 18px; overflow-y: auto; background: #182747; border-right: 1px solid #263858; box-shadow: none; backdrop-filter: none; }
#contenido-superior { display: flex; width: 100%; max-width: none; min-height: 0; margin: 0; flex-direction: column; align-items: stretch; gap: 28px; }
#logo { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: auto; min-width: 0; height: 46px; padding: 0; background: none; color: #FFF8F0; font-size: 18px; font-weight: 800; text-align: left; text-transform: none; letter-spacing: -.055em; }
#logo::before { content: 'm'; display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: var(--radio); background: var(--coral); color: #182747; font-size: 23px; font-weight: 800; letter-spacing: -.07em; }
@media (hover: hover) { #logo:hover, #logo:focus { background: none; color: var(--acento); } }
#test { display: none; }
#menu_test { position: static; display: flex !important; width: 100%; flex-direction: column; align-items: stretch; gap: 7px; }
#menu_test #busqueda-form { display: none !important; }
#menu_test > .boton { display: flex; width: 100%; min-height: 44px; height: auto; justify-content: flex-start; padding: 0 12px; border: 0; border-radius: var(--radio); background: transparent; color: #E7ECFF; font-size: 14px; font-weight: 600; text-align: left; }
#menu_test > .boton svg { flex: none; width: 17px; height: 17px; margin-right: 10px; }
#menu_test > .boton:hover { background: #263858; color: #fff; }
#menu_test > .boton.cta, #menu_test > .boton.cta:link, #menu_test > .boton.cta:visited { justify-content: center; margin-top: 6px; background: var(--primario); color: #fff; }
@media (hover: hover) { #menu_test > .boton.cta:hover { background: var(--primario-hover); color: #fff; } }
#menu_test > .boton.publicar-nav { margin-top: 12px; background: var(--acento); color: var(--tinta); font-weight: 800; }
#menu_test > .boton.publicar-nav:hover { background: var(--acento-hover); color: var(--tinta); }
#main-wrapper { --contenido-inset: clamp(28px, 4vw, 64px); max-width: none; min-height: 100vh; margin: 0 0 0 264px; padding: 96px var(--contenido-inset) 60px; }
#barra-superior { position: fixed; z-index: 1001; top: 0; right: 0; left: 264px; display: flex; justify-content: stretch; padding: 14px var(--contenido-inset, clamp(28px, 4vw, 64px)); background: rgb(255 255 255 / 96%); border-bottom: 1px solid rgb(24 39 71 / 9%); backdrop-filter: blur(16px); }
#barra-superior #busqueda-form { display: flex !important; width: 100%; margin: 0; overflow: hidden; border: 1px solid var(--bordes); border-radius: var(--radio); background: #fff; }
#barra-superior #busqueda-form input[type=search] { min-width: 0; height: 46px; padding: 0 14px; border: 0; border-radius: 0; background: #fff; }
#barra-superior #busqueda-form button { flex: none; width: 48px; height: 46px; padding: 0; border: 0; border-radius: 0; background: var(--primario); color: #fff; font-size: 0; }
#barra-superior #busqueda-form button svg { width: 17px; height: 17px; margin: 0; }
#barra-superior .boton { display: none; }
#sugerencias { position: fixed; z-index: 1003; top: 64px; right: var(--contenido-inset, clamp(28px, 4vw, 64px)); left: calc(264px + var(--contenido-inset, clamp(28px, 4vw, 64px))); width: auto; border: 1px solid var(--bordes); border-radius: var(--radio); box-shadow: 0 12px 28px rgb(23 44 41 / 10%); }
#menu_overlay { display: none; }
/* Portada */
.hero {
	position: relative; isolation: isolate; overflow: hidden; margin: 4px 0 10px;
	padding: clamp(32px, 5.5vw, 70px); border-radius: var(--radio);
	background: radial-gradient(ellipse at 88% 6%, rgb(215 243 74 / 37%), transparent 28%),
		linear-gradient(118deg, #182747 0%, #2547D0 61%, #4269F3 100%);
	color: #fff; box-shadow: 0 24px 60px rgb(37 71 208 / 20%);
}
.hero::after {
	content: ''; position: absolute; z-index: -1; width: 380px; aspect-ratio: 1;
	right: -115px; bottom: -245px; border: 1px solid rgb(255 255 255 / 13%);
	border-radius: 50%; box-shadow: 0 0 0 34px rgb(255 255 255 / 3%), 0 0 0 68px rgb(255 255 255 / 3%);
}
.hero h1 { max-width: 760px; padding: 0; color: #fff; font-size: clamp(38px, 6.3vw, 68px); letter-spacing: -.065em; }
.hero p { max-width: 590px; margin: 14px 0 27px; color: rgb(255 255 255 / 81%); font-size: clamp(16px, 2vw, 19px); }
.hero-buscar { display: flex; flex-direction: row; gap: 7px; width: min(100%, 690px); margin-bottom: 16px; }
.hero-buscar input {
	flex: 1; min-width: 0; height: 60px; padding: 0 22px; border: 1px solid rgb(255 255 255 / 72%);
	border-radius: var(--radio); background: #fff; color: var(--tinta); font-size: 16px; box-shadow: 0 8px 24px rgb(11 36 31 / 12%);
}
.hero-buscar button, #cuerpo .hero-buscar button { flex: none; width: auto; height: 60px; padding: 0 29px; background: var(--acento); color: var(--tinta); }
.hero-botones { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-botones .boton { width: auto; height: 48px; }
#cuerpo .hero-botones .boton.secundario { background: transparent; color: #fff; border-color: rgb(255 255 255 / 48%); }
#cuerpo .hero-botones .boton.secundario:hover { background: rgb(255 255 255 / 12%); }

.sec-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 13px 0 3px; }
.sec-cab h2 { padding: 0; color: var(--tinta); font-size: clamp(22px, 2.7vw, 29px); letter-spacing: -.055em; }
.sec-cab a { color: var(--primario); font-size: 14px; font-weight: 700; text-decoration: none; }
.carril { display: flex; gap: 14px; margin: 0 -4px; padding: 8px 4px 13px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 14px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.carril::-webkit-scrollbar { display: none; }
.pedido-mini {
	flex: none; display: flex; flex-direction: column; gap: 5px; width: 270px; padding: 18px;
	border: 1px solid var(--bordes); border-radius: var(--radio); background: #fff;
	box-shadow: 0 4px 16px rgb(23 44 41 / 4%); scroll-snap-align: start;
}
.pedido-mini .chip { align-self: flex-start; padding: 3px 10px; border-radius: var(--radio); background: var(--tinte); color: var(--primario); font-size: 12px; font-weight: 700; }
.pedido-mini .t { color: var(--tinta); font-family: var(--fuente-titulos); font-size: 17px; font-weight: 700; line-height: 1.2; text-decoration: none; }
.pedido-mini .m { color: var(--apagado); font-size: 13px; }
.pedido-mini .pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 9px; color: var(--apagado); font-size: 12px; }
#cuerpo .pedido-mini .boton { width: auto; height: 42px; padding: 0 17px; background: var(--primario); color: #fff; }

/* Catálogo */
.publicaciones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 600px) { .publicaciones { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 19px; } }
.publicacion, .publicacion:link, .publicacion:visited { color: var(--tinta); }
.publicacion {
	border: 1px solid rgb(29 41 37 / 7%); border-radius: var(--radio); background: #fff;
	box-shadow: 0 3px 13px rgb(29 41 37 / 4%);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.publicacion:hover { transform: translateY(-3px); border-color: rgb(23 78 70 / 20%); color: var(--tinta); box-shadow: 0 14px 32px rgb(29 41 37 / 11%); }
.publicacion img { height: auto; aspect-ratio: 4 / 3; border-bottom: 0; background: #eeeee8; }
.publicacion .precio { order: 1; align-items: center; padding: 12px 14px 0; border-top: 0; }
.publicacion .precio data { color: var(--tinta); font-family: var(--fuente-titulos); font-size: 1.42em; font-weight: 800; letter-spacing: -.045em; }
.publicacion .producto {
	order: 2; display: -webkit-box; overflow: hidden; padding: 3px 14px 10px;
	font-size: .96em; font-weight: 500; line-height: 1.32; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.publicacion .vendedor-rep { order: 3; padding: 0 14px 13px; color: var(--apagado); font-size: 12px; }
.publicacion .vendedor-rep b { color: #D84C36; font-weight: 700; }
.condicion { padding: 3px 9px; border-radius: var(--radio); font-size: .72em; font-weight: 700; }
.nuevo { background: #DDF2E4; color: #246044; }
.usado { background: #FFF0C7; color: #745116; }
.orden-form { padding: 0; background: transparent; }
.orden-form select { border: 1px solid var(--bordes); border-radius: var(--radio); background-color: #fff; color: var(--tinta); }

/* Campos, mensajes y contenedores */
input, select, textarea { border: 1.5px solid var(--bordes); border-radius: var(--radio); background: #fff; color: var(--tinta); }
input:focus, select:focus, textarea:focus { border-color: var(--primario); outline: 3px solid rgb(86 48 79 / 18%); }
input::placeholder, textarea::placeholder { color: #91858E; }
.contenedor, .contenedor-claro, dialog { border-radius: var(--radio); }
.mensaje { width: auto; margin: 10px 15px 0; padding: 14px 18px; border-radius: var(--radio); text-align: left; font-size: 1em; font-weight: 500; }
.mensaje a { color: inherit; text-decoration: underline; }
.success { background: #DDF2E4; color: #246044; }
.precaucion { background: #FFF0C7; color: #745116; }
.error { background: #FFE4DC; color: #963D32; }
.info { background: #E9EDFF; color: #2547D0; }

footer { margin-top: 26px; border-radius: 0; background: var(--tinta); color: #E7ECFF; }
footer a { color: #fff; }
footer a:hover { color: var(--acento); }
#chat-badge, #pedidos-badge { background: var(--acento); color: var(--tinta); }
.nav-badge { position: absolute; top: 2px; left: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radio); box-sizing: border-box; background: var(--primario); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.nav-badge[hidden] { display: none; }
#nav-inferior { display: none; }
@media (max-width: 749px) {
	:root { --header-h: 65px; --nav-h: 70px; }
	#superior { position: fixed; inset: 0 0 auto 0; z-index: 1000; display: flex; width: auto; height: auto; min-height: 0; padding: 7px 12px; overflow: visible; flex-direction: column; gap: 0; background: rgb(255 255 255 / 97%); border: 0; box-shadow: 0 1px 0 rgb(24 39 71 / 10%); backdrop-filter: blur(14px); }
	#contenido-superior { display: flex; width: 100%; min-height: 50px; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
	#logo { height: 46px; font-size: 18px; }
	#test { display: flex; width: auto; height: 46px; margin-left: auto; padding: 0 15px; align-items: center; justify-content: center; border: 0; border-radius: var(--radio); background: var(--tinte); color: var(--tinta); }
	#menu_test { position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 999; display: none !important; width: 100%; max-width: 100vw; padding: 12px 15px 100px; flex-direction: column; gap: 7px; overflow-x: hidden; background: #fff; }
	#menu_test.mostrar { display: flex !important; box-shadow: 0 18px 32px rgb(23 44 41 / 10%); }
	#menu_test > .boton { width: 100%; min-height: 50px; height: 50px; justify-content: flex-start; padding: 0 14px; border-radius: var(--radio); background: #FFFFFF; color: var(--tinta); }
	#menu_test > .boton.cta { justify-content: center; background: var(--primario); color: #fff; }
	#menu_test > .boton.publicar-nav { background: var(--acento); color: var(--tinta); }
	#menu_overlay { position: fixed; inset: var(--header-h) 0 0; z-index: 998; display: none; background: rgb(23 44 41 / 20%); }
	#menu_overlay.activo { display: block; }
	#barra-superior { position: fixed; z-index: 1001; top: var(--header-h); right: 0; left: 0; justify-content: stretch; padding: 8px 15px; background: rgb(255 255 255 / 97%); }
	#barra-superior #busqueda-form { width: 100%; max-width: none; }
	#main-wrapper, #main-wrapper:has(#pub) { margin: calc(var(--header-h) + 62px) 0 0; padding: 16px 17px 34px; }
	#sugerencias { top: calc(var(--header-h) + 60px); left: 15px; right: 15px; width: auto; }
	#cuerpo { gap: 20px; }
	body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
	#nav-inferior { display: flex; align-items: center; justify-content: space-around; position: fixed; inset: auto 0 0; z-index: 900; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); border-radius: 0; background: #fff; box-shadow: 0 -7px 26px rgb(23 44 41 / 9%); }
	#nav-inferior a { position: relative; display: flex; flex: 1; min-width: 56px; min-height: 48px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--apagado); font-size: 11px; font-weight: 500; line-height: 1.1; text-decoration: none; }
	#nav-inferior a svg { width: 24px; height: 24px; }
	#nav-inferior a[aria-current="page"] { color: var(--primario); font-weight: 700; }
	#nav-inferior .nav-publicar { flex: none; min-width: 64px; margin-top: -28px; }
	#nav-inferior .nav-publicar span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 6px; background: var(--acento); color: var(--tinta); box-shadow: 0 8px 20px rgb(23 44 41 / 20%); }
	#nav-inferior .nav-publicar svg { width: 28px; height: 28px; }
	.hero { border-radius: var(--radio); }
	.hero-buscar { flex-wrap: nowrap; gap: 7px; }
	.hero-buscar input { height: 54px; padding: 0 16px; }
	.hero-buscar button, #cuerpo .hero-buscar button { height: 54px; padding: 0 18px; }
	.carril { margin: 0 -15px; padding-inline: 15px; }
	.pedido-mini { width: min(78vw, 286px); }
}
@media (max-width: 380px) {
	.publicacion .precio data { font-size: 1.15em; }
	.condicion { padding: 2px 7px; font-size: .66em; }
	.hero { padding: 25px 18px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
/* Ficha de producto: galería y datos con una jerarquía más clara */
.arbol { max-width: 1160px; width: 100%; margin: 0 auto; padding: 2px 0 14px; border-bottom: 1px solid var(--bordes); color: var(--apagado); font-size: 13px; }
.arbol a { color: var(--primario); font-weight: 700; text-decoration: none; }
#pub { max-width: 1160px; width: 100%; margin: 0 auto; gap: 34px; }
#detalles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr); align-items: start; gap: clamp(28px, 4vw, 56px); }
#galeria { width: 100%; min-width: 0; gap: 10px; }
#imagen-principal { display: block; width: 100%; max-height: min(68vw, 640px); aspect-ratio: 1 / 1; object-fit: contain; border-radius: var(--radio); background: #fff; box-shadow: 0 2px 14px rgb(23 44 41 / 6%); }
#miniaturas { grid-template-columns: repeat(auto-fill, minmax(82px, 104px)); gap: 9px; }
#miniaturas .miniatura { aspect-ratio: 1; border: 1px solid var(--bordes); border-radius: var(--radio); background: #fff; }
#lat { min-width: 0; gap: 13px; padding: 5px 0 0; }
#barra { align-items: center; gap: 8px; }
.condicion-pub { min-height: 31px; padding: 3px 11px; border-radius: var(--radio); background: var(--tinte); color: var(--primario); font-size: 12px; }
.condicion-pub.nuevo { background: var(--tinte); color: var(--primario); }
.condicion-pub.usado { background: #f8efd9; color: #705515; }
.visor { min-height: 31px; padding: 3px 11px; border: 1px solid var(--bordes); border-radius: var(--radio); background: #fff; color: var(--apagado); font-size: 12px; }
.visor svg { color: var(--primario); }
#lat h1 { max-width: 680px; margin: 3px 0 0; color: var(--tinta); font-size: clamp(28px, 3vw, 42px); letter-spacing: -.06em; line-height: 1.08; }
.precio-pub { margin: 0; color: var(--tinta); font-family: var(--fuente-titulos); font-size: clamp(32px, 3.4vw, 43px); font-weight: 800; letter-spacing: -.06em; }
.adicional { gap: 9px; margin: 6px 0 5px; padding: 17px 0; border-top: 1px solid var(--bordes); border-bottom: 1px solid var(--bordes); color: var(--texto); font-size: 14px; }
.adicional > div { display: flex; align-items: baseline; gap: 3px; }
.adicional svg { flex: none; width: 15px; height: 15px; margin-right: 7px; color: var(--primario); }
.adicional a { color: var(--primario); font-weight: 700; }
#lat > .botones { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; }
#lat > .botones > .boton, #lat > .botones > button { width: auto; min-height: 46px; height: 46px; padding: 0 17px; border: 1px solid var(--bordes); border-radius: var(--radio); background: #fff; color: var(--tinta); font-size: 14px; }
#lat > .botones > #btn-chat, #lat > .botones > a.boton:not(.wa) { border-color: var(--primario); background: var(--primario); color: #fff; }
#lat > .botones > #btn-chat:hover, #lat > .botones > a.boton:not(.wa):hover { background: var(--primario-hover); color: #fff; }
#lat > .botones > .wa { border-color: var(--primario) !important; background: var(--primario) !important; color: #fff !important; }
#lat > .botones > .wa:hover { background: var(--primario-hover) !important; color: #fff !important; }
#lat > .botones > #btn-datos-contacto, #lat > .botones > #cpBtn { border-color: transparent; background: var(--tinte); color: var(--primario); }
#lat > .botones > #contacto { display: none; }
#lat > hr { width: 100%; height: 1px; margin: 8px 0 2px; background: var(--bordes); }
#lat > h2 { padding: 0; color: var(--tinta); font-size: 21px; letter-spacing: -.04em; }
.descripcion-pub { max-width: 720px; margin: 0 0 10px; color: #3d4943; line-height: 1.75; }
.descargo-pub { max-width: 720px; border-top: 1px solid var(--bordes); padding-top: 14px; color: var(--apagado); line-height: 1.6; }
#contacto { border-color: var(--bordes); border-radius: var(--radio); background: #fff; }
@media (min-width: 750px) {
	#detalles { grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr); }
}
@media (max-width: 749px) {
	#pub { gap: 24px; }
	#detalles { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	#galeria { gap: 8px; }
	#imagen-principal { max-height: none; border-radius: var(--radio); }
	#miniaturas { grid-template-columns: repeat(auto-fill, minmax(68px, 82px)); gap: 7px; }
	#lat { gap: 11px; padding: 0; }
	#lat h1 { font-size: clamp(27px, 8vw, 36px); }
	.precio-pub { font-size: 35px; }
	#lat > .botones { gap: 8px; }
	#lat > .botones > .boton, #lat > .botones > button { flex: 1 1 auto; min-width: 145px; height: 48px; padding: 0 13px; }
	#lat > .botones > #btn-chat, #lat > .botones > .wa { flex-basis: 100%; }
	.descripcion-pub, .descargo-pub { max-width: none; }
}
@media (min-width: 750px) { #main-wrapper:has(#pub) { --contenido-inset: clamp(28px, 4vw, 64px); max-width: none; margin: 0 0 0 264px; padding: 96px var(--contenido-inset) 60px; background: #fff; } }
@media (max-width: 749px) {
	#main-wrapper:has(#pub) { padding: 16px 17px 34px; }
}
