/* ==========================================================================
   NUDA — Ficha de producto (woocommerce/single-product.php)
   Dos columnas: la izquierda se desplaza; la derecha (resumen) queda fija
   con position: sticky mientras dura la izquierda.
   ========================================================================== */

body.nuda-product-page,
body.nuda-product-page .site,
body.nuda-product-page .site-main { max-width: none; margin: 0; background: #fff; }

.nuda-product {
	--np-container: 1424px;
	--np-text: #444;
	--np-green: #5bb12f;
	--np-navy: #13294b;
	--np-sticky-top: calc(24px + var(--wp-admin--admin-bar--height, 0px));
	padding: 0 0 90px;
	color: var(--nuda-ink);
	font-family: var(--nuda-body);
}
.nuda-product *,
.nuda-product *::before,
.nuda-product *::after { box-sizing: border-box; }
.nuda-pd { width: min(var(--np-container), 100% - var(--nuda-gutter) * 2); margin: 0 auto; }

/* Títulos: el tema padre fuerza mayúsculas y espaciado en h1–h3. */
html body .nuda-product :is(h1, h2, h3) { letter-spacing: 0 !important; text-transform: none; }

/* ── Migas ───────────────────────────────────────────────────────────────── */
.nuda-pd__crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 8px;
	padding: 36px 0 40px;
	color: var(--nuda-ink);
	font-size: 1rem;
}
.nuda-pd__crumbs a { color: var(--nuda-ink); text-decoration: none; transition: color .2s; }
.nuda-pd__crumbs a:hover { color: var(--nuda-red); }
.nuda-pd__crumbs [aria-current] { color: var(--nuda-red); }

/* ── Estructura ──────────────────────────────────────────────────────────── */
.nuda-pd__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 555px);
	gap: 72px;
	align-items: start;
}
.nuda-pd__main { min-width: 0; }
.nuda-pd__aside {
	position: sticky;
	top: var(--np-sticky-top);
	align-self: start;
}

/* ── Galería ─────────────────────────────────────────────────────────────── */
.nuda-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
.nuda-gallery.has-thumbs { grid-template-columns: 132px minmax(0, 1fr); }

.nuda-gallery__rail { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nuda-gallery__thumbs {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	max-height: 410px;
	overflow-y: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
}
.nuda-gallery__thumbs::-webkit-scrollbar { display: none; }
.nuda-gallery__thumb {
	display: block;
	flex: 0 0 auto;
	width: 100%;
	aspect-ratio: 1.1;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	opacity: .65;
	transition: opacity .2s, border-color .2s;
}
.nuda-gallery__thumb img { display: block; width: 100%; height: 100% !important; object-fit: contain; }
.nuda-gallery__thumb:hover,
.nuda-gallery__thumb.is-active { opacity: 1; }
.nuda-gallery__thumb.is-active { border-color: #ececec; }
.nuda-gallery__thumb:focus-visible { outline: 2px solid var(--nuda-red); outline-offset: 2px; }

.nuda-gallery__arrow {
	display: grid;
	place-items: center;
	width: 40px;
	height: 30px;
	padding: 0;
	border: 0;
	background: none;
	color: #bbb;
	cursor: pointer;
	transition: color .2s, opacity .2s;
}
.nuda-gallery__arrow:hover { color: var(--nuda-ink); }
.nuda-gallery__arrow:disabled { opacity: .3; cursor: default; }
.nuda-gallery__arrow:disabled:hover { color: #bbb; }
.nuda-gallery__rail:not(.is-scrollable) .nuda-gallery__arrow { visibility: hidden; }

.nuda-gallery__main { margin: 0; }
.nuda-gallery__open {
	display: block;
	width: 100%;
	aspect-ratio: 1.15;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}
.nuda-gallery__img {
	display: block;
	width: 100%;
	height: 100% !important;
	object-fit: contain;
	transition: opacity .2s;
}
.nuda-gallery__img.is-swapping { opacity: 0; }

/* ── Resumen ─────────────────────────────────────────────────────────────── */
.nuda-summary__brand { margin: 0 0 6px; color: var(--nuda-ink); font: 500 1.375rem/1.2 var(--nuda-display); }
html body .nuda-product .nuda-summary__title {
	margin: 0;
	color: #333;
	font: 700 clamp(1.75rem, 2.6vw, 2.625rem)/1.1 var(--nuda-display);
	text-transform: uppercase;
}
.nuda-summary__sku { margin: 6px 0 0; color: #777; font-size: .875rem; }

.nuda-summary__price { margin-top: 28px; }
.nuda-summary__label { display: block; color: var(--nuda-ink); font: 400 1.25rem/1.2 var(--nuda-display); }
.nuda-summary__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-top: 4px; }
.nuda-summary__amount { color: var(--nuda-ink); font: 500 clamp(2rem, 2.6vw, 2.5rem)/1.1 var(--nuda-display); }
.nuda-summary__amount del { color: #999; font-size: .55em; }
.nuda-summary__amount ins { text-decoration: none; }
.nuda-summary__amount--ask { font-size: 1.75rem; }
.nuda-summary__stock { color: #888; font-size: .9375rem; letter-spacing: -.02em; }
.nuda-summary__stock.is-out { color: var(--nuda-red); }

/* Compra */
.nuda-buy { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; margin-top: 50px; }
.nuda-stepper {
	display: inline-flex;
	align-items: center;
	height: 54px;
	border: 1px solid #333;
	border-radius: 4px;
	overflow: hidden;
}
.nuda-stepper button,
.nuda-stepper input {
	width: 36px;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fff;
	color: var(--nuda-ink);
	text-align: center;
}
.nuda-stepper button { display: grid; place-items: center; color: #777; cursor: pointer; transition: color .15s; }
.nuda-stepper button:hover { color: var(--nuda-ink); }
.nuda-stepper input {
	width: 34px;
	font: 400 1.5rem/1 var(--nuda-display);
	-moz-appearance: textfield;
	appearance: textfield;
}
.nuda-stepper input::-webkit-inner-spin-button,
.nuda-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.nuda-stepper input:focus { outline: none; }
.nuda-stepper:focus-within { box-shadow: 0 0 0 2px rgba(0, 0, 0, .08); }

.nuda-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 54px;
	padding: 0 20px;
	border: 0;
	border-radius: 4px;
	color: #fff !important;
	font: 600 1.125rem/1 var(--nuda-display);
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s, translate .2s var(--nuda-ease);
}
.nuda-btn:hover { translate: 0 -2px; }
.nuda-btn:active { translate: 0 0; }
.nuda-btn--red { background: #b31b1b; }
.nuda-btn--red:hover { background: #961313; }
.nuda-btn--green { background: var(--np-green); }
.nuda-btn--green:hover { background: #4c9a25; }
.nuda-btn--black { background: #0d0d0d; }
.nuda-btn--black:hover { background: #2b2b2b; }

.nuda-summary__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-top: 12px; }

/* Formulario estándar de WooCommerce (variables/agrupados). */
.nuda-buy--wc { display: block; }
.nuda-buy--wc .single_add_to_cart_button {
	height: 54px;
	padding: 0 28px;
	border: 0;
	border-radius: 4px;
	background: #b31b1b;
	color: #fff;
	font: 600 1.125rem/1 var(--nuda-display);
}

/* Envíos y entrega */
.nuda-ship {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-top: 44px;
	padding: 24px 22px;
	border-radius: 8px;
	background: #f6f6f6;
	color: #1a2a5a;
}
.nuda-ship svg { flex: 0 0 auto; }
.nuda-ship p { margin: 0; }
.nuda-ship strong { display: block; color: #333; font: 400 1.0625rem/1.3 var(--nuda-body); }
.nuda-ship small { display: block; margin-top: 2px; color: #777; font-size: .9375rem; }

.nuda-delivery { display: grid; gap: 18px; margin: 22px 0 0; padding: 0; list-style: none; }
.nuda-delivery li { display: flex; align-items: center; gap: 8px; margin: 0; color: #2b2b3b; font-size: .9375rem; }
.nuda-delivery span { text-decoration: underline; text-underline-offset: 3px; }

/* ── Pestañas ────────────────────────────────────────────────────────────── */
.nuda-info { max-width: 900px; margin-top: 80px; }
.nuda-tabs { display: flex; gap: 30px; max-width: 840px; border-bottom: 2px solid #e2e4ea; }
.nuda-tabs__tab {
	position: relative;
	margin-bottom: -2px;
	padding: 0 0 14px;
	border: 0;
	border-bottom: 4px solid transparent;
	background: none;
	color: #444;
	font: 600 1.25rem/1.2 var(--nuda-display);
	cursor: pointer;
	transition: color .2s, border-color .2s;
}
.nuda-tabs__tab:hover { color: var(--np-navy); }
.nuda-tabs__tab[aria-selected="true"] { border-bottom-color: var(--np-navy); color: #333; }
.nuda-tabs__tab:focus-visible { outline: 2px solid var(--np-navy); outline-offset: 4px; }
/* Sin JS no hay pestañas: se ven los paneles seguidos. */
.nuda-info:not(.is-ready) .nuda-tabs { display: none; }

.nuda-info__panel { padding-top: 26px; }
.nuda-info__text { color: var(--np-text); font-size: .875rem; line-height: 1.55; }
.nuda-info__text p { margin: 0 0 1em; }
.nuda-info__text > :last-child { margin-bottom: 0; }
.nuda-info__text strong { color: var(--nuda-ink); }

.nuda-specs { margin: 0; border: 1px solid #e6e6e6; border-radius: 4px; overflow: hidden; }
.nuda-specs > div {
	display: grid;
	grid-template-columns: minmax(140px, 32%) minmax(0, 1fr);
	gap: 16px;
	padding: 12px 16px;
	border-top: 1px solid #ececec;
	font-size: .875rem;
	line-height: 1.4;
}
.nuda-specs > div:first-child { border-top: 0; }
.nuda-specs > div:nth-child(even) { background: #fafafa; }
.nuda-specs dt { color: var(--nuda-ink); font-weight: 600; }
.nuda-specs dd { margin: 0; color: #555; }

/* ── Productos relacionados ──────────────────────────────────────────────── */
.nuda-related { margin-top: 60px; }
html body .nuda-product .nuda-related__title {
	margin: 0 0 22px;
	color: var(--nuda-ink);
	font: 700 clamp(2rem, 3.4vw, 3rem)/1.1 var(--nuda-display);
	letter-spacing: -.04em !important;
}
.nuda-related__title span { color: #b31b1b; }

.nuda-related__viewport { position: relative; }
.nuda-related__track {
	--per-view: 3;
	display: grid;
	grid-auto-columns: calc((100% - (var(--per-view) - 1) * 16px) / var(--per-view));
	grid-auto-flow: column;
	gap: 16px;
	margin: 0;
	padding: 4px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	list-style: none;
}
.nuda-related__track::-webkit-scrollbar { display: none; }

.nuda-related__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: #eee;
	color: var(--nuda-ink);
	cursor: pointer;
	translate: 0 -50%;
	transition: background-color .2s, opacity .2s;
}
.nuda-related__arrow:hover { background: #e0e0e0; }
.nuda-related__arrow:disabled { opacity: .35; cursor: default; }
.nuda-related__arrow--prev { left: -28px; }
.nuda-related__arrow--next { right: -28px; }
.nuda-related:not(.is-scrollable) .nuda-related__arrow { display: none; }

.nuda-card {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 16px 16px 18px;
	border: 1px solid #d9d9d9;
	border-radius: 4px;
	background: #fff;
	scroll-snap-align: start;
	transition: box-shadow .3s;
}
.nuda-card:hover { box-shadow: 0 18px 36px -26px rgba(0, 0, 0, .45); }
.nuda-card__media { position: relative; display: block; aspect-ratio: 1.05; }
.nuda-card__media img { display: block; width: 100%; height: 100% !important; object-fit: contain; mix-blend-mode: multiply; }
.nuda-card__brand {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 1;
	padding: 3px 7px;
	background: #111;
	color: #fff;
	font: 400 .75rem/1.2 var(--nuda-body);
}
html body .nuda-product .nuda-card__name { margin: 14px 0 0; font: 500 .9375rem/1.3 var(--nuda-display); }
.nuda-card__name a { color: var(--nuda-ink); text-decoration: none; }
.nuda-card__name a:hover { color: #b31b1b; }
.nuda-card__price { margin: 4px 0 0; color: #b31b1b; font: 500 1.1875rem/1.2 var(--nuda-display); }
.nuda-card__price del { color: #999; font-size: .8em; }
.nuda-card__price ins { text-decoration: none; }
.nuda-card__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	margin-top: auto;
	border: 1px solid #b31b1b;
	border-radius: 3px;
	background: #fff;
	color: var(--nuda-ink) !important;
	font: 400 .9375rem/1 var(--nuda-display);
	text-decoration: none;
	transition: background-color .2s, color .2s;
}
.nuda-card > :is(.nuda-card__name, .nuda-card__price):has(+ .nuda-card__btn) { margin-bottom: 16px; }
.nuda-card__btn:hover,
.nuda-card__btn.added { background: #b31b1b; color: #fff !important; }
.nuda-card__btn.loading { opacity: .6; pointer-events: none; }
/* WooCommerce añade «Ver carrito» tras agregar; basta el estado del botón. */
.nuda-card .added_to_cart { display: none; }

/* ── Visor de imagen ─────────────────────────────────────────────────────── */
.nuda-zoom {
	width: min(1100px, 100vw - 32px);
	max-width: none;
	height: min(900px, 100dvh - 32px);
	max-height: none;
	padding: 24px;
	border: 0;
	border-radius: 8px;
	background: #fff;
}
.nuda-zoom[open] { display: grid; place-items: center; }
.nuda-zoom::backdrop { background: rgba(0, 0, 0, .75); }
.nuda-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-out; }
.nuda-zoom__close,
.nuda-zoom__nav {
	position: absolute;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--nuda-line);
	border-radius: 50%;
	background: #fff;
	color: var(--nuda-ink);
	cursor: pointer;
	transition: border-color .2s, color .2s;
}
.nuda-zoom__close:hover,
.nuda-zoom__nav:hover { border-color: var(--nuda-red); color: var(--nuda-red); }
.nuda-zoom__close { top: 14px; right: 14px; }
.nuda-zoom__nav { top: 50%; translate: 0 -50%; }
.nuda-zoom__nav--prev { left: 14px; }
.nuda-zoom__nav--next { right: 14px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
	.nuda-pd__layout { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 48px; }
	.nuda-gallery.has-thumbs { grid-template-columns: 100px minmax(0, 1fr); gap: 20px; }
	.nuda-related__track { --per-view: 2; }
}

/* Una columna: el resumen va tras la galería y deja de ser fijo. */
@media (max-width: 1024px) {
	.nuda-pd__layout { display: flex; flex-direction: column; gap: 0; }
	.nuda-pd__main { display: contents; }
	.nuda-gallery { order: 1; }
	.nuda-pd__aside { position: static; order: 2; margin-top: 32px; }
	.nuda-info { order: 3; margin-top: 56px; }
	.nuda-related { order: 4; }
	.nuda-related__arrow--prev { left: -8px; }
	.nuda-related__arrow--next { right: -8px; }
}

@media (max-width: 600px) {
	.nuda-pd__crumbs { padding: 20px 0 24px; font-size: .875rem; }
	.nuda-gallery.has-thumbs { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.nuda-gallery__rail { order: 2; flex-direction: row; }
	.nuda-gallery__arrow { display: none; }
	.nuda-gallery__thumbs { flex-direction: row; max-height: none; overflow-x: auto; }
	.nuda-gallery__thumb { width: 72px; }
	.nuda-buy { margin-top: 32px; }
	.nuda-btn { font-size: 1rem; }
	.nuda-tabs { gap: 22px; }
	.nuda-tabs__tab { font-size: 1.0625rem; }
	.nuda-specs > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
	.nuda-related__track { --per-view: 1.35; gap: 12px; }
	.nuda-related__arrow { display: none !important; }
	.nuda-card { padding: 12px; }
	.nuda-zoom { padding: 12px; }
}
