.wcpp-pdf-wrap {
	display: block;
	width: auto;
	max-width: 100%;
	clear: both;
	margin-top: 0.35em;
	margin-bottom: 0.35em;
	box-sizing: border-box;
}

.wcpp-pdf-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	line-height: 1.2;
	text-decoration: none;
}

.wcpp-pdf-link:hover,
.wcpp-pdf-link:focus {
	opacity: 0.85;
}

.wcpp-pdf-label {
	display: inline-block;
	font-size: inherit;
	line-height: 1.2;
}

.wcpp-pdf-icon {
	display: inline-block;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	max-width: 40px !important;
	max-height: 40px !important;
	vertical-align: middle;
	background: url( '../img/pdf-icon.svg' ) no-repeat center / contain;
}

/* Grids WooCommerce (flex fila + wrap): PDF en su propia fila antes del botón */
.woocommerce ul.products li.product .wcpp-pdf-wrap {
	flex-basis: 100%;
	width: 100%;
}

/* Grid categorías / .woocommerce-no-gap: tarjetas en columna — evitar flex-basis 100% (rompe altura) */
.woocommerce ul.products.woocommerce-no-gap li.product .wcpp-pdf-wrap,
.categoria-contents .categoria-content ul.products.woocommerce-no-gap li.product .wcpp-pdf-wrap {
	flex: 0 0 auto;
	flex-basis: auto;
	width: auto;
	align-self: center;
	text-align: center;
	margin-top: 10px;
	margin-bottom: 0;
}

.categoria-contents .categoria-content ul.products.woocommerce-no-gap li.product .wcpp-pdf-wrap .wcpp-pdf-link {
	justify-content: center;
}

.woocommerce ul.products li.product .wcpp-pdf-wrap + .button,
.woocommerce ul.products li.product .wcpp-pdf-wrap + a.button,
.woocommerce ul.products li.product .wcpp-pdf-wrap + .add_to_cart_button,
.woocommerce ul.products li.product .wcpp-pdf-wrap ~ .button,
.woocommerce ul.products li.product .wcpp-pdf-wrap ~ a.add_to_cart_button {
	clear: both;
	flex: 0 0 auto;
	margin-top: 0.15em;
}

.wcpp-block-placeholder {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	background: #f6f7f7;
}

.wcpp-block-placeholder .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
	color: #d63638;
}

.wcpp-elementor-placeholder {
	padding: 12px;
	border: 1px dashed #d63638;
	color: #50575e;
	text-align: center;
}

/* Miniatura PDF en galería WooCommerce (flexslider / Elementor) */
.woocommerce-product-gallery .flex-control-thumbs .wcpp-pdf-gallery-thumb,
.woocommerce-product-gallery ol.flex-control-nav .wcpp-pdf-gallery-thumb {
	list-style: none;
	box-sizing: border-box;
}

.woocommerce-product-gallery .flex-control-thumbs .wcpp-pdf-gallery-thumb,
.woocommerce-product-gallery ol.flex-control-nav.flex-control-thumbs .wcpp-pdf-gallery-thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.woocommerce-product-gallery .flex-control-thumbs .wcpp-pdf-gallery-thumb .wcpp-pdf-gallery-link,
.woocommerce-product-gallery ol.flex-control-nav.flex-control-thumbs .wcpp-pdf-gallery-thumb .wcpp-pdf-gallery-link {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	text-decoration: none;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	opacity: 0.5;
	transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.woocommerce-product-gallery .flex-control-thumbs .wcpp-pdf-gallery-thumb .wcpp-pdf-gallery-link:hover,
.woocommerce-product-gallery .flex-control-thumbs .wcpp-pdf-gallery-thumb .wcpp-pdf-gallery-link:focus,
.woocommerce-product-gallery ol.flex-control-nav.flex-control-thumbs .wcpp-pdf-gallery-thumb .wcpp-pdf-gallery-link:hover,
.woocommerce-product-gallery ol.flex-control-nav.flex-control-thumbs .wcpp-pdf-gallery-thumb .wcpp-pdf-gallery-link:focus {
	opacity: 1;
	border-color: rgba(0, 0, 0, 0.25);
	background: #f7f7f7;
}

.woocommerce-product-gallery .wcpp-pdf-gallery-thumb .wcpp-pdf-gallery-icon {
	width: 42% !important;
	height: 42% !important;
	max-width: none !important;
	max-height: none !important;
	flex-shrink: 0;
}

.wcpp-pdf-gallery-fallback {
	display: none;
	margin: 0.5em 0 0;
	padding: 0;
	list-style: none;
}

.wcpp-pdf-gallery-fallback .wcpp-pdf-gallery-thumb {
	display: inline-block;
	width: 100px;
	height: 100px;
	margin: 0 0.5em 0.5em 0;
	vertical-align: top;
}

.wcpp-pdf-gallery-fallback .wcpp-pdf-gallery-thumb .wcpp-pdf-gallery-link {
	position: static;
	opacity: 1;
	width: 100%;
	height: 100%;
	min-height: 100%;
}

/* Enlace "Ver PDF" debajo de iconos de compartir en ficha de producto */
.wcpp-pdf-share-wrap {
	display: block;
	width: 100%;
	margin: 0.75em 0 1em;
	clear: both;
}

.wcpp-pdf-share-link {
	font-size: inherit;
	text-decoration: none;
}

.wcpp-pdf-share-link:hover,
.wcpp-pdf-share-link:focus {
	text-decoration: underline;
}
