/**
 * Deportes Eli — Ficha individual de producto (Fase 5.2)
 *
 * Solo se carga en is_product(). No afecta Home, Tienda ni archivos.
 * No altera galería JS, variaciones ni plantillas WooCommerce/Astra.
 */

/* -------------------------------------------------------------------------
   Scope + tokens
   ------------------------------------------------------------------------- */

body.single-product {
	--de-sp-navy: #0b1f3a;
	--de-sp-blue: #0755b5;
	--de-sp-blue-dark: #05448f;
	--de-sp-ink: #121212;
	--de-sp-muted: #5b6573;
	--de-sp-border: #e6ebf0;
	--de-sp-bg: #ffffff;
	--de-sp-bg-soft: #f4f6f8;
	--de-sp-radius: 8px;
	--de-sp-max: 1400px;
	--de-sp-gap: 2.5rem;
	--de-sp-font: "Inter", system-ui, -apple-system, sans-serif;
}

body.single-product .site-content,
body.single-product #content,
body.single-product #primary,
body.single-product .content-area,
body.single-product .ast-woocommerce-container,
body.single-product div.product {
	font-family: var(--de-sp-font);
	color: var(--de-sp-ink);
	box-sizing: border-box;
}

body.single-product #primary.content-area,
body.single-product .ast-container {
	max-width: var(--de-sp-max);
	width: 100%;
}

body.single-product #primary.content-area {
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.25rem;
	padding-right: 1.25rem;
}

/* -------------------------------------------------------------------------
   Layout principal: galería | resumen (~55 / 45)
   ------------------------------------------------------------------------- */

body.single-product div.product {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	column-gap: var(--de-sp-gap);
	row-gap: 2rem;
	max-width: var(--de-sp-max);
	margin-left: auto;
	margin-right: auto;
	width: 100%;
}

/* Sale badge: no interfiere en el flex */
body.single-product div.product > .ast-on-card-button,
body.single-product div.product > .onsale,
body.single-product div.product > span.onsale {
	position: absolute;
	z-index: 2;
}

body.single-product div.product {
	position: relative;
}

body.single-product div.product .woocommerce-product-gallery {
	float: none !important;
	width: calc(55% - (var(--de-sp-gap) / 2)) !important;
	max-width: 720px;
	margin: 0 !important;
	flex: 0 1 calc(55% - (var(--de-sp-gap) / 2));
}

body.single-product div.product .summary.entry-summary {
	float: none !important;
	width: calc(45% - (var(--de-sp-gap) / 2)) !important;
	max-width: 560px;
	margin: 0 !important;
	padding: 0.25rem 0 0;
	flex: 1 1 calc(45% - (var(--de-sp-gap) / 2));
}

/* Bloques a ancho completo bajo las columnas */
body.single-product div.product .woocommerce-tabs,
body.single-product div.product .related.products,
body.single-product div.product .up-sells,
body.single-product div.product .woocommerce-product-gallery ~ .clear,
body.single-product div.product > .woocommerce-noreviews,
body.single-product div.product .ast-woocommerce-container {
	flex: 0 0 100%;
	width: 100% !important;
	max-width: 100%;
}

/* -------------------------------------------------------------------------
   Galería — Fase 5.3 (FlexSlider / zoom / PhotoSwipe nativos)
   ------------------------------------------------------------------------- */

body.single-product {
	--de-sp-gallery-bg: #ffffff;
	--de-sp-gallery-soft: #f4f6f8;
	--de-sp-gallery-max: 620px;
	--de-sp-thumb: 64px;
}

body.single-product div.product .woocommerce-product-gallery {
	position: relative;
}

/* Escritorio: miniaturas verticales a la izquierda si hay 2+ fotos */
@media (min-width: 1025px) {
	body.single-product div.product .woocommerce-product-gallery--with-images:has(.flex-control-thumbs li:nth-child(2)) {
		display: grid;
		grid-template-columns: var(--de-sp-thumb) minmax(0, 1fr);
		column-gap: 0.75rem;
		align-items: start;
	}

	body.single-product div.product .woocommerce-product-gallery--with-images:has(.flex-control-thumbs li:nth-child(2)) .woocommerce-product-gallery__trigger {
		/* Absolute respecto a la galería: esquina superior derecha de la imagen */
		top: 0.75rem;
		right: 0.75rem;
		left: auto;
	}

	body.single-product div.product .woocommerce-product-gallery--with-images:has(.flex-control-thumbs li:nth-child(2)) .flex-viewport {
		grid-column: 2;
		grid-row: 1;
		width: 100% !important;
	}

	body.single-product div.product .woocommerce-product-gallery--with-images:has(.flex-control-thumbs li:nth-child(2)) .flex-control-thumbs {
		grid-column: 1;
		grid-row: 1;
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		margin: 0;
		max-height: var(--de-sp-gallery-max);
		overflow-x: hidden;
		overflow-y: auto;
		scrollbar-width: thin;
	}
}

/* Imagen principal (con FlexSlider) */
body.single-product .woocommerce-product-gallery .flex-viewport {
	background: var(--de-sp-gallery-bg);
	border: 1px solid var(--de-sp-border);
	border-radius: var(--de-sp-radius);
	overflow: hidden;
	aspect-ratio: 1 / 1;
	max-height: var(--de-sp-gallery-max);
	height: auto !important;
	width: 100%;
	box-sizing: border-box;
}

body.single-product .woocommerce-product-gallery__wrapper {
	background: var(--de-sp-gallery-bg);
}

/* Una sola imagen: WooCommerce no crea .flex-viewport */
body.single-product .woocommerce-product-gallery:not(:has(.flex-viewport)) > .woocommerce-product-gallery__wrapper {
	background: var(--de-sp-gallery-bg);
	border: 1px solid var(--de-sp-border);
	border-radius: var(--de-sp-radius);
	overflow: hidden;
	aspect-ratio: 1 / 1;
	max-height: var(--de-sp-gallery-max);
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

body.single-product .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__image {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

body.single-product .woocommerce-product-gallery__image {
	background: var(--de-sp-gallery-bg);
	text-align: center;
}

body.single-product .woocommerce-product-gallery__image a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: inherit;
	background: var(--de-sp-gallery-bg);
}

body.single-product .woocommerce-product-gallery__image img,
body.single-product .woocommerce-product-gallery .zoomImg {
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	max-height: var(--de-sp-gallery-max) !important;
	object-fit: contain !important;
	object-position: center;
	margin: 0 auto;
	display: block;
	background: var(--de-sp-gallery-bg);
}

/* Zoom de WooCommerce: mantener funcional, sin deformar */
body.single-product .woocommerce-product-gallery .zoomImg {
	max-height: none !important;
	background-color: var(--de-sp-gallery-bg);
}

/* Trigger lightbox — limpio, sin interferir con PhotoSwipe */
body.single-product .woocommerce-product-gallery__trigger {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92) !important;
	border: 1px solid var(--de-sp-border);
	box-shadow: 0 2px 8px rgba(11, 31, 58, 0.08);
	text-indent: 0 !important;
	font-size: 0 !important;
	line-height: 0 !important;
	overflow: hidden;
	z-index: 3;
}

body.single-product .woocommerce-product-gallery__trigger img,
body.single-product .woocommerce-product-gallery__trigger .emoji {
	display: none !important;
}

body.single-product .woocommerce-product-gallery__trigger::before {
	content: "";
	display: block;
	width: 1rem;
	height: 1rem;
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230b1f3a' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath stroke-linecap='round' d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

body.single-product .woocommerce-product-gallery__trigger:hover,
body.single-product .woocommerce-product-gallery__trigger:focus {
	background: #fff !important;
	border-color: var(--de-sp-navy);
	outline: none;
	box-shadow: 0 0 0 3px rgba(7, 85, 181, 0.15);
}

/* Miniaturas (por defecto debajo; en desktop con :has pasan a columna) */
body.single-product .woocommerce-product-gallery .flex-control-thumbs {
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li {
	float: none !important;
	width: var(--de-sp-thumb) !important;
	height: var(--de-sp-thumb);
	margin: 0 !important;
	padding: 0;
	flex: 0 0 var(--de-sp-thumb);
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li img {
	box-sizing: border-box;
	width: 100% !important;
	height: 100% !important;
	object-fit: contain;
	object-position: center;
	background: var(--de-sp-gallery-bg);
	border: 1px solid var(--de-sp-border);
	border-radius: 6px;
	opacity: 1;
	cursor: pointer;
	padding: 2px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li img:hover {
	border-color: #c9d4e0;
	opacity: 1;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li img.flex-active {
	border-color: var(--de-sp-navy);
	border-width: 2px;
	padding: 1px;
	box-shadow: 0 0 0 1px var(--de-sp-navy);
	opacity: 1;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li img:focus {
	outline: none;
	border-color: var(--de-sp-blue);
	box-shadow: 0 0 0 3px rgba(7, 85, 181, 0.2);
}

/* Producto con una sola imagen: sin hueco de thumbs */
body.single-product .woocommerce-product-gallery:not(:has(.flex-control-thumbs li)) .flex-viewport,
body.single-product .woocommerce-product-gallery .flex-control-thumbs:empty {
	margin-top: 0;
}

/* -------------------------------------------------------------------------
   Información del producto
   ------------------------------------------------------------------------- */

body.single-product .summary .woocommerce-breadcrumb {
	font-size: 0.75rem;
	line-height: 1.4;
	letter-spacing: 0.01em;
	color: var(--de-sp-muted);
	margin: 0 0 0.75rem;
	padding: 0;
}

body.single-product .summary .woocommerce-breadcrumb a {
	color: var(--de-sp-muted);
	text-decoration: none;
}

body.single-product .summary .woocommerce-breadcrumb a:hover {
	color: var(--de-sp-blue);
}

body.single-product .summary .single-product-category,
body.single-product .summary .single-product-category a {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--de-sp-muted);
	text-decoration: none;
	margin: 0 0 0.5rem;
}

body.single-product .summary .single-product-category a:hover {
	color: var(--de-sp-blue);
}

body.single-product .summary .product_title.entry-title {
	font-family: var(--de-sp-font);
	font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.875rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--de-sp-navy);
	margin: 0 0 0.85rem;
	text-transform: none;
}

body.single-product .summary > .price,
body.single-product .summary .woocommerce-variation-price .price {
	font-family: var(--de-sp-font);
	font-size: 1.375rem;
	font-weight: 700;
	color: var(--de-sp-navy);
	margin: 0 0 1rem;
	line-height: 1.3;
}

body.single-product .summary .price del {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--de-sp-muted);
	opacity: 0.9;
	margin-right: 0.4rem;
}

body.single-product .summary .price ins {
	text-decoration: none;
	color: var(--de-sp-blue);
	font-weight: 700;
}

body.single-product .summary .woocommerce-product-details__short-description {
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--de-sp-ink);
	margin: 0 0 1.25rem;
	max-width: 42em;
}

body.single-product .summary .woocommerce-product-details__short-description p {
	margin: 0 0 0.5rem;
}

body.single-product .summary .ast-stock-detail,
body.single-product .summary .stock,
body.single-product .summary .woocommerce-variation-availability {
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--de-sp-muted);
	margin: 0 0 1.25rem;
	padding: 0;
	background: none;
	border: none;
}

body.single-product .summary .stock.in-stock,
body.single-product .summary .ast-stock-detail {
	color: #2d6a4f;
}

body.single-product .summary .stock.out-of-stock {
	color: #9b2226;
}

/* Meta (SKU / categoría / marca) */
body.single-product .summary .product_meta {
	font-size: 0.8125rem;
	line-height: 1.6;
	color: var(--de-sp-muted);
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--de-sp-border);
}

body.single-product .summary .product_meta > span {
	display: block;
	margin-bottom: 0.25rem;
}

body.single-product .summary .product_meta a {
	color: var(--de-sp-navy);
	text-decoration: none;
}

body.single-product .summary .product_meta a:hover {
	color: var(--de-sp-blue);
}

/* -------------------------------------------------------------------------
   Variaciones — selects nativos mejorados (sin sustituir)
   ------------------------------------------------------------------------- */

body.single-product .summary table.variations {
	width: 100%;
	margin: 0 0 1.25rem;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
}

body.single-product .summary table.variations tbody,
body.single-product .summary table.variations tr,
body.single-product .summary table.variations th,
body.single-product .summary table.variations td {
	border: 0;
	background: transparent;
	padding: 0;
	vertical-align: middle;
}

body.single-product .summary table.variations tr {
	display: block;
	margin-bottom: 1rem;
}

body.single-product .summary table.variations th.label {
	display: block;
	width: 100%;
	padding: 0 0 0.4rem;
	text-align: left;
}

body.single-product .summary table.variations th.label label {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--de-sp-navy);
}

body.single-product .summary table.variations td.value {
	display: block;
	width: 100%;
	position: relative;
}

body.single-product .summary table.variations select {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	max-width: 100%;
	height: 48px;
	padding: 0 2.5rem 0 0.875rem;
	font-family: var(--de-sp-font);
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--de-sp-navy);
	background-color: var(--de-sp-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230b1f3a' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.875rem center;
	background-size: 12px 8px;
	border: 1px solid var(--de-sp-border);
	border-radius: var(--de-sp-radius);
	box-shadow: none;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.single-product .summary table.variations select:hover {
	border-color: #c9d4e0;
}

body.single-product .summary table.variations select:focus {
	outline: none;
	border-color: var(--de-sp-blue);
	box-shadow: 0 0 0 3px rgba(7, 85, 181, 0.15);
}

body.single-product .summary .reset_variations {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--de-sp-blue);
	text-decoration: none;
}

body.single-product .summary .reset_variations:hover {
	text-decoration: underline;
}

/* -------------------------------------------------------------------------
   Cantidad + Añadir al carrito
   ------------------------------------------------------------------------- */

body.single-product .summary form.cart,
body.single-product .summary form.variations_form {
	margin: 0;
}

body.single-product .summary .single_variation_wrap {
	margin-top: 0.25rem;
}

body.single-product .summary form.cart .woocommerce-variation-add-to-cart,
body.single-product .summary form.cart:not(.variations_form) {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 0.75rem;
}

body.single-product .summary form.cart .quantity {
	display: inline-flex;
	align-items: center;
	margin: 0;
	float: none !important;
}

body.single-product .summary form.cart .quantity .qty,
body.single-product .summary form.cart input.qty {
	width: 4.5rem;
	min-width: 4.5rem;
	height: 50px;
	padding: 0 0.5rem;
	font-family: var(--de-sp-font);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--de-sp-navy);
	text-align: center;
	background: var(--de-sp-bg);
	border: 1px solid var(--de-sp-border);
	border-radius: var(--de-sp-radius);
	box-shadow: none;
}

body.single-product .summary form.cart .quantity .qty:focus {
	outline: none;
	border-color: var(--de-sp-blue);
	box-shadow: 0 0 0 3px rgba(7, 85, 181, 0.15);
}

/* Botones +/- de Astra si existen */
body.single-product .summary form.cart .quantity .ast-qty-plus,
body.single-product .summary form.cart .quantity .ast-qty-minus,
body.single-product .summary form.cart .quantity button {
	height: 50px;
	border-color: var(--de-sp-border);
	border-radius: var(--de-sp-radius);
	color: var(--de-sp-navy);
	background: var(--de-sp-bg-soft);
}

body.single-product.woocommerce-js div.product .summary form.cart .button.single_add_to_cart_button,
body.single-product .summary form.cart .single_add_to_cart_button,
body.single-product .summary form.cart button.single_add_to_cart_button {
	flex: 1 1 12rem;
	min-width: min(100%, 12rem);
	box-sizing: border-box;
	height: 50px !important;
	min-height: 50px !important;
	max-height: 50px !important;
	padding: 0 1.5rem !important;
	margin: 0 !important;
	font-family: var(--de-sp-font);
	font-size: 0.9375rem !important;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 50px !important;
	white-space: nowrap;
	color: #fff !important;
	background-color: var(--de-sp-navy) !important;
	border: none !important;
	border-radius: var(--de-sp-radius) !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

body.single-product .summary form.cart .single_add_to_cart_button:hover,
body.single-product .summary form.cart .single_add_to_cart_button:focus {
	background-color: var(--de-sp-blue) !important;
	color: #fff !important;
}

body.single-product .summary form.cart .single_add_to_cart_button.disabled,
body.single-product .summary form.cart .single_add_to_cart_button:disabled,
body.single-product .summary form.cart .single_add_to_cart_button.wc-variation-selection-needed,
body.single-product .summary form.cart .single_add_to_cart_button.wc-variation-is-unavailable {
	opacity: 0.45;
	cursor: not-allowed;
	background-color: var(--de-sp-navy) !important;
}

body.single-product .summary form.cart .single_add_to_cart_button.disabled:hover,
body.single-product .summary form.cart .single_add_to_cart_button.wc-variation-selection-needed:hover {
	background-color: var(--de-sp-navy) !important;
}

/* Mensajes WooCommerce */
body.single-product .woocommerce-message,
body.single-product .woocommerce-info,
body.single-product .woocommerce-error {
	border-radius: var(--de-sp-radius);
	border-color: var(--de-sp-border);
	font-family: var(--de-sp-font);
	font-size: 0.875rem;
}

body.single-product .woocommerce-message {
	border-top-color: var(--de-sp-blue);
}

/* -------------------------------------------------------------------------
   Pestañas Descripción / Información adicional (Fase 5.5)
   ------------------------------------------------------------------------- */

body.single-product .woocommerce-tabs {
	margin-top: 2rem;
	margin-bottom: 2rem !important;
	padding-top: 1.5rem;
	padding-bottom: 0;
	border-top: 1px solid var(--de-sp-border);
	clear: both;
}

body.single-product .woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 0 1.5rem;
	padding: 0;
	margin: 0 0 1.35rem;
	list-style: none;
	border: 0;
	border-bottom: 1px solid var(--de-sp-border);
	overflow: visible !important;
	background: transparent;
}

/* Anular decoración nativa Woo (::before / ::after) */
body.single-product .woocommerce-tabs ul.tabs::before,
body.single-product .woocommerce-tabs ul.tabs::after {
	display: none !important;
	content: none !important;
}

body.single-product .woocommerce-tabs ul.tabs li {
	position: relative;
	display: block;
	float: none;
	border: 0 !important;
	border-radius: 0;
	background: transparent !important;
	margin: 0;
	padding: 0;
	box-shadow: none !important;
}

body.single-product .woocommerce-tabs ul.tabs li::before,
body.single-product .woocommerce-tabs ul.tabs li::after {
	display: none !important;
	content: none !important;
}

body.single-product .woocommerce-tabs ul.tabs li a {
	display: inline-block;
	font-family: var(--de-sp-font);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--de-sp-muted) !important;
	padding: 0.7rem 0 0.85rem;
	margin: 0;
	border: 0;
	border-bottom: 2px solid transparent;
	background: transparent;
	text-decoration: none;
	line-height: 1.3;
	transition: color 0.18s ease, border-color 0.18s ease;
}

body.single-product .woocommerce-tabs ul.tabs li.active a,
body.single-product .woocommerce-tabs ul.tabs li a:hover,
body.single-product .woocommerce-tabs ul.tabs li a:focus {
	color: var(--de-sp-navy) !important;
	border-bottom-color: var(--de-sp-navy);
}

body.single-product .woocommerce-tabs .panel,
body.single-product .woocommerce-tabs .woocommerce-Tabs-panel {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	font-family: var(--de-sp-font);
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--de-sp-ink);
	max-width: 42rem; /* ~672px — evita líneas excesivamente largas */
}

body.single-product .woocommerce-tabs .panel > h2:first-child,
body.single-product .woocommerce-tabs .woocommerce-Tabs-panel > h2:first-child {
	/* Título duplicado accesible; visualmente sobra junto a la pestaña */
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

body.single-product .woocommerce-tabs .panel p,
body.single-product .woocommerce-tabs .woocommerce-Tabs-panel p {
	margin: 0 0 1rem;
	font-family: var(--de-sp-font);
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

body.single-product .woocommerce-tabs .panel p:last-child,
body.single-product .woocommerce-tabs .woocommerce-Tabs-panel p:last-child {
	margin-bottom: 0;
}

/* Tabla Información adicional */
body.single-product .woocommerce-tabs table.shop_attributes,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes {
	width: 100%;
	max-width: 36rem;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-family: var(--de-sp-font);
}

body.single-product .woocommerce-tabs table.shop_attributes th,
body.single-product .woocommerce-tabs table.shop_attributes td,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes th,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes td {
	padding: 0.85rem 0;
	border: 0;
	border-bottom: 1px solid var(--de-sp-border);
	background: transparent !important;
	vertical-align: top;
	text-align: left;
	font-style: normal;
	line-height: 1.5;
}

body.single-product .woocommerce-tabs table.shop_attributes tr:last-child th,
body.single-product .woocommerce-tabs table.shop_attributes tr:last-child td,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes tr:last-child th,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes tr:last-child td {
	border-bottom: 0;
}

body.single-product .woocommerce-tabs table.shop_attributes th,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes th {
	width: 34%;
	min-width: 5.5rem;
	padding-right: 1.25rem;
	font-weight: 600;
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--de-sp-muted);
}

body.single-product .woocommerce-tabs table.shop_attributes td,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes td,
body.single-product .woocommerce-tabs table.shop_attributes td p,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes td p {
	margin: 0;
	font-weight: 500;
	font-size: 0.9375rem;
	color: var(--de-sp-ink);
}

body.single-product .woocommerce-tabs table.shop_attributes td a,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes td a {
	color: var(--de-sp-navy);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 0.18s ease, color 0.18s ease;
}

body.single-product .woocommerce-tabs table.shop_attributes td a:hover,
body.single-product .woocommerce-tabs table.woocommerce-product-attributes td a:hover {
	color: var(--de-sp-blue);
	border-bottom-color: var(--de-sp-blue);
}

/* -------------------------------------------------------------------------
   Relacionados — título + separación (tarjetas en bloque 5.4)
   ------------------------------------------------------------------------- */

body.single-product .related.products,
body.single-product .up-sells {
	margin-top: 0.25rem;
	margin-bottom: 2rem;
	padding-top: 0.15rem;
}

body.single-product .related.products > h2,
body.single-product .up-sells > h2 {
	font-family: var(--de-sp-font);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--de-sp-navy);
	margin: 0 0 1.25rem;
}

/* -------------------------------------------------------------------------
   Productos relacionados — mismo lenguaje visual que Tienda (Fase 5.4)
   Ámbito: solo .related.products / .up-sells en ficha individual.
   ------------------------------------------------------------------------- */

body.single-product .related.products ul.products,
body.single-product .up-sells ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.35rem;
	margin: 0 0 0.5rem !important;
	padding: 0 !important;
	width: 100%;
	max-width: 100%;
	list-style: none;
	box-sizing: border-box;
}

body.single-product .related.products ul.products::before,
body.single-product .related.products ul.products::after,
body.single-product .up-sells ul.products::before,
body.single-product .up-sells ul.products::after {
	display: none !important;
	content: none !important;
}

body.single-product .related.products ul.products li.product,
body.single-product .up-sells ul.products li.product {
	float: none !important;
	clear: none !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid var(--de-sp-border);
	border-radius: var(--de-sp-radius);
	overflow: hidden;
	box-sizing: border-box;
	text-align: left;
	transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

@media (hover: hover) and (pointer: fine) {
	body.single-product .related.products ul.products li.product:hover,
	body.single-product .up-sells ul.products li.product:hover {
		border-color: #c9d4e0;
		box-shadow: 0 8px 24px rgba(11, 31, 58, 0.08);
	}
}

/* Imagen 1:1 contain */
body.single-product .related.products ul.products li.product .astra-shop-thumbnail-wrap,
body.single-product .up-sells ul.products li.product .astra-shop-thumbnail-wrap {
	position: relative;
	margin: 0;
	aspect-ratio: 1 / 1;
	background: var(--de-sp-bg-soft, #f4f6f8);
	overflow: hidden;
}

body.single-product .related.products ul.products li.product .astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link,
body.single-product .up-sells ul.products li.product .astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 0;
	padding: 0.75rem;
	box-sizing: border-box;
}

body.single-product .related.products ul.products li.product .astra-shop-thumbnail-wrap img,
body.single-product .up-sells ul.products li.product .astra-shop-thumbnail-wrap img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100%;
	max-height: 100%;
	margin: 0 !important;
	object-fit: contain !important;
	object-position: center center;
}

/* Oferta */
body.single-product .related.products ul.products li.product .ast-onsale-card,
body.single-product .related.products ul.products li.product span.onsale,
body.single-product .up-sells ul.products li.product .ast-onsale-card,
body.single-product .up-sells ul.products li.product span.onsale {
	position: absolute;
	top: 0.65rem;
	left: 0.65rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	min-width: 0;
	padding: 0.28rem 0.55rem;
	border: 0;
	border-radius: 999px;
	background: var(--de-sp-navy) !important;
	color: #fff !important;
	font-family: var(--de-sp-font);
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
	box-shadow: none;
}

/* Icono on-card: solo hover desktop; oculto en touch/móvil */
body.single-product .related.products ul.products li.product .ast-select-options-trigger,
body.single-product .related.products ul.products li.product .ast-on-card-button.ast-select-options-trigger,
body.single-product .up-sells ul.products li.product .ast-select-options-trigger,
body.single-product .up-sells ul.products li.product .ast-on-card-button.ast-select-options-trigger {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
	body.single-product .related.products ul.products li.product:hover .ast-select-options-trigger,
	body.single-product .up-sells ul.products li.product:hover .ast-select-options-trigger {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}
}

@media (max-width: 921px) {
	body.single-product .related.products ul.products li.product .ast-select-options-trigger,
	body.single-product .related.products ul.products li.product .ast-on-card-button.ast-select-options-trigger,
	body.single-product .up-sells ul.products li.product .ast-select-options-trigger,
	body.single-product .up-sells ul.products li.product .ast-on-card-button.ast-select-options-trigger {
		display: none !important;
	}
}

body.single-product .related.products ul.products li.product .ast-card-action-tooltip,
body.single-product .up-sells ul.products li.product .ast-card-action-tooltip {
	display: none !important;
}

/* Resumen */
body.single-product .related.products ul.products li.product .astra-shop-summary-wrap,
body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 0.35rem;
	padding: 0.85rem 0.9rem 1rem;
	box-sizing: border-box;
}

body.single-product .related.products ul.products li.product .ast-woo-product-category,
body.single-product .up-sells ul.products li.product .ast-woo-product-category {
	display: block;
	margin: 0;
	font-family: var(--de-sp-font);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--de-sp-muted);
	line-height: 1.3;
}

body.single-product .related.products ul.products li.product .woocommerce-loop-product__title,
body.single-product .up-sells ul.products li.product .woocommerce-loop-product__title {
	margin: 0;
	padding: 0;
	font-family: var(--de-sp-font);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.35 !important;
	letter-spacing: 0;
	color: var(--de-sp-navy);
	text-transform: none;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	min-height: calc(1.35em * 2);
}

body.single-product .related.products ul.products li.product .woocommerce-loop-product__title a,
body.single-product .related.products ul.products li.product a.ast-loop-product__link,
body.single-product .up-sells ul.products li.product .woocommerce-loop-product__title a,
body.single-product .up-sells ul.products li.product a.ast-loop-product__link {
	color: inherit;
	text-decoration: none;
}

body.single-product .related.products ul.products li.product .price,
body.single-product .up-sells ul.products li.product .price {
	display: block;
	margin: 0.15rem 0 0.4rem;
	font-family: var(--de-sp-font);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3 !important;
	color: var(--de-sp-ink);
}

body.single-product .related.products ul.products li.product .price del,
body.single-product .up-sells ul.products li.product .price del {
	font-size: 0.85em;
	font-weight: 500;
	color: var(--de-sp-muted);
	opacity: 0.9;
}

body.single-product .related.products ul.products li.product .price ins,
body.single-product .up-sells ul.products li.product .price ins {
	text-decoration: none;
	color: var(--de-sp-navy);
	font-weight: 700;
}

/* CTA al fondo de la tarjeta */
body.single-product .related.products ul.products li.product .astra-shop-summary-wrap > .button,
body.single-product .related.products ul.products li.product .astra-shop-summary-wrap > a.button,
body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap > .button,
body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap > a.button {
	margin-top: auto;
}

body.single-product .related.products ul.products li.product .astra-shop-summary-wrap .button,
body.single-product .related.products ul.products li.product .astra-shop-summary-wrap a.button,
body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap .button,
body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap a.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	width: 100%;
	max-width: 100%;
	min-height: 2.65rem;
	margin-left: 0;
	margin-right: 0;
	margin-bottom: 0;
	padding: 0.65rem 0.85rem;
	box-sizing: border-box;
	border: 1px solid var(--de-sp-navy) !important;
	border-radius: var(--de-sp-radius) !important;
	background: var(--de-sp-navy) !important;
	color: #fff !important;
	font-family: var(--de-sp-font);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	line-height: 1.2;
	white-space: normal;
	transition: background-color 0.22s ease, border-color 0.22s ease;
}

@media (hover: hover) and (pointer: fine) {
	body.single-product .related.products ul.products li.product .astra-shop-summary-wrap .button:hover,
	body.single-product .related.products ul.products li.product .astra-shop-summary-wrap a.button:hover,
	body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap .button:hover,
	body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap a.button:hover {
		background: var(--de-sp-blue) !important;
		border-color: var(--de-sp-blue) !important;
		color: #fff !important;
	}
}

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

@media (max-width: 1440px) {
	body.single-product {
		--de-sp-gap: 2rem;
	}
}

@media (max-width: 1024px) {
	body.single-product {
		--de-sp-gap: 1.5rem;
		--de-sp-gallery-max: 520px;
		--de-sp-thumb: 56px;
	}

	body.single-product div.product .woocommerce-product-gallery {
		width: calc(52% - (var(--de-sp-gap) / 2)) !important;
		flex-basis: calc(52% - (var(--de-sp-gap) / 2));
		max-width: none;
	}

	body.single-product div.product .summary.entry-summary {
		width: calc(48% - (var(--de-sp-gap) / 2)) !important;
		flex-basis: calc(48% - (var(--de-sp-gap) / 2));
		max-width: none;
	}

	body.single-product .summary .product_title.entry-title {
		font-size: 1.375rem;
	}

	/* Tablet: miniaturas debajo (sin columna vertical) */
	body.single-product .woocommerce-product-gallery .flex-control-thumbs {
		flex-direction: row;
		flex-wrap: wrap;
		max-height: none;
		overflow: visible;
		margin-top: 0.75rem;
	}

	/* Relacionados: 3 columnas en tablet ancha */
	body.single-product .related.products ul.products,
	body.single-product .up-sells ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1.1rem;
	}
}

@media (max-width: 921px) {
	body.single-product .related.products ul.products,
	body.single-product .up-sells ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1rem;
	}
}

@media (max-width: 768px) {
	body.single-product {
		--de-sp-gallery-max: none;
		--de-sp-thumb: 56px;
	}

	body.single-product #primary.content-area {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	body.single-product div.product .woocommerce-product-gallery,
	body.single-product div.product .summary.entry-summary {
		width: 100% !important;
		flex: 0 0 100%;
		max-width: 100%;
	}

	body.single-product .woocommerce-product-gallery .flex-viewport {
		max-height: none;
		aspect-ratio: 1 / 1;
	}

	body.single-product .woocommerce-product-gallery__image img {
		max-height: none !important;
	}

	body.single-product .summary form.cart .woocommerce-variation-add-to-cart,
	body.single-product .summary form.cart:not(.variations_form) {
		flex-direction: row;
	}

	body.single-product .summary form.cart .single_add_to_cart_button {
		flex: 1 1 auto;
		min-width: 0;
		width: auto;
	}

	body.single-product .woocommerce-tabs {
		margin-top: 1.5rem;
		margin-bottom: 1.75rem !important;
		padding-top: 1.25rem;
	}

	body.single-product .woocommerce-tabs ul.tabs {
		gap: 0 1.1rem;
		margin-bottom: 1.1rem;
	}

	body.single-product .woocommerce-tabs ul.tabs li a {
		font-size: 0.8125rem;
		padding: 0.6rem 0 0.75rem;
	}

	body.single-product .woocommerce-tabs .panel,
	body.single-product .woocommerce-tabs .woocommerce-Tabs-panel {
		max-width: 100%;
		font-size: 0.9rem;
		line-height: 1.65;
	}

	body.single-product .related.products,
	body.single-product .up-sells {
		margin-bottom: 2rem;
	}

	/* Relacionados: 2 columnas en tablet/móvil */
	body.single-product .related.products ul.products,
	body.single-product .up-sells ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.85rem;
	}

	body.single-product .related.products ul.products li.product .astra-shop-summary-wrap,
	body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap {
		padding: 0.7rem 0.7rem 0.85rem;
	}

	body.single-product .related.products ul.products li.product .woocommerce-loop-product__title,
	body.single-product .up-sells ul.products li.product .woocommerce-loop-product__title {
		font-size: 0.8125rem;
	}

	body.single-product .related.products ul.products li.product .price,
	body.single-product .up-sells ul.products li.product .price {
		font-size: 0.9rem;
	}

	/* CTA legible en 2 columnas: 2 líneas OK, tap ≥44px (px fijos: Astra escala rem) */
	body.single-product .related.products ul.products li.product .astra-shop-summary-wrap .button,
	body.single-product .related.products ul.products li.product .astra-shop-summary-wrap a.button,
	body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap .button,
	body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap a.button {
		min-height: 44px;
		padding: 8px 6px;
		font-size: 11px;
		letter-spacing: 0.02em;
		line-height: 1.25;
		white-space: normal;
		hyphens: none;
	}
}

@media (max-width: 480px) {
	body.single-product {
		--de-sp-gap: 1.25rem;
		--de-sp-thumb: 52px;
	}

	body.single-product .summary form.cart .woocommerce-variation-add-to-cart,
	body.single-product .summary form.cart:not(.variations_form) {
		flex-direction: column;
		align-items: stretch;
	}

	body.single-product .summary form.cart .quantity {
		width: 100%;
		max-width: 8rem;
	}

	body.single-product .summary form.cart .quantity .qty,
	body.single-product .summary form.cart input.qty {
		width: 100%;
		min-width: 0;
	}

	body.single-product.woocommerce-js div.product .summary form.cart .button.single_add_to_cart_button,
	body.single-product .summary form.cart .single_add_to_cart_button {
		width: 100%;
		flex: 0 0 auto;
		min-width: 100%;
		height: 50px !important;
		max-height: 50px !important;
		line-height: 50px !important;
	}

	body.single-product .woocommerce-product-gallery .flex-control-thumbs {
		gap: 0.4rem;
	}

	body.single-product .woocommerce-tabs {
		margin-top: 1.25rem;
		margin-bottom: 1.5rem !important;
		padding-top: 1.1rem;
	}

	body.single-product .woocommerce-tabs ul.tabs {
		gap: 0 0.85rem;
		width: 100%;
	}

	body.single-product .woocommerce-tabs ul.tabs li a {
		font-size: 0.8125rem;
		padding: 0.55rem 0 0.7rem;
	}

	body.single-product .woocommerce-tabs table.shop_attributes th,
	body.single-product .woocommerce-tabs table.woocommerce-product-attributes th {
		width: 32%;
		font-size: 0.75rem;
		padding-right: 0.75rem;
	}

	body.single-product .woocommerce-tabs table.shop_attributes td,
	body.single-product .woocommerce-tabs table.woocommerce-product-attributes td {
		font-size: 0.875rem;
	}

	body.single-product .related.products,
	body.single-product .up-sells {
		margin-bottom: 1.75rem;
	}

	body.single-product .related.products ul.products,
	body.single-product .up-sells ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.65rem;
	}

	body.single-product .related.products ul.products li.product .astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link,
	body.single-product .up-sells ul.products li.product .astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link {
		padding: 0.5rem;
	}

	body.single-product .related.products ul.products li.product .astra-shop-summary-wrap,
	body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap {
		padding: 0.55rem 0.5rem 0.65rem;
		gap: 0.25rem;
	}

	body.single-product .related.products > h2,
	body.single-product .up-sells > h2 {
		font-size: 1.1rem;
		margin-bottom: 1rem;
	}

	/* 390px: «Seleccionar opciones» en 2 líneas, tap ≥44px, sin overflow */
	body.single-product .related.products ul.products li.product .astra-shop-summary-wrap .button,
	body.single-product .related.products ul.products li.product .astra-shop-summary-wrap a.button,
	body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap .button,
	body.single-product .up-sells ul.products li.product .astra-shop-summary-wrap a.button {
		min-height: 46px;
		padding: 8px 4px;
		font-size: 11px;
		letter-spacing: 0.01em;
		line-height: 1.2;
	}
}
