/* Mimoto Diagramas — estilos del visor (mobile-first) */

.mimoto-visor {
	max-width: 1100px;
	margin: 0 auto 30px;
}

/* --- Diagrama (arriba) --- */
.mimoto-diagrama {
	text-align: center;
	background: #fff;
	border: 1px solid #e3e3e3;
	border-radius: 10px;
	padding: 10px;
	margin-bottom: 18px;
}
.mimoto-diagrama-img {
	max-width: 100%;
	height: auto;
	display: inline-block;
}
.mimoto-sin-imagen {
	padding: 60px 10px;
	color: #888;
	font-style: italic;
}

/* --- Tabla de piezas (abajo) --- */
.mimoto-tabla-wrap {
	overflow-x: auto;            /* permite desplazar en móvil si es ancha */
	-webkit-overflow-scrolling: touch;
}
.mimoto-tabla {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	background: #fff;
}
.mimoto-tabla thead th {
	background: #1f2533;
	color: #fff;
	text-align: left;
	padding: 10px 12px;
	font-weight: 600;
	white-space: nowrap;
}
.mimoto-tabla tbody td {
	padding: 10px 12px;
	border-bottom: 1px solid #ececec;
	vertical-align: middle;
}
.mimoto-tabla tbody tr:hover {
	background: #f7f9fc;
}
.mimoto-ref {
	font-weight: 700;
	text-align: center;
	width: 48px;
}
.mimoto-sku {
	font-family: monospace;
	color: #444;
	white-space: nowrap;
}
.mimoto-tabla img {
	border-radius: 6px;
	border: 1px solid #eee;
	display: block;
}
.mimoto-prox {
	display: inline-block;
	font-size: 11px;
	color: #999;
	background: #f1f1f1;
	border-radius: 6px;
	padding: 6px 8px;
	font-style: italic;
	white-space: nowrap;
}

/* En pantallas grandes, un poco más de aire */
@media (min-width: 768px) {
	.mimoto-tabla { font-size: 15px; }
	.mimoto-diagrama { padding: 16px; }
}

/* --- Navegación visual por tarjetas de subcategorías --- */
.mimoto-tarjetas {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
	max-width: 1100px;
	margin: 0 auto 30px;
}
@media (min-width: 600px) {
	.mimoto-tarjetas { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
	.mimoto-tarjetas { grid-template-columns: repeat(4, 1fr); }
}
.mimoto-tarjeta {
	display: block;
	background: #fff;
	border: 1px solid #e3e3e3;
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	color: #1f2533;
	transition: box-shadow .15s, transform .15s;
}
.mimoto-tarjeta:hover {
	box-shadow: 0 6px 18px rgba(0,0,0,.10);
	transform: translateY(-2px);
}
.mimoto-tarjeta-img {
	background: #f7f7f7;
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.mimoto-tarjeta-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.mimoto-tarjeta-noimg {
	color: #aaa;
	font-style: italic;
}
.mimoto-tarjeta-nombre {
	padding: 10px 12px;
	font-weight: 600;
	text-align: center;
	font-size: 14px;
}

/* --- Contenedor de la plantilla propia --- */
.mimoto-contenedor {
	max-width: 1140px;
	margin: 0 auto;
	padding: 20px 16px 50px;
}
.mimoto-titulo {
	font-size: 28px;
	margin: 10px 0 20px;
}
.mimoto-contenedor .woocommerce-breadcrumb {
	margin-bottom: 14px;
	font-size: 13px;
	color: #777;
}

/* --- Cantidad y acciones --- */
.mimoto-qty {
	width: 64px;
	padding: 6px 8px;
	border: 1px solid #cfcfcf;
	border-radius: 6px;
	text-align: center;
	font-size: 14px;
}
.mimoto-usa {
	font-size: 12px;
	color: #888;
	white-space: nowrap;
}
.mimoto-acciones {
	white-space: nowrap;
}
.mimoto-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	border: none;
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	margin: 2px 3px 2px 0;
	line-height: 1.2;
	transition: filter .15s;
}
.mimoto-btn:hover { filter: brightness(0.92); }
.mimoto-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}
.mimoto-btn-cart { background: #f0f3f8; color: #1f2533; }
.mimoto-btn-buy  { background: #d92e2e; color: #fff; }
.mimoto-btn-wa   { background: #058C42; color: #fff; }

/* En móvil, los botones se apilan dentro de la celda */
@media (max-width: 640px) {
	.mimoto-btn { width: 100%; justify-content: center; margin: 3px 0; }
}

/* --- Buscador --- */
.mimoto-buscador-wrap { margin: 0 0 14px; }
.mimoto-buscador {
	width: 100%;
	max-width: 480px;
	padding: 11px 14px;
	border: 1px solid #cfcfcf;
	border-radius: 10px;
	font-size: 15px;
}

/* --- Resaltado de fila activa --- */
.mimoto-fila { cursor: pointer; }
.mimoto-fila.mimoto-activa {
	background: #fff4d6 !important;
	box-shadow: inset 3px 0 0 #d92e2e;
}
@keyframes mimoto-flash-fila {
	0%, 100% { box-shadow: inset 3px 0 0 #d92e2e, 0 0 0 0 rgba(217,46,46,0); }
	50%      { box-shadow: inset 3px 0 0 #d92e2e, 0 0 0 4px rgba(217,46,46,.45); }
}
.mimoto-fila.mimoto-flash {
	animation: mimoto-flash-fila 1s ease 2;
}

/* --- Zoom de la imagen --- */
.mimoto-zoom {
	overflow: hidden;
	cursor: zoom-in;
	display: inline-block;
	max-width: 100%;
}
.mimoto-zoom img {
	transition: transform .05s linear;
	transform-origin: center center;
	will-change: transform;
	max-width: 100%;
	height: auto;
}
.mimoto-zoom-ayuda {
	font-size: 12px;
	color: #999;
	margin-top: 8px;
}
@media (min-width: 768px) {
	.mimoto-zoom-ayuda::before { content: "Usa la rueda del mouse para acercar · "; }
}

/* ============================================================
   VISTA MÓVIL: la tabla se transforma en tarjetas apiladas
   ============================================================ */
@media (max-width: 720px) {
	.mimoto-tabla thead { display: none; } /* ocultamos encabezados */
	.mimoto-tabla, .mimoto-tabla tbody, .mimoto-tabla tr, .mimoto-tabla td {
		display: block;
		width: 100%;
	}
	.mimoto-tabla tr.mimoto-fila {
		border: 1px solid #e3e3e3;
		border-radius: 12px;
		margin-bottom: 14px;
		padding: 12px 14px;
		position: relative;
		background: #fff;
	}
	.mimoto-tabla td {
		border: none !important;
		padding: 4px 0;
	}
	/* Etiqueta antes de cada dato */
	.mimoto-tabla td::before {
		content: attr(data-label);
		font-weight: 700;
		color: #555;
		display: inline-block;
		min-width: 92px;
	}
	/* Ref. como insignia arriba a la derecha */
	.mimoto-tabla td.mimoto-ref {
		position: absolute;
		top: 12px; right: 14px;
		width: 34px; height: 34px;
		background: #1f2533; color: #fff;
		border-radius: 50%;
		text-align: center; line-height: 34px;
		padding: 0; font-size: 15px;
	}
	.mimoto-tabla td.mimoto-ref::before { content: ""; min-width: 0; }
	/* Imagen del producto centrada, sin etiqueta */
	.mimoto-tabla td.mimoto-img-cell::before { content: ""; min-width: 0; }
	/* Acciones: botones a lo ancho */
	.mimoto-tabla td.mimoto-acciones::before { content: ""; min-width: 0; }
	.mimoto-tabla td.mimoto-acciones { margin-top: 8px; }
	.mimoto-tabla td.mimoto-cant { margin-top: 6px; }
	.mimoto-tabla td.mimoto-cant::before { content: "Cantidad:"; }
}

/* ============================================================
   CORRECCIONES MÓVIL v0.10.3
   ============================================================ */
@media (max-width: 720px) {
	/* Acciones: botones SIEMPRE apilados y a lo ancho, sin desbordar */
	.mimoto-tabla td.mimoto-acciones {
		display: flex !important;
		flex-direction: column;
		gap: 8px;
		width: 100%;
	}
	.mimoto-tabla td.mimoto-acciones .mimoto-btn {
		width: 100%;
		box-sizing: border-box;
		margin: 0;
		justify-content: center;
		padding: 12px;
		font-size: 15px;
	}
	/* Evitar cualquier desbordamiento horizontal de la tabla/tarjetas */
	.mimoto-tabla, .mimoto-tabla tbody, .mimoto-tabla tr.mimoto-fila {
		max-width: 100%;
		box-sizing: border-box;
		overflow: hidden;
	}
	.mimoto-tabla-wrap { overflow-x: hidden; }
	.mimoto-qty { box-sizing: border-box; }
}

/* Zoom: el contenedor permite el gesto; el detalle lo maneja el visor ampliado */

/* --- Botón Ampliar imagen --- */
.mimoto-diagrama-img { cursor: zoom-in; }
.mimoto-ampliar {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	padding: 10px 18px;
	background: #1f2533;
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.mimoto-ampliar .dashicons { font-size: 16px; width: 16px; height: 16px; }
.mimoto-ampliar:hover { filter: brightness(1.15); }

/* --- Visor ampliado (lightbox) con cierre claro --- */
.mimoto-lightbox {
	position: fixed; inset: 0;
	background: rgba(0,0,0,.92);
	z-index: 99999;
	display: flex;
	flex-direction: column;
}
.mimoto-lightbox-barra {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: #1f2533;
}
.mimoto-lightbox-titulo { color: #fff; font-weight: 600; font-size: 15px; }
.mimoto-lightbox-cerrar {
	background: #d92e2e; color: #fff;
	border: none; border-radius: 8px;
	padding: 10px 16px;
	font-size: 16px; font-weight: 700;
	cursor: pointer;
	display: inline-flex; align-items: center; gap: 4px;
}
.mimoto-lightbox-scroll {
	flex: 1;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	text-align: center;
	touch-action: pinch-zoom;
	padding: 10px;
}
.mimoto-lightbox-scroll img {
	width: 100%;
	max-width: none;
	height: auto;
	display: block;
	margin: 0 auto;
	background: #fff;
	border-radius: 6px;
}
.mimoto-lightbox-controles {
	display: flex; justify-content: center; gap: 10px;
	padding: 12px 0 20px;
	background: rgba(0,0,0,.4);
}
.mimoto-lightbox-controles button {
	min-width: 60px; padding: 12px 16px;
	background: #fff; color: #1f2533;
	border: none; border-radius: 10px;
	font-size: 16px; font-weight: 700; cursor: pointer;
}
.mimoto-lightbox-controles .mimoto-lb-cerrar2 {
	background: #d92e2e; color: #fff;
}

/* --- Referencia cruzada en la ficha del producto --- */
.mimoto-refcruzada {
	max-width: 1100px;
	margin: 24px auto;
	padding: 16px 18px;
	background: #f7f9fc;
	border: 1px solid #e3e3e3;
	border-radius: 10px;
}
.mimoto-refcruzada h2 { font-size: 18px; margin: 0 0 10px; }
.mimoto-refcruzada-lista { margin: 0; padding-left: 18px; }
.mimoto-refcruzada-lista li { margin: 4px 0; }
.mimoto-refcruzada-link { text-decoration: none; }
.mimoto-refcruzada-link:hover { text-decoration: underline; }
.mimoto-refcruzada-cta {
	display: inline-block;
	margin-left: 6px;
	font-weight: 700;
	color: #DD0819;
	white-space: nowrap;
}

/* --- Hotspots interactivos sobre la lámina (Parte B) --- */
.mimoto-lienzo { position: relative; display: inline-block; max-width: 100%; }
.mimoto-hotspots { position: absolute; inset: 0; pointer-events: none; }
.mimoto-hot { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
.mimoto-hot-pin {
	width: 30px; height: 30px; border-radius: 50%;
	border: 2px solid #fff; background: #DD0819; color: #fff;
	font-weight: 800; font-size: 13px; line-height: 1; padding: 0;
	cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.45);
	display: flex; align-items: center; justify-content: center;
}
.mimoto-hot:hover .mimoto-hot-pin,
.mimoto-hot--sel .mimoto-hot-pin { background: #0F6E56; transform: scale(1.08); }
.mimoto-hot-pop {
	display: none; position: absolute; bottom: 130%; left: 50%;
	transform: translateX(-50%); width: 200px; background: #fff;
	border: 1px solid #e0e0e0; border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 10px; text-align: center; z-index: 5;
}
.mimoto-hot:hover .mimoto-hot-pop,
.mimoto-hot--abierto .mimoto-hot-pop { display: block; }
.mimoto-hot-nombre { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: #080D14; }
.mimoto-hot-precio { font-size: 13px; margin-bottom: 8px; }
.mimoto-hot-add, .mimoto-hot-ver { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.mimoto-fila--hot { background: #fff8e1 !important; }
