/* ============================================================
   Shortcode: [farmacia_carousel]
   ============================================================ */

.farmacia-carousel-wrap {
	position: relative;
	padding: 0 48px;
}

/* Swiper override */
.farmacia-carousel-swiper {
	overflow: hidden;
}

/* Card */
.farmacia-product-card {
	background: #fff;
	border-radius: 12px;
	border: 1px solid #e8e8e8;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	transition: box-shadow 0.2s ease;
}

.farmacia-product-card:hover {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.11);
}

/* Image */
.farmacia-product-img-link {
	display: block;
	text-decoration: none;
}

.farmacia-product-img {
	height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: #fff;
}

.farmacia-product-img img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

/* Body */
.farmacia-product-body {
	padding: 12px 16px 16px;
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 6px;
}

.farmacia-product-name-link {
	text-decoration: none;
	color: inherit;
}

.farmacia-product-name {
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.4;
	margin: 0;
	/* clamp a 2 líneas */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* WooCommerce price */
.farmacia-product-price {
	font-family: 'Montserrat', sans-serif;
	margin: 4px 0 0;
}

.farmacia-product-price .woocommerce-Price-amount {
	font-size: 20px;
	font-weight: 700;
	color: #1a1a1a;
}

.farmacia-product-price del .woocommerce-Price-amount {
	font-size: 13px;
	font-weight: 400;
	color: #999;
}

.farmacia-product-price ins {
	text-decoration: none;
}

/* Ex-tax line */
.farmacia-product-exvat {
	font-family: 'Montserrat', sans-serif;
	font-size: 11px;
	color: #888;
	margin: 0;
}

/* Add to cart button */
.farmacia-btn-cart {
	display: block;
	width: 100%;
	padding: 11px 12px;
	background: #2e7d32;
	color: #fff !important;
	text-align: center;
	border-radius: 8px;
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	margin-top: auto;
	box-sizing: border-box;
	transition: background 0.2s ease;
	line-height: 1.4;
}

.farmacia-btn-cart:hover {
	background: #1b5e20;
	color: #fff !important;
	text-decoration: none !important;
}

.farmacia-btn-cart.loading {
	pointer-events: none;
	opacity: 0.65;
}

/* Navigation arrows */
.farmacia-carousel-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 38px;
	height: 38px;
	background: #fff;
	border: none;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 15px;
	color: #444;
	user-select: none;
	transition: box-shadow 0.2s ease, opacity 0.2s ease;
	padding: 0;
	line-height: 1;
}

.farmacia-carousel-btn:hover {
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.farmacia-carousel-prev {
	left: 0;
}

.farmacia-carousel-next {
	right: 0;
}

.farmacia-carousel-btn.swiper-button-disabled {
	opacity: 0.3;
	pointer-events: none;
}

/* Responsive */
@media (max-width: 860px) {
	.farmacia-carousel-wrap {
		padding: 0 36px;
	}

	.farmacia-product-img {
		height: 170px;
	}
}

@media (max-width: 540px) {
	.farmacia-carousel-wrap {
		padding: 0 30px;
	}

	.farmacia-product-img {
		height: 150px;
	}

	.farmacia-product-price .woocommerce-Price-amount {
		font-size: 18px;
	}
}

/* ============================================================
   Themify WC Product Filter — Paginador (.wpf-pagination)
   ============================================================ */

.wpf-pagination {
	margin: 32px 0 8px;
	text-align: center;
}

.wpf-pagination ul.page-numbers span.page-numbers {

	background-color: #2e7d32 !important;

}

.wpf-pagination ul.page-numbers,
.wpf-pagination ul.page-numbers li {
	border: none !important;
}

.wpf-pagination ul.page-numbers span,
.wpf-pagination ul.page-numbers a {
	font-size: 16px !important;
}

.wpf-pagination ul.page-numbers a.page-numbers {

	color: #2e7d32 !important;
	font-weight: bold;
	background-color: #FCFCFC !important;

}


.wpf-pagination ul.page-numbers span.current {
	color: #fff !important;
	font-weight: bold;
	background-color: #2e7d32 !important;
}



/* Lista de números */
.wpf-pagination ul.page-numbers,
.woocommerce-pagination ul.page-numbers {
	display: flex !important;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
}



/* ============================================================
   Themify WC Product Filter — Labels del filtro (.wpf_form_filtros)
   ============================================================ */

.wpf_form_filtros .wpf_item_name,
.wpf_form_filtros label,
.wpf_form_filtros .wpf_item li label,
.wpf_form_filtros a {
	color: #222 !important;
}

/* Botón de búsqueda del filtro — verde en lugar del amarillo por defecto */
.wpf_form_filtros .wpf_search_button {
	background-color: #2e7d32;
}

.wpf_form_filtros .wpf_search_button:hover {
	background-color: #1b5e20;
	color: #fff;
}

/* ============================================================
   WooCommerce loop — card estilo carousel (content-product.php)
   ============================================================ */

/* Ajusta el li generado por WooCommerce para que la card llene el espacio */
ul.products .farmacia-loop-card {
	padding: 8px;
	box-sizing: border-box;
}

ul.products .farmacia-loop-card .farmacia-product-card {
	height: 100%;
}

/* Badge de oferta sobre la imagen */
.farmacia-product-img {
	position: relative;
}

.farmacia-sale-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: #e8560a;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 20px;
	z-index: 1;
	line-height: 1.4;
}

/* Sin stock */
.farmacia-btn-cart--disabled {
	background: #aaa;
	cursor: not-allowed;
	pointer-events: none;
}

/* ============================================================
   Shortcode: [farmacia_categorias]
   ============================================================ */

.farmacia-categorias-wrap {
	margin: 40px 0;
}

.farmacia-categorias-titulo {
	font-family: 'Montserrat', sans-serif;
	font-size: 26px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 20px;
}

/* Grid */
.farmacia-categorias-grid {
	display: grid;
	gap: 12px;
}

.farmacia-categorias-cols-5 {
	grid-template-columns: repeat(5, 1fr);
}

.farmacia-categorias-cols-4 {
	grid-template-columns: repeat(4, 1fr);
}

.farmacia-categorias-cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

/* Card */
.farmacia-cat-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: #ffffff;
	border-radius: 10px;
	border: 1px solid #e5e5e5;
	text-decoration: none;
	color: #1a1a1a;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.farmacia-cat-card:hover {
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.09);
	border-color: #d0d0d0;
	text-decoration: none;
	color: #1a1a1a;
}

/* Badge */
.farmacia-cat-badge {
	position: absolute;
	top: -11px;
	left: 50%;
	transform: translateX(-50%);
	background: #e8560a;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 10px;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 20px;
	white-space: nowrap;
	line-height: 1.4;
}

/* Icon */
.farmacia-cat-icon {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.farmacia-cat-icon img {
	width: 52px;
	height: 52px;
	object-fit: contain;
	display: block;
}

.farmacia-cat-icon-placeholder {
	display: block;
	width: 40px;
	height: 40px;
	background: #f0f0f0;
	border-radius: 50%;
}

/* Name */
.farmacia-cat-name {
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	color: #1a1a1a;
}

/* Responsive */
@media (max-width: 1200px) {
	.farmacia-categorias-cols-5 {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 900px) {

	.farmacia-categorias-cols-5,
	.farmacia-categorias-cols-4 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 640px) {

	.farmacia-categorias-cols-5,
	.farmacia-categorias-cols-4,
	.farmacia-categorias-cols-3 {
		grid-template-columns: repeat(2, 1fr);
	}

	.farmacia-categorias-titulo {
		font-size: 20px;
	}

	.farmacia-cat-name {
		font-size: 12px;
	}
}

/* ============================================================
   Shortcode: [farmacia_mega_nav]
   ============================================================ */

.farmacia-mega-nav {
	background: #1a1a1a;
	width: 100%;
	position: relative;
	z-index: 1000;
}

.farmacia-mega-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Bar — lista horizontal de categorías top-level */
.farmacia-mega-bar {
	display: flex;
	flex-wrap: nowrap;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0;
	overflow-x: auto;
	scrollbar-width: none;         /* Firefox */
	-ms-overflow-style: none;      /* IE/Edge */
}
.farmacia-mega-bar::-webkit-scrollbar { display: none; }

/* Cada ítem top-level */
.farmacia-mega-item {
	position: static;
	flex-shrink: 0;
}

/* Botón / link de primer nivel */
.farmacia-mega-trigger {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 14px 16px;
	background: transparent;
	border: none;
	color: #f0f0f0;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	text-decoration: none;
	line-height: 1;
	transition: background 0.15s ease, color 0.15s ease;
}

.farmacia-mega-trigger:hover,
.farmacia-mega-item.fm-open > .farmacia-mega-trigger {
	background: #2e7d32;
	color: #fff;
	text-decoration: none;
}

/* Icono de categoría pequeño */
.farmacia-mega-trigger .fm-cat-icon {
	width: 20px;
	height: 20px;
	object-fit: contain;
	border-radius: 3px;
	flex-shrink: 0;
}

/* Chevron — rota cuando el panel está abierto */
.fm-chevron {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}
.farmacia-mega-item.fm-open .fm-chevron {
	transform: rotate(180deg);
}

/* Panel desplegable */
.farmacia-mega-panel {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: #fff;
	border-top: 3px solid #2e7d32;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
	padding: 24px 28px 20px;
	z-index: 999;
	animation: fmPanelIn 0.15s ease;
}

.farmacia-mega-item.fm-open > .farmacia-mega-panel {
	display: block;
}

@keyframes fmPanelIn {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Lista de hijos dentro del panel */
.farmacia-mega-children {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

/* Cada link hijo */
.fm-child-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: #f5f5f5;
	border-radius: 20px;
	color: #333;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.fm-child-link:hover {
	background: #e8f5e9;
	color: #2e7d32;
	text-decoration: none;
}

.fm-child-link img {
	width: 22px;
	height: 22px;
	object-fit: contain;
	border-radius: 3px;
	flex-shrink: 0;
}

/* "Ver todo en …" */
.fm-ver-todos {
	display: inline-block;
	font-family: 'Montserrat', sans-serif;
	font-size: 12px;
	font-weight: 600;
	color: #2e7d32;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.fm-ver-todos:hover {
	color: #1b5e20;
}

/* ---- Responsive ---- */

/* Tablet: bar scrollable, panel usa padding menor */
@media (max-width: 900px) {
	.farmacia-mega-trigger {
		padding: 12px 13px;
		font-size: 12px;
	}

	.farmacia-mega-panel {
		padding: 18px 18px 16px;
	}
}

/* Mobile: oculta en pantallas muy pequeñas o adapta a columna */
@media (max-width: 600px) {
	.farmacia-mega-trigger {
		padding: 11px 11px;
		font-size: 11px;
		gap: 4px;
	}

	.farmacia-mega-panel {
		padding: 14px 14px 12px;
		position: fixed;
		top: auto;
		left: 0;
		right: 0;
		max-height: 60vh;
		overflow-y: auto;
	}

	.farmacia-mega-children {
		gap: 6px;
	}

	.fm-child-link {
		font-size: 12px;
		padding: 7px 11px;
	}
}