/* ============================================================
   Cards de producto — estilo Singer (solo capa visual).
   Estructura: .oz-loop-product__inner = CAJA (badge+imagen+precio+agregar),
   .oz-loop-product__caption = título/textos DEBAJO de la caja.
   No decide qué se muestra; solo estiliza lo que exista.
   Breakpoints OZ-Maquetador: >1366 | 1366 | 1024 | 768 | 480.
   ============================================================ */

.oz-loop-product--singer {
	--singer-red: #e30613;        /* precio actual */
	--singer-badge: #ff0047;      /* badge de oferta */
	--singer-border: #e6e6e6;
	list-style: none;
	display: flex;
	flex-direction: column;
	text-align: center;
	background: transparent;
	margin: 0 0 26px;
	padding: 0;
}
.oz-loop-product--singer * { box-sizing: border-box; }

/* ---- (1) Caja principal ---- */
.oz-loop-product--singer .oz-loop-product__inner {
	position: relative;
	background: #fff;
	border: 1px solid var(--singer-border);
	border-radius: 8px;
	box-shadow: none;
	padding: 16px 16px 22px;
	display: flex;
	flex-direction: column;
	gap: 0;
	min-height: 396px;   /* (5) cajas de una fila con altura pareja, sin cortar contenido */
}

/* ---- (3) Badge de oferta (WooCommerce .onsale) ---- */
.oz-loop-product--singer .onsale {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 5;
	min-width: 52px;
	height: 52px;
	padding: 0 6px;
	border-radius: 50%;
	background: var(--singer-badge);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.05;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	margin: 0;
}

/* ---- (2) Imagen: protagonista, área consistente, sin recorte ---- */
.oz-loop-product--singer .oz-loop-product__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;           /* área uniforme para alinear todas las cards */
	padding: 8px;
	overflow: hidden;
}
.oz-loop-product--singer .oz-loop-product__media img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;           /* nunca recorta ni deforma */
	margin: 0 auto;
}

/* ---- (5) Precio: anterior tachado + actual, centrado ---- */
.oz-loop-product--singer .price {
	display: flex;
	flex-wrap: nowrap;   /* precio en una sola línea -> cajas parejas */
	align-items: baseline;
	justify-content: center;
	gap: 8px;
	margin: auto 0 0;   /* (1)(4) empuja precio+acciones a la parte baja -> cajas y acciones alineadas */
	color: var(--singer-red);
}
/* (2) separación precio -> acciones */
.oz-loop-product--singer .price + .oz-loop-product__actions { margin-top: 24px; }
/* (4) cards sin precio (agotado/Leer más): las acciones bajan igual para alinear la fila */
.oz-loop-product--singer .oz-loop-product__inner:not(:has(.price)) .oz-loop-product__actions { margin-top: auto; }
.oz-loop-product--singer .price del {
	color: #e88; /* rojo claro */
	font-size: .82em;
	opacity: .9;
	text-decoration: line-through;
	font-weight: 500;
}
.oz-loop-product--singer .price del .amount { color: inherit; }
.oz-loop-product--singer .price ins {
	text-decoration: none;
	color: var(--singer-red);
	font-weight: 800;
	font-size: 1.18em;
}
.oz-loop-product--singer .price .amount { font-weight: 700; }
.oz-loop-product--singer .price ins .amount { font-weight: 800; }

/* ---- (6) Cantidad + botón Agregar ---- */
.oz-loop-product--singer .oz-loop-product__actions {
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 0;
}
.oz-loop-product--singer .oz-loop-product__add {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #f2f2f2;
	color: #333;
	border: 1px solid #e2e2e2;
	border-radius: 8px 0 0 8px;
	padding: 9px 14px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.1;
	box-shadow: none;
}
/* variante sin cantidad (agotado / no simple): esquinas completas */
.oz-loop-product--singer .oz-loop-product__actions--wide .oz-loop-product__add {
	border-radius: 8px;
}
.oz-loop-product--singer .oz-loop-product__add::before {
	content: "";
	width: 18px; height: 18px; flex: 0 0 auto;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='M2.5 3.5h2.3l2.1 11.1a1.6 1.6 0 0 0 1.57 1.3h8.3a1.6 1.6 0 0 0 1.56-1.28l1.45-6.62H6.4'/%3E%3Ccircle cx='9.3' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3C/svg%3E") center/contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='M2.5 3.5h2.3l2.1 11.1a1.6 1.6 0 0 0 1.57 1.3h8.3a1.6 1.6 0 0 0 1.56-1.28l1.45-6.62H6.4'/%3E%3Ccircle cx='9.3' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3C/svg%3E") center/contain no-repeat;
}
.oz-loop-product--singer .oz-loop-product__add:hover { background: #e9e9e9; color: #111; }

.oz-loop-product--singer .oz-loop-product__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid #e2e2e2;
	border-left: 0;
	border-radius: 0 8px 8px 0;
	background: #fafafa;
	overflow: hidden;
}
.oz-loop-product--singer .oz-loop-product__qty-btn {
	width: 28px; height: 100%;
	min-height: 38px;
	border: 0; background: transparent;
	font-size: 16px; color: #555; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
}
.oz-loop-product--singer .oz-loop-product__qty-btn:hover { background: #efefef; color: #111; }
.oz-loop-product--singer .oz-loop-product__qty-val {
	min-width: 26px; text-align: center; font-size: 14px; font-weight: 600; color: #333;
	border-left: 1px solid #ededed; border-right: 1px solid #ededed; padding: 0 4px; line-height: 38px;
}

/* ---- (7/8/9) Caption debajo de la caja: categoría, título, descripción, marca ---- */
.oz-loop-product--singer .oz-loop-product__caption {
	padding: 8px 6px 0;
	text-align: center;
}
.oz-loop-product--singer .oz-loop-product__category {
	margin: 0 0 4px;
	font-size: 12px;
	color: #9a9a9a;
	text-transform: none;
}
.oz-loop-product--singer .oz-loop-product__title {
	margin: 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.35;
	color: #222;
	/* Overflow real en un bloque PLANO (no -webkit-box aquí): Chrome tiene un bug
	   de pintado con -webkit-line-clamp donde, cuando el contenedor clamped queda
	   más alto que su contenido natural (por el min-height de abajo), se filtra
	   un resto visible de la línea siguiente a la recortada — un "fantasma" de
	   texto justo debajo del "…", como si desbordara. overflow:hidden en ESTE
	   nivel (h2, altura fija) actúa como segundo recorte geométrico real y tapa
	   ese resto. El clamp de líneas en sí vive en el <a> de abajo. Reproducido y
	   confirmado con Playwright/Puppeteer: con el clamp puesto aquí directamente
	   (display:-webkit-box en el h2) el fantasma aparece SIEMPRE que el título
	   tiene más líneas que el límite del clamp, sin importar min-height vs
	   height, contain:paint o clip-path — solo se resuelve moviendo el clamp a
	   un hijo interno y recortando también en el padre. */
	overflow: hidden;
	/* Reserva el alto real de 3 líneas siempre, sin importar si el
	   título ocupa 1, 2 o 3 líneas — necesario en el slider de
	   "Ofertas" del Homepage (.ozs__track), que NO usa
	   <ul class="products"> (el "align-items:stretch" de la línea 210
	   de este archivo no aplica ahí), así que sin esto cada tarjeta
	   toma su propia altura según el largo de su título y la fila de
	   precio/botón queda desalineada entre tarjetas, dando la
	   apariencia de que el texto se desborda hacia la sección de abajo.
	   81px medido con getBoundingClientRect en un título real de 3
	   líneas (el cálculo teórico 15px*1.35*3=60.75px subestimaba el
	   alto real que toma -webkit-line-clamp). */
	min-height: 81px;
}
.oz-loop-product--singer .oz-loop-product__title a {
	color: inherit;
	text-decoration: none;
	/* El clamp real vive aquí (no en el h2 padre) — ver comentario arriba. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.oz-loop-product--singer .oz-loop-product__title a:hover { color: var(--singer-red); }
.oz-loop-product--singer .oz-loop-product__excerpt {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: #777;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.oz-loop-product--singer .oz-loop-product__brand {
	margin: 8px 0 0;
	font-size: 12.5px;
	color: #888;
}
.oz-loop-product--singer .oz-loop-product__brand-label { font-weight: 600; color: #666; }

/* ---- (12) Alineación entre cards: imagen/precio/botón coherentes ---- */
.products .oz-loop-product--singer { height: 100%; }
ul.products { align-items: stretch; }

/* ============================================================
   (13) Responsive — misma identidad visual
   ============================================================ */
@media (max-width: 1024px) {
	.oz-loop-product--singer .oz-loop-product__inner { padding: 13px 13px 15px; }
	.oz-loop-product--singer .oz-loop-product__title { font-size: 14.5px; }
}
@media (max-width: 768px) {
	.oz-loop-product--singer .onsale { min-width: 46px; height: 46px; font-size: 11px; }
	.oz-loop-product--singer .oz-loop-product__add { padding: 8px 12px; font-size: 13px; }
}
@media (max-width: 480px) {
	.oz-loop-product--singer { text-align: center; }
	.oz-loop-product--singer .oz-loop-product__title { font-size: 14px; }
	.oz-loop-product--singer .oz-loop-product__title a { -webkit-line-clamp: 2; }
	.oz-loop-product--singer .oz-loop-product__media { padding: 4px; }
}

/* ============================================================
   Override de ESPECIFICIDAD — el CSS del padre (shop-archive.css) usa prefijo
   "html body" y variables --OZ-Shop-* que pisaban el badge/botón/precio.
   Igualamos el prefijo para ganarle (causa, no parche visual suelto).
   ============================================================ */
html body .oz-loop-product--singer .oz-loop-product__inner {
	background: #fff !important;
	border: 1px solid #e6e6e6 !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	height: auto !important;      /* el padre la estiraba (flex:1/height:100%) -> altura natural */
	flex: 0 0 auto !important;
	align-self: stretch !important;
}
/* la caja no se estira; el título variable queda abajo sin alargar la caja */
html body ul.products .oz-loop-product--singer { display: flex !important; flex-direction: column !important; height: auto !important; }
html body .oz-loop-product--singer .onsale {
	position: absolute !important;
	top: 8px !important; left: 8px !important; right: auto !important; bottom: auto !important;
	z-index: 5 !important;
	background: #ff0047 !important;
	color: #fff !important;
	border: 0 !important;
}
html body .oz-loop-product--singer .price del,
html body .oz-loop-product--singer .price del .amount,
html body .oz-loop-product--singer .price del .amount bdi { color: #e08a90 !important; }
html body .oz-loop-product--singer .price ins,
html body .oz-loop-product--singer .price ins .amount,
html body .oz-loop-product--singer .price ins .amount bdi { color: #e30613 !important; }
html body .oz-loop-product--singer .oz-loop-product__add {
	background: #f2f2f2 !important;
	color: #333 !important;
	border: 1px solid #e2e2e2 !important;
	box-shadow: none !important;
}
html body .oz-loop-product--singer .oz-loop-product__actions--wide .oz-loop-product__add { border-radius: 8px !important; }
html body .oz-loop-product--singer .oz-loop-product__add:hover { background: #e9e9e9 !important; color: #111 !important; }

/* --- Grupo Añadir + Qty como UN solo control (el padre lo pintaba azul y con otra altura) --- */
html body .oz-loop-product--singer .oz-loop-product__actions {
	align-items: center !important; gap: 0 !important;
	flex-wrap: nowrap !important; justify-content: center !important;
}
html body .oz-loop-product--singer .oz-loop-product__add {
	display: inline-flex !important;     /* NO block: que ocupe solo su contenido, no todo el ancho */
	width: auto !important; max-width: none !important;
	margin: 0 !important;                /* WooCommerce .button trae margin-top:.75em -> lo mataba la alineación */
	min-height: 42px !important; height: 42px !important;
	padding: 0 9px !important;
	gap: 5px !important;
	border-radius: 8px 0 0 8px !important;
	font-size: 13.5px !important; font-weight: 600 !important; line-height: 1 !important;
	white-space: nowrap !important;      /* "Agregar" en UNA línea */
	flex: 0 0 auto !important;           /* ancho de su contenido, sin crecer ni encoger */
	min-width: 0 !important;
}
html body .oz-loop-product--singer .oz-loop-product__add::before { width: 15px !important; height: 15px !important; }
html body .oz-loop-product--singer .oz-loop-product__qty {
	min-height: 42px !important; height: 42px !important;
	background: #fafafa !important;
	border: 1px solid #e2e2e2 !important; border-left: 0 !important;
	border-radius: 0 8px 8px 0 !important;
	overflow: visible !important;        /* que NO recorte el + */
	display: inline-flex !important; align-items: stretch !important;
	flex: 0 0 auto !important;           /* NO se encoge -> el + siempre cabe dentro */
}
html body .oz-loop-product--singer .oz-loop-product__qty-btn {
	width: 27px !important; flex: 0 0 27px !important; height: 42px !important;
	background: transparent !important; border: 0 !important;
	color: #555 !important; font-size: 16px !important; cursor: pointer !important;
	display: inline-flex !important; align-items: center !important; justify-content: center !important;
}
html body .oz-loop-product--singer .oz-loop-product__qty-btn:hover { background: #efefef !important; color: #111 !important; }
html body .oz-loop-product--singer .oz-loop-product__qty-val {
	min-width: 30px !important; flex: 0 0 30px !important; height: 42px !important; line-height: 42px !important;
	text-align: center !important; font-size: 15px !important; font-weight: 700 !important; color: #333 !important;
	background: transparent !important; padding: 0 2px !important;
	border-left: 1px solid #e6e6e6 !important; border-right: 1px solid #e6e6e6 !important;
}
/* Cuando el grupo NO cabe en una línea y hace wrap, el qty baja completo y con radios propios */
html body .oz-loop-product--singer .oz-loop-product__actions > .oz-loop-product__qty:not(:first-child) { border-radius: 0 8px 8px 0 !important; }

/* Link "Ver carrito" que WooCommerce inserta vía AJAX junto a Agregar+Qty
   tras añadir el producto (a.added_to_cart, hijo de .oz-loop-product__actions
   sin ninguna regla propia): sin esto hereda el flex angosto del grupo y su
   texto se comprime letra por letra. Baja a su propia fila, ancho completo. */
html body .oz-loop-product--singer .oz-loop-product__actions {
	flex-wrap: wrap !important;
	row-gap: 8px !important;
}
html body .oz-loop-product--singer .oz-loop-product__actions a.added_to_cart {
	flex: 1 0 100% !important;
	order: 3 !important;
	width: 100% !important;
	white-space: nowrap !important;
	text-align: center !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	padding: 8px 0 !important;
	border-radius: 8px !important;
	background: #f2f2f2 !important;
	color: #333 !important;
	text-decoration: none !important;
}
html body .oz-loop-product--singer .oz-loop-product__actions a.added_to_cart:hover { background: #e9e9e9 !important; color: #111 !important; }

/* ============================================================
   Responsive del grupo Añadir+Qty — breakpoints del OZ-Maquetador.
   (Va después del override para poder ganarle por breakpoint.)
   ============================================================ */
/* tablet_v + mobile (<=768): apilar -> botón arriba (full), qty centrado abajo */
@media (max-width: 768px) {
	html body .oz-loop-product--singer .oz-loop-product__actions { flex-direction: column !important; gap: 8px !important; align-items: center !important; }
	html body .oz-loop-product--singer .oz-loop-product__add { width: 100% !important; border-radius: 8px !important; justify-content: center !important; }
	html body .oz-loop-product--singer .oz-loop-product__qty { border-left: 1px solid #e2e2e2 !important; border-radius: 8px !important; }
}
/* mobile (<=480): targets táctiles más grandes */
@media (max-width: 480px) {
	html body .oz-loop-product--singer .oz-loop-product__add,
	html body .oz-loop-product--singer .oz-loop-product__qty,
	html body .oz-loop-product--singer .oz-loop-product__qty-btn,
	html body .oz-loop-product--singer .oz-loop-product__qty-val {
		min-height: 46px !important; height: 46px !important; line-height: 46px !important;
	}
	html body .oz-loop-product--singer .oz-loop-product__qty-btn { width: 40px !important; }
}
