/*
 * Bonita Sorpresa - Modo App Capa 3
 * Capa visual solamente. Todo queda en el DOM y WooCommerce conserva sus hooks.
 */

html.bs-app-layer3-on body.bs-app-layer3-capable {
	--bs-l3-green: #65a231;
	--bs-l3-green-dark: #4d8126;
	--bs-l3-orange: #dd8635;
	--bs-l3-orange-dark: #b76722;
	--bs-l3-ink: #1c2319;
	--bs-l3-muted: #70776c;
	--bs-l3-line: rgba(31, 48, 21, .10);
	--bs-l3-bg: #faf9f5;
	background: var(--bs-l3-bg) !important;
	color: var(--bs-l3-ink) !important;
}

html.bs-app-layer3-on body.bs-app-layer3-capable,
html.bs-app-layer3-on body.bs-app-layer3-capable * {
	box-sizing: border-box;
}

/* Cabecera, pie y widgets externos: solo se ocultan mientras la cookie está activa. */
html.bs-app-layer3-on body.bs-app-layer3-capable #masthead,
html.bs-app-layer3-on body.bs-app-layer3-capable header.site-header,
html.bs-app-layer3-on body.bs-app-layer3-capable .site-header,
html.bs-app-layer3-on body.bs-app-layer3-capable .elementor-location-header,
html.bs-app-layer3-on body.bs-app-layer3-capable .wp-site-blocks > header,
html.bs-app-layer3-on body.bs-app-layer3-capable #colophon,
html.bs-app-layer3-on body.bs-app-layer3-capable footer.site-footer,
html.bs-app-layer3-on body.bs-app-layer3-capable .site-footer,
html.bs-app-layer3-on body.bs-app-layer3-capable .elementor-location-footer,
html.bs-app-layer3-on body.bs-app-layer3-capable .wp-site-blocks > footer,
html.bs-app-layer3-on body.bs-app-layer3-capable .site-below-footer-wrap,
html.bs-app-layer3-on body.bs-app-layer3-capable .site-primary-footer-wrap,
html.bs-app-layer3-on body.bs-app-layer3-capable #ubd-main-nav,
html.bs-app-layer3-on body.bs-app-layer3-capable #ubd-navbar,
html.bs-app-layer3-on body.bs-app-layer3-capable #ubd-overlay,
html.bs-app-layer3-on body.bs-app-layer3-capable #ubd-drawer,
html.bs-app-layer3-on body.bs-app-layer3-capable #ubd-ios-notice,
html.bs-app-layer3-on body.bs-app-layer3-capable #ubd-floating-trigger,
html.bs-app-layer3-on body.bs-app-layer3-capable #ubd-helper-overlay,
html.bs-app-layer3-on body.bs-app-layer3-capable #ubd-helper-widget,
html.bs-app-layer3-on body.bs-app-layer3-capable #ast-scroll-top,
html.bs-app-layer3-on body.bs-app-layer3-capable .ast-scroll-top-icon,
html.bs-app-layer3-on body.bs-app-layer3-capable .scroll-to-top,
html.bs-app-layer3-on body.bs-app-layer3-capable .back-to-top,
html.bs-app-layer3-on body.bs-app-layer3-capable .wpfront-scroll-top-container {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

html.bs-app-layer3-on body.bs-app-layer3-capable #content,
html.bs-app-layer3-on body.bs-app-layer3-capable .site-content,
html.bs-app-layer3-on body.bs-app-layer3-capable .ast-container,
html.bs-app-layer3-on body.bs-app-layer3-capable .site-content > .ast-container,
html.bs-app-layer3-on body.bs-app-layer3-capable #primary,
html.bs-app-layer3-on body.bs-app-layer3-capable main.site-main {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding-right: 0 !important;
	padding-left: 0 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-capable #secondary,
html.bs-app-layer3-on body.bs-app-layer3-capable aside.sidebar,
html.bs-app-layer3-on body.bs-app-layer3-capable .widget-area,
html.bs-app-layer3-on body.bs-app-layer3-capable .woocommerce-breadcrumb,
html.bs-app-layer3-on body.bs-app-layer3-capable .ast-breadcrumbs-wrapper,
html.bs-app-layer3-on body.bs-app-layer3-capable nav.rank-math-breadcrumb,
html.bs-app-layer3-on body.bs-app-layer3-capable .yoast-breadcrumbs {
	display: none !important;
}

/* =========================================================
   CATEGORÍAS: foto + precio, sin perder links ni paginación.
   ========================================================= */
html.bs-app-layer3-on body.bs-app-layer3-category .woocommerce-products-header,
html.bs-app-layer3-on body.bs-app-layer3-category .term-description,
html.bs-app-layer3-on body.bs-app-layer3-category .page-title,
html.bs-app-layer3-on body.bs-app-layer3-category .entry-header,
html.bs-app-layer3-on body.bs-app-layer3-category .woocommerce-result-count,
html.bs-app-layer3-on body.bs-app-layer3-category .woocommerce-ordering,
html.bs-app-layer3-on body.bs-app-layer3-category .storefront-sorting,
html.bs-app-layer3-on body.bs-app-layer3-category .bs-category-app-panel,
html.bs-app-layer3-on body.bs-app-layer3-category .bs-cat-hero,
html.bs-app-layer3-on body.bs-app-layer3-category .bs-cat-trust,
html.bs-app-layer3-on body.bs-app-layer3-category .bs-cat-products-anchor,
html.bs-app-layer3-on body.bs-app-layer3-category .bs-cat-seo,
html.bs-app-layer3-on body.bs-app-layer3-category .woocommerce-info,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-components-notice-banner {
	display: none !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category .woocommerce,
html.bs-app-layer3-on body.bs-app-layer3-category .ast-woocommerce-container,
html.bs-app-layer3-on body.bs-app-layer3-category .site-main,
html.bs-app-layer3-on body.bs-app-layer3-category .entry-content {
	width: min(1280px, calc(100vw - 22px)) !important;
	max-width: min(1280px, calc(100vw - 22px)) !important;
	margin: 0 auto !important;
	padding: clamp(14px, 3vw, 34px) 0 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category ul.products,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__products,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-product-template,
html.bs-app-layer3-on body.bs-app-layer3-category .elementor-products-grid ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: clamp(9px, 1.7vw, 20px) !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category li.product,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-product {
	position: relative !important;
	display: flex !important;
	min-width: 0 !important;
	flex-direction: column !important;
	margin: 0 !important;
	padding: clamp(8px, 1.2vw, 13px) !important;
	overflow: hidden !important;
	border: 1px solid rgba(255,255,255,.92) !important;
	border-radius: clamp(18px, 2.4vw, 28px) !important;
	background: #fff !important;
	box-shadow: 0 12px 32px rgba(38,55,28,.075), inset 0 1px 0 #fff !important;
	cursor: pointer !important;
	transition: transform .2s ease, box-shadow .2s ease !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category li.product:hover,
html.bs-app-layer3-on body.bs-app-layer3-category li.product:focus-visible,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product:hover,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-product:hover {
	transform: translateY(-4px) !important;
	box-shadow: 0 20px 42px rgba(38,55,28,.12), inset 0 1px 0 #fff !important;
	outline: none !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category li.product a,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product a,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-product a {
	text-decoration: none !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category li.product img,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product-image img,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-components-product-image img,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-product img {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1 !important;
	margin: 0 !important;
	object-fit: contain !important;
	object-position: center !important;
	border-radius: clamp(14px, 2vw, 22px) !important;
	background: radial-gradient(circle at 50% 35%, rgba(101,162,49,.08), transparent 60%), #f8f8f6 !important;
}

/* El nombre queda disponible para lectores de pantalla y para el link, pero no se ve. */
html.bs-app-layer3-on body.bs-app-layer3-category .woocommerce-loop-product__title,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product-title,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-components-product-name,
html.bs-app-layer3-on body.bs-app-layer3-category .wp-block-post-title {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0,0,0,0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category li.product .price,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product-price,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-components-product-price,
html.bs-app-layer3-on body.bs-app-layer3-category .wp-block-woocommerce-product-price {
	display: block !important;
	position: relative !important;
	z-index: 2 !important;
	margin: 10px 2px 2px !important;
	color: var(--bs-l3-ink) !important;
	font-size: clamp(.92rem, 1.5vw, 1.13rem) !important;
	font-weight: 900 !important;
	line-height: 1.15 !important;
	text-align: center !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category li.product .price del,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product-price del {
	color: var(--bs-l3-muted) !important;
	font-size: .82em !important;
	opacity: .75 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category li.product .price ins,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product-price ins {
	color: var(--bs-l3-orange-dark) !important;
	text-decoration: none !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category li.product .button,
html.bs-app-layer3-on body.bs-app-layer3-category li.product .added_to_cart,
html.bs-app-layer3-on body.bs-app-layer3-category li.product .star-rating,
html.bs-app-layer3-on body.bs-app-layer3-category li.product .onsale,
html.bs-app-layer3-on body.bs-app-layer3-category li.product .ast-woo-product-category,
html.bs-app-layer3-on body.bs-app-layer3-category li.product .ast-woo-shop-product-description,
html.bs-app-layer3-on body.bs-app-layer3-category li.product .product-excerpt,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product-rating,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product-add-to-cart,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-components-product-rating,
html.bs-app-layer3-on body.bs-app-layer3-category .wp-block-button,
html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-components-product-sale-badge {
	display: none !important;
}

/* Paginación mínima para que ningún producto quede inaccesible. */
html.bs-app-layer3-on body.bs-app-layer3-category nav.woocommerce-pagination,
html.bs-app-layer3-on body.bs-app-layer3-category .wp-block-query-pagination {
	display: flex !important;
	justify-content: center !important;
	margin: 24px auto 6px !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category nav.woocommerce-pagination ul {
	display: flex !important;
	gap: 7px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category nav.woocommerce-pagination ul li {
	border: 0 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category nav.woocommerce-pagination a,
html.bs-app-layer3-on body.bs-app-layer3-category nav.woocommerce-pagination span {
	display: grid !important;
	width: 40px !important;
	height: 40px !important;
	place-items: center !important;
	padding: 0 !important;
	border: 1px solid var(--bs-l3-line) !important;
	border-radius: 14px !important;
	background: #fff !important;
	color: var(--bs-l3-ink) !important;
	font-weight: 850 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-category nav.woocommerce-pagination .current {
	border-color: var(--bs-l3-green) !important;
	background: var(--bs-l3-green) !important;
	color: #fff !important;
}

/* =========================================================
   PRODUCTO: fotos + precio + personalizador completo.
   ========================================================= */
html.bs-app-layer3-on body.bs-app-layer3-product .entry-header,
html.bs-app-layer3-on body.bs-app-layer3-product .product_title,
html.bs-app-layer3-on body.bs-app-layer3-product .woocommerce-product-rating,
html.bs-app-layer3-on body.bs-app-layer3-product .woocommerce-product-details__short-description,
html.bs-app-layer3-on body.bs-app-layer3-product .product_meta,
html.bs-app-layer3-on body.bs-app-layer3-product .woocommerce-tabs,
html.bs-app-layer3-on body.bs-app-layer3-product .related.products,
html.bs-app-layer3-on body.bs-app-layer3-product .upsells.products,
html.bs-app-layer3-on body.bs-app-layer3-product .cross-sells,
html.bs-app-layer3-on body.bs-app-layer3-product #reviews,
html.bs-app-layer3-on body.bs-app-layer3-product .comments-area,
html.bs-app-layer3-on body.bs-app-layer3-product .sharedaddy,
html.bs-app-layer3-on body.bs-app-layer3-product .product-share-wrap,
html.bs-app-layer3-on body.bs-app-layer3-product .ast-single-product-payments,
html.bs-app-layer3-on body.bs-app-layer3-product .ast-product-navigation-wrapper,
html.bs-app-layer3-on body.bs-app-layer3-product .woocommerce-noreviews,
html.bs-app-layer3-on body.bs-app-layer3-product .woocommerce-Reviews-title {
	display: none !important;
}

html.bs-app-layer3-on body.bs-app-layer3-product .woocommerce,
html.bs-app-layer3-on body.bs-app-layer3-product .ast-woocommerce-container,
html.bs-app-layer3-on body.bs-app-layer3-product .site-main,
html.bs-app-layer3-on body.bs-app-layer3-product article.product,
html.bs-app-layer3-on body.bs-app-layer3-product div.product {
	width: 100% !important;
	max-width: none !important;
	margin-right: 0 !important;
	margin-left: 0 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-product div.product .woocommerce-product-gallery {
	float: none !important;
	width: min(760px, calc(100vw - 20px)) !important;
	max-width: min(760px, calc(100vw - 20px)) !important;
	margin: clamp(12px, 3vw, 30px) auto 12px !important;
	padding: clamp(8px, 1.4vw, 14px) !important;
	border: 1px solid rgba(255,255,255,.95) !important;
	border-radius: clamp(21px, 3vw, 32px) !important;
	background: #fff !important;
	box-shadow: 0 18px 48px rgba(39,55,29,.09), inset 0 1px 0 #fff !important;
}

html.bs-app-layer3-on body.bs-app-layer3-product div.product .woocommerce-product-gallery img {
	object-fit: contain !important;
	object-position: center !important;
	border-radius: clamp(15px, 2.4vw, 25px) !important;
}

html.bs-app-layer3-on body.bs-app-layer3-product div.product .summary {
	float: none !important;
	width: min(760px, calc(100vw - 20px)) !important;
	max-width: min(760px, calc(100vw - 20px)) !important;
	min-height: 0 !important;
	margin: 0 auto !important;
	padding: 4px 10px 0 !important;
	text-align: center !important;
}

html.bs-app-layer3-on body.bs-app-layer3-product div.product .summary > .price {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-height: 50px !important;
	margin: 0 auto 12px !important;
	padding: 10px 18px !important;
	border: 1px solid var(--bs-l3-line) !important;
	border-radius: 999px !important;
	background: #fff !important;
	box-shadow: 0 10px 28px rgba(39,55,29,.07) !important;
	color: var(--bs-l3-ink) !important;
	font-size: clamp(1.25rem, 4vw, 1.75rem) !important;
	font-weight: 950 !important;
	line-height: 1 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-product div.product .summary > .price del {
	margin-right: 8px !important;
	color: var(--bs-l3-muted) !important;
	font-size: .72em !important;
	opacity: .7 !important;
}

html.bs-app-layer3-on body.bs-app-layer3-product div.product .summary > .price ins {
	color: var(--bs-l3-orange-dark) !important;
	text-decoration: none !important;
}

/* El formulario nativo se conserva para que el personalizador estable pueda moverlo al final. */
html.bs-app-layer3-on body.bs-app-layer3-product div.product .summary form.cart:not(.bs-basic-moved-cart-form) {
	margin-right: auto !important;
	margin-left: auto !important;
}

html.bs-app-layer3-on body.bs-app-layer3-product #bs-personalizador-basico {
	position: relative !important;
	z-index: 2 !important;
	width: min(1180px, calc(100vw - 12px)) !important;
	max-width: min(1180px, calc(100vw - 12px)) !important;
	margin-top: 12px !important;
	margin-bottom: max(24px, env(safe-area-inset-bottom)) !important;
}

html.bs-app-layer3-on body.bs-app-layer3-product .woocommerce-notices-wrapper,
html.bs-app-layer3-on body.bs-app-layer3-product .woocommerce-message,
html.bs-app-layer3-on body.bs-app-layer3-product .woocommerce-error {
	width: min(760px, calc(100vw - 20px)) !important;
	max-width: min(760px, calc(100vw - 20px)) !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

@media (max-width: 980px) {
	html.bs-app-layer3-on body.bs-app-layer3-category ul.products,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__products,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-product-template,
	html.bs-app-layer3-on body.bs-app-layer3-category .elementor-products-grid ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 700px) {
	html.bs-app-layer3-on body.bs-app-layer3-category .woocommerce,
	html.bs-app-layer3-on body.bs-app-layer3-category .ast-woocommerce-container,
	html.bs-app-layer3-on body.bs-app-layer3-category .site-main,
	html.bs-app-layer3-on body.bs-app-layer3-category .entry-content {
		width: calc(100vw - 10px) !important;
		max-width: calc(100vw - 10px) !important;
		padding-top: 7px !important;
	}

	html.bs-app-layer3-on body.bs-app-layer3-category ul.products,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__products,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-product-template,
	html.bs-app-layer3-on body.bs-app-layer3-category .elementor-products-grid ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 7px !important;
	}

	html.bs-app-layer3-on body.bs-app-layer3-category li.product,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-product {
		padding: 6px !important;
		border-radius: 19px !important;
	}

	html.bs-app-layer3-on body.bs-app-layer3-category li.product img,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product-image img,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-components-product-image img,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-product img {
		border-radius: 15px !important;
	}

	html.bs-app-layer3-on body.bs-app-layer3-category li.product .price,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-grid__product-price,
	html.bs-app-layer3-on body.bs-app-layer3-category .wc-block-components-product-price {
		margin-top: 7px !important;
		font-size: .91rem !important;
	}

	html.bs-app-layer3-on body.bs-app-layer3-product div.product .woocommerce-product-gallery {
		width: calc(100vw - 8px) !important;
		max-width: calc(100vw - 8px) !important;
		margin-top: 4px !important;
		padding: 5px !important;
		border-radius: 22px !important;
	}

	html.bs-app-layer3-on body.bs-app-layer3-product div.product .summary {
		width: calc(100vw - 10px) !important;
		max-width: calc(100vw - 10px) !important;
		padding-right: 5px !important;
		padding-left: 5px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	html.bs-app-layer3-on body.bs-app-layer3-capable *,
	html.bs-app-layer3-on body.bs-app-layer3-capable *::before,
	html.bs-app-layer3-on body.bs-app-layer3-capable *::after {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}
