/* XWhite — ficha producto: specs + se compran juntos + cart overrides */

:root {
	--xw-pdp-text: #111315;
	--xw-pdp-muted: #7b8285;
	--xw-pdp-soft: #4a5154;
	--xw-pdp-brand: #23A3B6;
	--xw-pdp-border: #eceeef;
	--xw-pdp-border-strong: #dde1e2;
	--xw-pdp-track: #eceeef;
	--xw-pdp-bg: #f6f7f7;
	--xw-pdp-qty-bg: #f3f4f5;
}

/* ========== Galería PDP ========== */

.xw-gallery {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	gap: 16px;
	align-items: start;
	width: 100%;
	position: sticky;
	top: 104px;
}

.xw-gallery__thumbs {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.xw-gallery__thumb {
	display: block;
	width: 88px;
	height: 88px;
	padding: 0 !important;
	margin: 0;
	border: 1px solid #e4e7e8 !important;
	border-radius: 10px !important;
	background: #f3f4f5;
	overflow: hidden;
	cursor: pointer !important;
	flex: 0 0 auto;
	transition: border-color 0.2s ease, border-width 0.2s ease;
}

.xw-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.xw-gallery__thumb.is-active {
	border: 2px solid var(--xw-pdp-text);
}

.xw-gallery__thumb:hover:not(.is-active),
.xw-gallery__thumb:focus-visible {
	border-color: var(--xw-pdp-brand);
	outline: none;
}

.xw-gallery__stage {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: 16px;
	overflow: hidden;
	background: #f3f4f5;
}

.xw-gallery__main {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.15s ease;
}

.xw-gallery__main.is-fading {
	opacity: 0.35;
}

.xw-gallery__badges {
	position: absolute;
	top: 16px;
	left: 16px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	z-index: 2;
	pointer-events: none;
}

.xw-gallery__badge {
	background: var(--xw-pdp-text);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 7px 11px;
	border-radius: 6px;
	line-height: 1.2;
}

.xw-gallery__badge--accent {
	background: #e01b24;
}

@media (max-width: 960px) {
	.xw-gallery {
		position: static;
		grid-template-columns: 1fr;
		grid-template-rows: auto auto;
		gap: 14px;
	}

	.xw-gallery__thumbs {
		order: 2;
		flex-direction: row;
		overflow-x: auto;
		scrollbar-width: thin;
		padding-bottom: 2px;
	}

	.xw-gallery__stage {
		order: 1;
	}

	.xw-gallery__thumb {
		width: 72px;
		height: 72px;
	}
}

/* ========== Add to cart (ficha) ========== */

.woocommerce .custom-cart.xw-pdp-cart .custom-add-to-cart,
.woocommerce .xw-pdp-cart .custom-add-to-cart {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* Select de productos: oculto (código PHP intacto) */
.woocommerce .xw-pdp-cart .related-products-select {
	display: none !important;
}

.woocommerce .xw-pdp-cart .xw-pdp-cart__price {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.woocommerce .xw-pdp-cart .custom-price,
.xw-pdp-price-mobile .custom-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px;
}

.woocommerce .xw-pdp-cart .custom-price .woocommerce-Price-amount,
.xw-pdp-price-mobile .custom-price .woocommerce-Price-amount,
.woocommerce .xw-pdp-cart .custom-price .sale-price .woocommerce-Price-amount,
.xw-pdp-price-mobile .custom-price .sale-price .woocommerce-Price-amount {
	font-size: 32px !important;
	font-weight: 800 !important;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: var(--xw-pdp-text);
	-webkit-text-fill-color: var(--xw-pdp-text);
}

.woocommerce .xw-pdp-cart .custom-price del,
.xw-pdp-price-mobile .custom-price del {
	font-size: 16px;
	color: var(--xw-pdp-muted);
}

.woocommerce .xw-pdp-cart .custom-price .iva-text,
.xw-pdp-price-mobile .custom-price .iva-text {
	font-size: 14px;
	font-weight: 500;
	color: var(--xw-pdp-muted);
	margin-left: 0;
	flex-basis: 100%;
}

.woocommerce .xw-pdp-cart .discount-badge,
.xw-pdp-price-mobile .discount-badge {
	border-radius: 999px;
	padding: 4px 10px;
	background: #e01b24;
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: none;
}

.woocommerce .xw-pdp-cart .discount-saving,
.xw-pdp-price-mobile .discount-saving {
	margin-top: 0;
	font-size: 13px;
	font-weight: 700;
	color: #e01b24;
}

.woocommerce .xw-pdp-cart .xw-pdp-cart__actions,
.woocommerce .xw-pdp-cart .xw-pdp-cart__actions.custom-quantity-related {
	display: flex;
	align-items: stretch;
	gap: 12px;
	flex-direction: row;
}

/* Selector cantidad — píldora mockup */
.woocommerce .xw-pdp-cart .custom-quantity,
.woocommerce .xw-pdp-cart .custom-quantity-related .custom-quantity {
	flex: 0 0 auto;
}

.woocommerce .xw-pdp-cart .custom-quantity .quantity,
.woocommerce .xw-pdp-cart .custom-quantity-related .custom-quantity .quantity {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 6px;
	height: 52px;
	border: 1px solid #dde1e2;
	border-radius: 999px;
	background: #fff;
	box-sizing: border-box;
}

.woocommerce .xw-pdp-cart .custom-quantity .quantity .qty-btn,
.woocommerce .xw-pdp-cart .custom-quantity-related .custom-quantity .quantity .qty-btn {
	width: 40px;
	height: 40px;
	min-width: 40px;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none !important;
	border-radius: 50% !important;
	background: #f3f4f5 !important;
	color: #111315 !important;
	box-shadow: none !important;
	cursor: pointer;
	line-height: 1;
	transition: background 0.2s ease, color 0.2s ease;
}

.woocommerce .xw-pdp-cart .custom-quantity .quantity .qty-btn:hover,
.woocommerce .xw-pdp-cart .custom-quantity-related .custom-quantity .quantity .qty-btn:hover {
	background: #111315 !important;
	color: #fff !important;
}

.woocommerce .xw-pdp-cart .custom-quantity .quantity .qty-btn:disabled,
.woocommerce .xw-pdp-cart .custom-quantity-related .custom-quantity .quantity .qty-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
	background: #f3f4f5 !important;
	color: #111315 !important;
}

.woocommerce .xw-pdp-cart .custom-quantity .quantity .qty-btn svg,
.woocommerce .xw-pdp-cart .custom-quantity-related .custom-quantity .quantity .qty-btn svg {
	width: 14px;
	height: 14px;
	display: block;
}

.woocommerce .xw-pdp-cart .custom-quantity .quantity .qty,
.woocommerce .xw-pdp-cart .custom-quantity-related .custom-quantity .quantity .qty {
	min-width: 28px;
	width: 2.5ch !important;
	height: auto;
	border: none !important;
	border-radius: 0;
	background: transparent !important;
	font-size: 16px;
	font-weight: 700;
	text-align: center;
	color: #111315;
	padding: 0 !important;
	margin: 0;
	box-shadow: none !important;
	appearance: textfield;
	-moz-appearance: textfield;
}

.woocommerce div.product .xw-pdp-cart .single_add_to_cart_button {
	flex: 1;
	min-height: 52px;
	height: 52px;
	padding: 0 24px;
	border: none !important;
	border-radius: 999px !important;
	background: #111315 !important;
	color: #fff !important;
	font-size: 16px;
	font-weight: 800;
	line-height: 1.2;
	box-shadow: none !important;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.woocommerce div.product .xw-pdp-cart .single_add_to_cart_button:hover {
	background: #0e6360 !important;
	color: #fff !important;
	border: none !important;
}

.woocommerce div.product .xw-pdp-cart .single_add_to_cart_button.disabled {
	opacity: 0.35;
	background: #111315 !important;
}

.xw-pdp-cart__stock {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--xw-pdp-brand);
}

.xw-pdp-cart__stock-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--xw-pdp-brand);
	flex: 0 0 auto;
}

.xw-pdp-price-mobile {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

@media (max-width: 768px) {
	.woocommerce .xw-pdp-cart .xw-pdp-cart__actions {
		flex-direction: row;
		align-items: stretch;
	}

	.woocommerce .xw-pdp-cart .single_add_to_cart_button {
		width: auto;
	}

	/* Si Elementor muestra precio móvil aparte, ocultamos el del form */
	body.single-product .xw-pdp-cart .xw-pdp-cart__price.is-hidden-on-mobile,
	.woocommerce .xw-pdp-cart .custom-price-button.xw-pdp-cart__price {
		/* precio queda en el form también en móvil (mockup) */
		display: flex;
	}
}

/* ========== Ficha técnica ========== */

.xw-specs {
	display: flex;
	flex-direction: column;
	gap: 32px;
	width: 100%;
	color: var(--xw-pdp-text);
}

.xw-specs__list {
	display: flex;
	flex-direction: column;
}

.xw-specs__row {
	display: grid;
	grid-template-columns: 150px 1fr;
	gap: 20px;
	align-items: center;
	padding: 15px 0;
	border-bottom: 1px solid var(--xw-pdp-border);
}

.xw-specs__key {
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--xw-pdp-muted);
}

.xw-specs__val {
	font-size: 16px;
	font-weight: 600;
	color: var(--xw-pdp-text);
}

.xw-specs__bars {
	display: grid;
	gap: 18px;
}

.xw-specs__bar-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 14px;
	font-weight: 700;
}

.xw-specs__bar-level {
	color: var(--xw-pdp-muted);
	font-weight: 600;
}

.xw-specs__bar-track {
	height: 8px;
	margin-top: 8px;
	border-radius: 99px;
	background: var(--xw-pdp-track);
	overflow: hidden;
}

.xw-specs__bar-fill {
	height: 100%;
	border-radius: 99px;
	background: var(--xw-pdp-brand);
	transition: width 0.45s ease;
}

@media (max-width: 640px) {
	.xw-specs__row {
		grid-template-columns: 1fr;
		gap: 6px;
	}
}

/* ========== Se compran juntos ========== */

.xw-bt {
	width: 100%;
	color: var(--xw-pdp-text);
}

.xw-bt__title {
	margin: 0 0 24px;
	font-size: clamp(28px, 4vw, 34px);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.1;
}

.xw-bt__box {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	padding: 24px;
	background: var(--xw-pdp-bg);
	border-radius: 16px;
}

.xw-bt__gallery {
	display: flex;
	align-items: center;
	gap: 20px;
	flex: 1;
	min-width: min(100%, 280px);
}

.xw-bt__thumb {
	width: 120px;
	height: 120px;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
}

.xw-bt__thumb img,
.xw-bt__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.xw-bt__plus {
	font-size: 26px;
	font-weight: 700;
	color: #b3babc;
	line-height: 1;
}

.xw-bt__summary {
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
	min-width: min(100%, 280px);
}

.xw-bt__line {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	font-size: 15px;
}

.xw-bt__name {
	font-weight: 600;
}

.xw-bt__price {
	font-weight: 700;
	white-space: nowrap;
}

.xw-bt__total {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding-top: 12px;
	border-top: 1px solid #e2e5e6;
	font-size: 18px;
	font-weight: 800;
}

.xw-bt__cta {
	margin-top: 4px;
	width: 100%;
	padding: 15px 20px;
	border: none;
	border-radius: 999px;
	background: var(--xw-pdp-brand);
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.xw-bt__cta:hover {
	background: #0a4f4d;
}

.xw-bt__cta:disabled {
	opacity: 0.7;
	cursor: wait;
}

@media (max-width: 720px) {
	.xw-bt__gallery {
		justify-content: center;
		width: 100%;
	}

	.xw-bt__thumb {
		width: 88px;
		height: 88px;
	}
}
