/**
 * GM Product Grid - Frontend styles.
 * Author: GM Software
 *
 * Responsive product grid that lists the products of one or more WooCommerce
 * categories. The card visual style mirrors the GM Product Carousel (centered
 * card content, image-on-top with hover zoom, automatic sale badge, prominent
 * star rating, sale price with strikethrough), but the layout is a CSS grid
 * instead of a carousel track. The number of columns and the gap come from the
 * Elementor controls (".gm-pg-grid").
 */

.gm-pg-grid-wrap {
	width: 100%;
	box-sizing: border-box;
}

/* ---------- Header (section title / subtitle) ---------- */
.gm-pg-header {
	margin-bottom: 24px;
}

.gm-pg-section-title {
	margin: 0;
	font-size: 26px;
	line-height: 1.3;
	font-weight: 700;
	color: #222;
}

.gm-pg-section-subtitle {
	margin-top: 6px;
	font-size: 15px;
	line-height: 1.5;
	color: #777;
}

/* ---------- Grid ---------- */
.gm-pg-grid {
	display: grid;
	/* grid-template-columns and gap are set by the Elementor controls. */
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	/*
	 * Vertical breathing room so the card hover effect (lift / shadow) is not
	 * visually clipped against tight containers.
	 */
	padding-top: 4px;
	padding-bottom: 4px;
}

.gm-pg-item {
	min-width: 0;
}

/* ---------- Card ---------- */
.gm-pg-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/*
 * The card hover effect (lift distance and/or shadow) is driven entirely by the
 * "Efecto al pasar el mouse" controls in the Card style section, so it can be
 * customized or fully disabled. No hardcoded hover transform here.
 */

/* ---------- Image ---------- */
.gm-pg-image {
	position: relative;
	display: block;
	text-align: center;
	overflow: hidden;
}

.gm-pg-image img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

/* Image hover effect (controlled by the "Efecto al pasar el mouse" option). */
.gm-pg-imghover-zoom .gm-pg-card:hover .gm-pg-image img {
	transform: scale(1.07);
}

/* ---------- Label (common manual label) ---------- */
.gm-pg-label {
	position: absolute;
	z-index: 3;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	background: #e02b2b;
	border-radius: 4px;
}

/* Aligned labels (horizontal pill at the top of the image). */
.gm-pg-label-align-left {
	top: 10px;
	left: 10px;
	white-space: nowrap;
}

.gm-pg-label-align-right {
	top: 10px;
	right: 10px;
	white-space: nowrap;
}

.gm-pg-label-align-center {
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
}

/*
 * "Cruzada" labels: a diagonal ribbon across a top corner. The card has
 * overflow:hidden, so the ends of the banner are clipped to form the ribbon.
 */
.gm-pg-label-ribbon-left,
.gm-pg-label-ribbon-right {
	top: 18px;
	width: 170px;
	text-align: center;
	padding: 5px 0;
	border-radius: 0;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.gm-pg-label-ribbon-left {
	left: -45px;
	transform: rotate(-45deg);
}

.gm-pg-label-ribbon-right {
	right: -45px;
	transform: rotate(45deg);
}

/* ---------- Sale badge (automatic, shown on products that are on sale) ---------- */
.gm-pg-sale-badge {
	position: absolute;
	z-index: 3;
	top: 10px;
	display: inline-block;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	background: #e02b2b;
	border-radius: 50px;
	white-space: nowrap;
}

.gm-pg-sale-badge-top-right {
	right: 10px;
}

.gm-pg-sale-badge-top-left {
	left: 10px;
}

/* ---------- Body ---------- */
.gm-pg-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-top: 12px;
	flex: 1;
}

/* Content alignment (set by the "Alineación del contenido" control). */
.gm-pg-align-left .gm-pg-body {
	align-items: flex-start;
	text-align: left;
}

.gm-pg-align-center .gm-pg-body {
	align-items: center;
	text-align: center;
}

.gm-pg-align-right .gm-pg-body {
	align-items: flex-end;
	text-align: right;
}

.gm-pg-category {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #999;
}

.gm-pg-category a {
	color: inherit;
	text-decoration: none;
}

.gm-pg-title {
	margin: 0;
	font-size: 15px;
	line-height: 1.35;
	font-weight: 600;
}

.gm-pg-title a {
	color: #222;
	text-decoration: none;
}

.gm-pg-title a:hover {
	text-decoration: underline;
}

/* ---------- Rating (WooCommerce star rating) ---------- */
.gm-pg-rating {
	line-height: 1;
}

.gm-pg-rating .star-rating {
	display: inline-block;
	font-size: 1em;
	color: #d8d8d8; /* empty-star track color */
	margin: 0;
}

.gm-pg-rating .star-rating::before {
	color: #d8d8d8;
}

.gm-pg-rating .star-rating span::before {
	color: #f5a623;
}

/* ---------- Stock ---------- */
.gm-pg-stock {
	font-size: 13px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.gm-pg-stock::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

.gm-pg-stock.in-stock {
	color: #1a7f37;
}

.gm-pg-stock.out-of-stock {
	color: #e02b2b;
}

/* ---------- Price ----------
 * Uses block children so text-align (the alignment controls) cascades to all
 * lines: prefix text, price and the formula text below it.
 */
.gm-pg-price-wrap {
	display: block;
	margin-top: auto;
	padding-top: 6px;
	width: 100%;
}

.gm-pg-price-text {
	display: block;
	font-size: 12px;
	color: #777;
}

.gm-pg-price {
	display: block;
	font-size: 18px;
	font-weight: 700;
	color: #1a7f37;
}

/* Sale price markup: WooCommerce wraps the old price in <del> and the new one
 * in <ins>. Keep the old price muted/struck and the sale price highlighted. */
.gm-pg-price del,
.gm-pg-price del .amount {
	color: #999;
	font-weight: 400;
	font-size: 14px;
	margin-right: 6px;
}

.gm-pg-price ins,
.gm-pg-price ins .amount {
	text-decoration: none;
}

/* ---------- Formula text (shown below the price) ---------- */
.gm-pg-formula {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	line-height: 1.4;
	color: #555;
}

.gm-pg-formula .woocommerce-Price-amount,
.gm-pg-formula .amount {
	font-weight: 600;
}

/*
 * Inline layout: show the price prefix text, the price and the formula text
 * together on a single line. Default (stacked) keeps them on separate lines.
 */
.gm-pg-formula-layout-inline .gm-pg-price-text,
.gm-pg-formula-layout-inline .gm-pg-price,
.gm-pg-formula-layout-inline .gm-pg-formula {
	display: inline;
}

.gm-pg-formula-layout-inline .gm-pg-price-text {
	margin-right: 6px;
}

.gm-pg-formula-layout-inline .gm-pg-formula {
	margin-top: 0;
	margin-left: 6px;
}

/* ---------- Button ---------- */
.gm-pg-button {
	display: inline-block;
	margin-top: 10px;
	padding: 9px 18px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: #2271b1;
	border: none;
	border-radius: 6px;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.gm-pg-button:hover {
	background: #185a8d;
	color: #fff;
}

.gm-pg-button.disabled {
	opacity: 0.5;
	pointer-events: none;
}

/* ---------- "See more" button (per product card, opens the product page) ---------- */
.gm-pg-see-more-btn {
	display: inline-block;
	margin-top: 10px;
	padding: 12px 28px;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	background: #2271b1;
	border: none;
	border-radius: 6px;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.gm-pg-see-more-btn:hover {
	background: #185a8d;
	color: #fff;
}

/* ---------- Notices ---------- */
.gm-pg-notice {
	padding: 16px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	color: #50575e;
	background: #f6f7f7;
	text-align: center;
}
