/* Torres - Cuadrícula de Productos WooCommerce
 * Estilos base estructurales. Los colores, tipografías, espaciados, etc.
 * se controlan desde el propio widget de Elementor (pestaña Estilo).
 */

.twpg-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	row-gap: 30px;
	column-gap: 30px;
	width: 100%;
}

.twpg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background-color: #fff;
	overflow: hidden;
	box-sizing: border-box;
	padding: 16px;
}

.twpg-card * {
	box-sizing: border-box;
}

.twpg-card__image-wrap {
	position: relative;
	width: 100%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #f2f1ee;
}

.twpg-card__image-link {
	display: block;
	width: 100%;
	height: 100%;
}

.twpg-card__image {
	width: 100%;
	height: 100%;
	display: block;
	margin: 0 auto;
}

.twpg-card__badge {
	position: absolute;
	z-index: 2;
	display: inline-block;
	line-height: 1.2;
	white-space: nowrap;
}

.twpg-card__badge--top-left {
	top: 12px;
	left: 12px;
}

.twpg-card__badge--top-right {
	top: 12px;
	right: 12px;
}

.twpg-card__badge--bottom-left {
	bottom: 12px;
	left: 12px;
}

.twpg-card__badge--bottom-right {
	bottom: 12px;
	right: 12px;
}

.twpg-card__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	text-align: left;
	margin-top: 16px;
}

.twpg-card__title-link,
.twpg-card__title-link:hover,
.twpg-card__title-link:focus {
	text-decoration: none;
}

.twpg-card__title {
	margin: 0 0 15px;
}

.twpg-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: auto;
}

.twpg-card__price-block {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.twpg-card__price-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
}

.twpg-card__price .woocommerce-Price-amount {
	font-weight: inherit;
}

.twpg-card__price del {
	opacity: 0.7;
	margin-right: 4px;
	text-decoration: line-through;
}

.twpg-card__price ins {
	text-decoration: none;
}

.twpg-card__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	flex-shrink: 0;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.twpg-card__button--icon {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	padding: 0;
}

.twpg-card__button--text {
	border-radius: 8px;
	padding: 14px 20px;
}

.twpg-card__button:hover {
	transform: translateY(-1px);
}

/* Icono por defecto vs icono de confirmación (tras añadir al carrito).
   Solo se muestra uno de los dos a la vez, y al haber un único hijo
   visible dentro del botón flex, queda siempre centrado. */
.twpg-card__button-icon {
	display: none;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.twpg-card__button-icon--default {
	display: inline-flex;
}

.twpg-card__button.added .twpg-card__button-icon--default {
	display: none;
}

.twpg-card__button.added .twpg-card__button-icon--added {
	display: inline-flex;
}

/* WooCommerce añade automáticamente un enlace "Ver carrito" junto al botón
   tras añadir el producto vía AJAX; lo ocultamos para mantener el diseño limpio. */
.twpg-card__footer .added_to_cart {
	display: none !important;
}

.twpg-card__button i,
.twpg-card__button svg {
	line-height: 1;
}

/* Responsive: en móvil, 1 columna */
@media (max-width: 767px) {
	.twpg-grid {
		grid-template-columns: repeat(1, 1fr);
	}
}
