/**
 * Ferremaq – WooCommerce tienda / categorías
 */

body.fmq-custom-shop-active .site-content,
body.fmq-custom-shop-active #primary,
body.fmq-custom-shop-active .ast-container,
body.fmq-custom-shop-active .content-area,
body.fmq-custom-shop-active #main,
body.fmq-custom-shop-active .ast-woocommerce-container,
body.fmq-custom-shop-active .woocommerce-page .site-content > .ast-container {
	max-width: 100% !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body.fmq-custom-shop-active .site-content,
body.fmq-custom-shop-active .site-content > .ast-container,
body.fmq-custom-shop-active #primary,
body.fmq-custom-shop-active #main,
body.fmq-custom-shop-active .ast-woocommerce-container,
body.fmq-custom-shop-active .fmq-shop-page,
body.fmq-custom-shop-active .fmq-product-page {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

body.fmq-custom-shop-active #content,
body.fmq-custom-shop-active .site-content,
body.fmq-custom-shop-active #primary,
body.fmq-custom-shop-active #main,
body.fmq-custom-shop-active .ast-woocommerce-container,
body.fmq-custom-shop-active .fmq-shop-page,
body.fmq-custom-shop-active .fmq-product-page {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
}

body.fmq-custom-shop-active .woocommerce-breadcrumb,
body.fmq-custom-shop-active .woocommerce-products-header,
body.fmq-custom-shop-active .woocommerce-result-count,
body.fmq-custom-shop-active .woocommerce-ordering {
	display: none !important;
}

body.fmq-custom-shop-active .entry-header,
body.fmq-custom-shop-active .ast-archive-description {
	display: none !important;
}

/* Contenedor vertical: imagen → franja → productos */
.fmq-shop-page {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

/* Banner categoría — recorte centrado a ancho completo (imagen 7:10) */
.fmq-shop-hero {
	position: relative;
	width: 100%;
	flex: 0 0 auto;
	aspect-ratio: var(--fmq-banner-aspect, 30 / 4);
	overflow: hidden;
	background-color: #8a8a8a;
	isolation: isolate;
}

.fmq-shop-hero__img {
	position: absolute;
	top: 50%;
	left: 50%;
	width: auto;
	height: auto;
	min-width: 100%;
	min-height: 100%;
	max-width: none;
	transform: translate(-50%, -50%);
	object-fit: cover;
	object-position: center var(--fmq-banner-focus-y, 50%);
	display: block;
}

body.woocommerce-page .fmq-shop-hero__img,
body.woocommerce .fmq-shop-hero__img,
.woocommerce-page .fmq-shop-hero__img {
	position: absolute !important;
	top: 50% !important;
	left: 50% !important;
	right: auto !important;
	bottom: auto !important;
	width: auto !important;
	height: auto !important;
	min-width: 100% !important;
	min-height: 100% !important;
	max-width: none !important;
	transform: translate(-50%, -50%) !important;
	object-fit: cover !important;
	object-position: center var(--fmq-banner-focus-y, 50%) !important;
}

.fmq-shop-hero__placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #144177 0%, #1e5a9e 50%, #144177 100%);
}

/* Franja amarilla */
.fmq-shop-tagline {
	width: 100%;
	flex: 0 0 auto;
	background: #ffcf19;
	text-align: center;
	padding: clamp(10px, 1.5vw, 16px) 16px;
}

.fmq-shop-tagline p {
	margin: 0;
	font-family: 'Montserrat', sans-serif;
	font-size: clamp(14px, 2.2vw, 22px);
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #144177;
}

/* Layout principal */
.fmq-shop {
	width: 100%;
	flex: 0 0 auto;
	background: #f3f5f7;
	padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 40px) clamp(32px, 4vw, 48px);
	box-sizing: border-box;
}

.fmq-shop__layout {
	display: grid;
	grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
	gap: clamp(16px, 2.5vw, 28px);
	max-width: 1400px;
	margin: 0 auto;
	align-items: start;
}

/* Sidebar categorías */
.fmq-shop-sidebar {
	background: #ffffff;
	border: 1px solid #d8dee6;
}

.fmq-shop-sidebar__head {
	background: #ffcf19;
	padding: 10px 14px;
	border-bottom: 1px solid #e6c015;
}

.fmq-shop-sidebar__head span {
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: #144177;
}

.fmq-shop-sidebar__nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fmq-shop-sidebar__nav li {
	border-bottom: 1px solid #e8ecf0;
}

.fmq-shop-sidebar__nav li:last-child {
	border-bottom: 0;
}

.fmq-shop-sidebar__nav a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	text-decoration: none;
	color: #144177;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 500;
	transition: background 0.2s ease;
}

.fmq-shop-sidebar__nav a:hover {
	background: #f0f4f8;
}

.fmq-shop-sidebar__nav li.is-active a {
	background: #e8eef5;
	font-weight: 700;
}

.fmq-shop-sidebar__check {
	width: 16px;
	height: 16px;
	border: 2px solid #144177;
	border-radius: 2px;
	flex-shrink: 0;
	background: #fff;
	position: relative;
}

.fmq-shop-sidebar__nav li.is-active .fmq-shop-sidebar__check::after {
	content: '';
	position: absolute;
	left: 3px;
	top: 0;
	width: 5px;
	height: 9px;
	border: solid #144177;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Grid productos */
.fmq-shop__products .woocommerce-notices-wrapper {
	margin-bottom: 16px;
}

.fmq-shop__products ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(14px, 1.8vw, 20px);
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
}

.fmq-shop__products ul.products::before,
.fmq-shop__products ul.products::after {
	display: none !important;
}

.fmq-shop__products ul.products li.product {
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	clear: none !important;
}

.fmq-shop__products .woocommerce-pagination {
	grid-column: 1 / -1;
	margin-top: 8px;
}

/* Tarjeta producto */
.fmq-shop-card {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid #d8dee6;
	overflow: hidden;
}

.fmq-shop-card__title {
	background: #144177;
	padding: 10px 8px;
	text-align: center;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.fmq-shop-card__title a {
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-size: clamp(10px, 1vw, 12px);
	font-weight: 700;
	text-decoration: none;
	line-height: 1.25;
	text-transform: uppercase;
}

.fmq-shop-card__image {
	position: relative;
	background: #ffffff;
	padding: 16px;
	min-height: 160px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.fmq-shop-card__image-link {
	display: block;
	width: 100%;
	text-align: center;
}

.fmq-shop-card__image img {
	max-width: 100%;
	height: auto;
	max-height: 140px;
	width: auto;
	object-fit: contain;
	margin: 0 auto;
}

.fmq-shop-card__badge {
	position: absolute;
	top: 8px;
	right: 8px;
	background: #d32f2f;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 6px;
	line-height: 1;
	z-index: 2;
}

.fmq-shop-card__price {
	background: #144177;
	color: #ffffff;
	text-align: center;
	padding: 10px 8px;
	font-family: 'Montserrat', sans-serif;
	font-size: clamp(12px, 1.1vw, 14px);
	font-weight: 700;
}

.fmq-shop-card__price del {
	opacity: 0.65;
	font-size: 0.85em;
	margin-right: 4px;
}

.fmq-shop-card__price ins {
	text-decoration: none;
	color: #ffffff;
}

.fmq-shop-card__action {
	padding: 0;
}

.fmq-shop-card__btn {
	display: block !important;
	width: 100%;
	background: #ffcf19 !important;
	color: #144177 !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 12px 10px !important;
	font-family: 'Montserrat', sans-serif !important;
	font-size: clamp(11px, 1vw, 13px) !important;
	font-weight: 700 !important;
	text-align: center;
	text-decoration: none !important;
	line-height: 1.3 !important;
	transition: filter 0.2s ease;
}

.fmq-shop-card__btn:hover {
	filter: brightness(1.05);
	color: #144177 !important;
}

.fmq-shop-card__btn.is-disabled,
.fmq-shop-card__btn[aria-disabled="true"] {
	opacity: 0.55;
	pointer-events: none;
}

@media (max-width: 1200px) {
	.fmq-shop__products ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 992px) {
	.fmq-shop__layout {
		grid-template-columns: 1fr;
	}

	.fmq-shop__products ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 540px) {
	.fmq-shop {
		padding: 16px 12px 28px;
	}

	.fmq-shop__products ul.products {
		grid-template-columns: 1fr;
	}
}
