/* Ficha de producto (producto.php, rediseño del 2026-10-23). Misma línea que css/perfil.css y css/usuario.css. */

.pd {
	--pd-brand: #c1121f;
	--pd-ink: #1b1b1f;
	--pd-muted: #6b6b73;
	--pd-line: #e6e6ea;
	--pd-bg: #f5f5f7;
	--pd-ok: #145c2c;
	--pd-radius: var(--bs-border-radius, .375rem);
	--pd-radius-lg: var(--bs-border-radius-lg, .5rem);
	--pd-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 24px rgba(0, 0, 0, .06);
	background: var(--pd-bg);
	color: var(--pd-ink);
	padding: 10px 0 28px;
}
.pd-crumbs {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
	font-size: .82rem;
	font-weight: 600;
}
.pd-crumbs a {
	color: var(--pd-muted);
	text-decoration: none;
}
.pd-crumbs a:hover {
	color: var(--pd-brand);
}
.pd-crumbs i {
	font-size: .6rem;
	color: #b0b0b8;
}

/* Orden en el móvil: galería, tarjeta principal, vendedor */
.pd-layout {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.pd-col-side {
	display: contents;
}
.pd-gallery-wrap { order: 1; }
.pd-info { order: 2; }
.pd-seller { order: 3; }

.pd-card {
	background: #fff;
	border-radius: var(--pd-radius-lg);
	box-shadow: var(--pd-shadow);
	padding: 18px;
}
.pd-h2 {
	margin: 0 0 10px;
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--pd-muted);
}

/* Galería: deslizar con el dedo (scroll-snap), flechas y miniaturas en escritorio */
.pd-gallery {
	position: relative;
	margin: 0 -12px; /* en el móvil, a todo el ancho */
	background: #fff;
	overflow: hidden;
}
.pd-track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	outline: none;
}
.pd-track::-webkit-scrollbar {
	display: none;
}
.pd-slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	min-width: 100%; /* con el alto limitado, la proporción no debe estrecharla (se vería la siguiente) */
	margin: 0;
	height: min(125vw, 78vh); /* 4:5 en el móvil, sin pasar del 78 % de la pantalla */
	scroll-snap-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f0f2;
}
.pd-slide img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.pd-slide-locked {
	background-size: cover;
	background-position: center;
}
.pd-slide-gift {
	flex-direction: column;
	gap: 6px;
	padding: 20px;
	text-align: center;
	background: linear-gradient(135deg, #c1121f, #6e0810);
	color: #fff;
}
.pd-slide-gift i {
	font-size: 2.2rem;
	margin-bottom: 6px;
}
.pd-slide-gift b {
	font-size: 1.05rem;
}
.pd-slide-gift span {
	font-size: .9rem;
	opacity: .85;
}
.pd-nav {
	position: absolute;
	z-index: 3; /* por encima del difuminado de las fotos bloqueadas */
	top: 50%;
	width: 40px;
	height: 40px;
	margin-top: -20px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--pd-ink);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
	display: none;
	align-items: center;
	justify-content: center;
}
.pd-prev { left: 12px; }
.pd-next { right: 12px; }
.pd-nav:disabled { opacity: 0; pointer-events: none; }
.pd-counter {
	position: absolute;
	z-index: 3;
	right: 12px;
	bottom: 12px;
	padding: 3px 10px;
	border-radius: var(--pd-radius);
	background: rgba(15, 15, 18, .7);
	color: #fff;
	font-size: .8rem;
	font-weight: 700;
}
.pd-sold-tag {
	position: absolute;
	z-index: 3;
	top: 12px;
	left: 12px;
	padding: 4px 12px;
	border-radius: var(--pd-radius);
	background: var(--pd-ink);
	color: #fff;
	font-size: .8rem;
	font-weight: 700;
	text-transform: uppercase;
}
.pd-thumbs {
	display: none; /* en el móvil basta con deslizar y el contador: así el precio y el botón suben */
	gap: 8px;
	margin-top: 10px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px;
}
.pd-thumbs::-webkit-scrollbar {
	display: none;
}
.pd-thumb {
	position: relative;
	flex: 0 0 64px;
	height: 80px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: var(--pd-radius);
	background: #e9e9ed center / cover no-repeat;
	overflow: hidden;
	opacity: .75;
	transition: opacity .15s, border-color .15s;
}
.pd-thumb.active {
	border-color: var(--pd-brand);
	opacity: 1;
}
.pd-thumb-gift {
	background: linear-gradient(135deg, #c1121f, #6e0810);
	color: #fff;
}

/* Tarjeta principal */
.pd-title {
	margin: 0 0 8px;
	font-size: 1.35rem;
	line-height: 1.2;
	overflow-wrap: anywhere;
}
.pd-price-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-bottom: 10px;
}
.pd-price {
	font-size: 1.75rem;
	font-weight: 800;
	line-height: 1;
}
.pd-price.is-sold {
	color: var(--pd-muted);
	text-decoration: line-through;
}
.pd-price-free {
	color: var(--pd-ok);
}
.pd-price-swap {
	color: #12457f;
}
.pd-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: var(--pd-radius);
	background: #fff4dc;
	color: #7a4d00;
	font-size: .82rem;
	font-weight: 700;
}
.pd-pill-sold {
	background: #ececf0;
	color: var(--pd-ink);
}
.pd-delivery {
	margin-bottom: 14px;
}
.pd-facts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	margin: 0 0 14px;
	border: 1px solid var(--pd-line);
	border-radius: var(--pd-radius);
	background: var(--pd-line);
	overflow: hidden;
}
.pd-facts > div {
	padding: 9px 12px;
	background: #fff;
}
.pd-facts > div:last-child:nth-child(odd) {
	grid-column: span 2; /* con un número impar de datos, el último ocupa la fila */
}
.pd-facts dt {
	font-size: .75rem;
	font-weight: 600;
	color: var(--pd-muted);
}
.pd-facts dd {
	margin: 0;
	font-weight: 700;
	overflow-wrap: anywhere;
}
.pd-extras {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 14px;
}
.pd-label {
	width: 100%;
	font-size: .75rem;
	font-weight: 600;
	color: var(--pd-muted);
}
.pd-chip {
	padding: 4px 10px;
	border: 1px solid #dcdce0;
	border-radius: var(--pd-radius);
	font-size: .85rem;
	font-weight: 600;
}
.pd-cta {
	display: grid;
	gap: 8px;
}
.pd-cta .btn {
	padding: 12px;
}
.pd-cta-note {
	margin: 0;
	text-align: center;
	font-size: .8rem;
	color: var(--pd-muted);
}
.pd-sold-to {
	padding: 12px;
	border-radius: var(--pd-radius);
	background: #ececf0;
	text-align: center;
	font-weight: 600;
}
.pd-notes {
	display: grid;
	gap: 8px;
	margin: 14px 0 0;
	padding: 12px 0 0;
	border-top: 1px solid var(--pd-line);
	list-style: none;
	font-size: .85rem;
	color: var(--pd-muted);
}
.pd-notes li {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr);
	gap: 8px;
}
.pd-notes i {
	margin-top: 3px;
	color: var(--pd-brand);
}
.pd-notes li.ok i {
	color: var(--pd-ok);
}

/* Descripción, dentro de la tarjeta principal, debajo del precio y la entrega */
.pd-desc {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--pd-line);
}
.pd-desc .rich-text {
	line-height: 1.6;
	overflow-wrap: anywhere;
}
.pd-desc .rich-text > :last-child {
	margin-bottom: 0;
}
.pd-desc .rich-text.is-clamped {
	max-height: calc(1.6em * 7);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(#000 60%, transparent);
	mask-image: linear-gradient(#000 60%, transparent);
}
.pd-desc-more {
	margin-top: 4px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--pd-brand);
	font-weight: 700;
	font-size: .9rem;
}
.pd-delivery-note {
	margin: 10px 0 0;
	font-size: .85rem;
	color: var(--pd-muted);
}

/* Vendedor */
.pd-seller-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}
.pd-avatar {
	flex: 0 0 56px;
	height: 56px;
	border-radius: var(--pd-radius-lg);
	background: #f0e2e4;
	color: var(--pd-brand);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	font-size: 1.3rem;
}
.pd-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.pd-seller-id {
	min-width: 0;
}
.pd-seller-name {
	display: block;
	color: var(--pd-ink);
	font-size: 1.1rem;
	font-weight: 800;
	text-decoration: none;
	overflow-wrap: anywhere;
}
.pd-verified {
	color: var(--pd-brand);
	font-size: .9rem;
}
.pd-seller-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 12px;
	font-size: .85rem;
	color: var(--pd-muted);
}
.pd-star {
	color: #f2a900;
}
.pd-seller-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 0 0 12px;
	border-top: 1px solid var(--pd-line);
	border-bottom: 1px solid var(--pd-line);
}
.pd-seller-stats > div {
	padding: 8px 4px;
	text-align: center;
}
.pd-seller-stats > div + div {
	border-left: 1px solid var(--pd-line);
}
.pd-seller-stats dt {
	font-size: .7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--pd-muted);
}
.pd-seller-stats dd {
	margin: 0;
	font-weight: 800;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.pd-seller-about {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 12px;
	font-size: .9rem;
	color: #3a3a40;
	white-space: pre-line;
}
.pd-report {
	display: block;
	margin-top: 12px;
	text-align: center;
	font-size: .8rem;
	color: var(--pd-muted);
}

@media (min-width: 768px) {
	.pd {
		padding: 18px 0 40px;
	}
	.pd-layout {
		display: grid;
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		grid-template-rows: auto 1fr;
		gap: 20px 24px;
		align-items: start;
	}
	.pd-col {
		grid-column: 1;
		grid-row: 1;
	}
	.pd-col-side {
		display: grid;
		gap: 16px;
		grid-column: 2;
		grid-row: 1 / span 2;
	}
	.pd-slide {
		height: min(640px, 78vh);
	}
	.pd-gallery {
		margin: 0;
		border-radius: var(--pd-radius-lg);
		box-shadow: var(--pd-shadow);
	}
	.pd-nav {
		display: flex;
	}
	.pd-thumbs {
		display: flex;
	}
	.pd-card {
		padding: 22px;
	}
	.pd-title {
		font-size: 1.6rem;
	}
}
.pd-thumbs { position: relative; }
