/**
 * product-card.css — Royal Chic Lingerie v2
 * Card de producto con skeleton, tallas y todos los estados
 */

/* ════════════════════════════════════════
   CARD — Contenedor principal
════════════════════════════════════════ */
.rc-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	cursor: pointer;
	max-width: 440px;
	margin-inline: auto;
	width: 100%;
}

/* ════════════════════════════════════════
   MEDIA — Imagen y overlays
════════════════════════════════════════ */
.rc-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	background: var(--rc-cream-dk, #e8e4d9);
}

/* ── SKELETON DE IMAGEN ──
   Pulsa mientras la imagen no ha cargado.
   El JS lo oculta cuando img dispara el evento 'load'.
*/
.rc-card__img-skeleton {
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, #e8e4d9 25%, #eee9df 50%, #e8e4d9 75%);
	background-size: 200% 100%;
	animation: rc-shimmer 1.5s infinite;
	z-index: 1;
	transition: opacity 0.3s ease;
}

.rc-card__img-skeleton.hidden {
	opacity: 0;
	pointer-events: none;
}

@keyframes rc-shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

/* ── IMAGEN REAL ── */
.rc-card__img-link {
	display: block;
	position: absolute;
	inset: 0;
	z-index: 2;
}

.rc-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
	transition: transform 0.35s ease;
	/* Oculta mientras carga — el skeleton la cubre */
	opacity: 0;
	transition:
		transform 0.35s ease,
		opacity 0.3s ease;
}

.rc-card__img.is-loaded {
	opacity: 1;
}

.rc-product-card:hover .rc-card__img {
	transform: scale(1.04);
}

/* ════════════════════════════════════════
   BADGES
════════════════════════════════════════ */
.rc-card__badges {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	z-index: 3;
}

.rc-badge {
	display: inline-block;
	font-family: "Inter", sans-serif;
	font-size: var(--rc-fs-tag);
	/* font-weight: 700; */
	letter-spacing: 1.5px;
	text-transform: uppercase;
	padding: 4px 10px;
	line-height: 1;
	border-radius: 1px;
}

.rc-badge--new {
	background: #fff;
	color: var(--rc-ink, #1c1a17);
}
.rc-badge--sale {
	background: var(--rc-ink, #1c1a17);
	color: var(--gold-lt);
}
.rc-badge--off {
	background: var(--rc-gold, #b8965a);
	color: #fff;
}
.rc-badge--oos {
	background: var(--rc-text-danger, #9e1600);
	color: #fff;
}

/* ════════════════════════════════════════
   BOTÓN WISHLIST
════════════════════════════════════════ */
.rc-card__wishlist {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	width: 32px;
	height: 32px;
	/* border-radius: 50%; */
	background: rgba(255, 255, 255, 0.92);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	opacity: 0;
	pointer-events: none;
	transition:
		background 0.2s,
		transform 0.2s,
		opacity 0.2s;
	backdrop-filter: blur(4px);
	font-size: 0;
	text-decoration: none;
	color: inherit;
}

.rc-card__media:hover .rc-card__wishlist,
.rc-product-card:focus-within .rc-card__wishlist,
.rc-card__wishlist:focus-visible {
	opacity: 1;
	pointer-events: auto;
}

@media (hover: none) {
	.rc-card__wishlist {
		opacity: 1;
		pointer-events: auto;
	}
}

.rc-card__wishlist:hover {
	background: #fff;
	transform: scale(1.1);
}

.rc-card__wishlist svg {
	width: 17px;
	height: 17px;
	fill: var(--rc-ink, #1c1a17);
	transition: fill 0.2s;
	pointer-events: none;
}

.rc-card__wishlist.is-active svg,
.rc-card__wishlist[aria-pressed="true"] svg,
.rc-card__wishlist.tinvwl-product-in-list svg {
	fill: #e05252;
}

/* ════════════════════════════════════════
   BARRA INFERIOR — aparece en hover
════════════════════════════════════════ */
.rc-card__add-bar {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 3;
	transform: translateY(100%);
	transition: transform 0.28s ease;
}

.rc-product-card:hover .rc-card__add-bar {
	transform: translateY(0);
}

/* Mobile: siempre visible */
@media (hover: none) {
	.rc-card__add-bar {
		transform: translateY(0);
	}
}

/* ── Botón simple ── */
.rc-btn-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 12px 14px;
	background: var(--rc-ink, #1c1a17);
	color: var(--rc-gold-lt);
	font-family: "Inter", sans-serif;
	font-size: var(--rc-fs-btn);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	border: none;
	cursor: pointer;
	transition: background 0.2s;
	text-decoration: none;
	line-height: 1;
}

/* .rc-btn-cart:hover {
	background: var(--rc-gold, #b8965a);
} */
.rc-btn-cart svg {
	width: 13px;
	height: 13px;
	fill: #fff;
	flex-shrink: 0;
}
.rc-btn-cart--oos {
	background: #aaa;
    color: #fff;
	cursor: not-allowed;
}
.rc-btn-cart--oos:hover {
	background: #aaa;
}

/* Estado loading del botón (WooCommerce agrega .loading) */
.rc-btn-cart.loading {
	pointer-events: none;
	opacity: 0.7;
	position: relative;
}

.rc-btn-cart.loading::after {
	content: "";
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 12px;
	height: 12px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: rc-spin 0.6s linear infinite;
}

@keyframes rc-spin {
	to {
		transform: translateY(-50%) rotate(360deg);
	}
}

/* Estado agregado */
.rc-btn-cart.added {
	background: var(--rc-gold, #b8965a);
}

/* ════════════════════════════════════════
   SELECTOR DE TALLAS — Producto variable
════════════════════════════════════════ */
.rc-card__sizes {
	padding: 10px 12px 12px;
	background: rgba(20, 18, 14, 0.96);
	backdrop-filter: blur(8px);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rc-sizes__label {
	font-size: 8px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.45);
}

.rc-sizes__options {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}

.rc-size-btn {
	min-width: 32px;
	height: 32px;
	padding: 0 6px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: transparent;
	color: rgba(255, 255, 255, 0.75);
	font-family: "Inter", sans-serif;
	font-size: var(--rc-fs-btn);
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	letter-spacing: 0.04em;
}

.rc-size-btn:hover:not(:disabled) {
	border-color: var(--rc-gold, #b8965a);
	color: #fff;
}

.rc-size-btn.selected {
	background: var(--rc-gold, #b8965a);
	border-color: var(--rc-gold, #b8965a);
	color: #fff;
}

.rc-size-btn.oos,
.rc-size-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
	text-decoration: line-through;
}

/* Botón agregar después de elegir talla */
.rc-sizes__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 10px 12px;
	background: var(--rc-gold, #b8965a);
	color: #fff;
	font-family: "Inter", sans-serif;
	font-size: var(--rc-fs-btn);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	border: none;
	cursor: pointer;
	transition: background 0.2s;
}

.rc-sizes__cta:hover:not(:disabled) {
	background: var(--rc-gold-lt, #d4af7a);
}
.rc-sizes__cta:disabled {
	background: rgba(255, 255, 255, 0.15);
	cursor: not-allowed;
}
.rc-sizes__cta svg {
	fill: currentColor;
	flex-shrink: 0;
}

.rc-sizes__ver-mas {
	font-size: var(--rc-fs-tag);
	color: rgba(255, 255, 255, 0.35);
	text-align: center;
	text-decoration: none;
	letter-spacing: 1px;
	text-transform: uppercase;
	transition: color 0.15s;
	display: block;
	margin-top: 2px;
}

.rc-sizes__ver-mas:hover {
	color: rgba(255, 255, 255, 0.7);
}

/* ════════════════════════════════════════
   INFO — nombre, precio, rating
════════════════════════════════════════ */
.rc-card__info {
	padding: 10px 0 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.rc-card__rating {
	display: flex;
	align-items: center;
	gap: 4px;
}

.rc-stars {
	display: inline-flex;
	align-items: center;
	gap: 1px;
}
.rc-star {
	display: inline-flex;
	line-height: 0;
}
.rc-star--full svg,
.rc-star--half svg {
	fill: var(--rc-gold, #b8965a);
}
.rc-star--empty svg {
	fill: #d4d0c8;
}

.rc-rating-count {
	font-size: 11px;
	color: #999;
}

.rc-card__name {
	font-size: 13px;
	font-weight: 400;
	font-family: "Inter", sans-serif;
	line-height: 1.4;
	color: var(--rc-ink, #1c1a17);
	margin: 0;
	text-transform: capitalize;
}

.rc-card__name a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s;
}

.rc-card__name a:hover {
	color: var(--rc-gold, #b8965a);
}

.rc-card__price {
	display: flex;
	align-items: center;
	gap: 7px;
	flex-wrap: wrap;
	margin-top: 2px;
}

.rc-price-sale {
	font-size: 14px;
	font-weight: 600;
	color: var(--rc-ink, #1c1a17);
}
.rc-price-regular {
	font-size: 12px;
	color: #aaa;
	text-decoration: line-through;
	font-weight: 400;
}
.rc-price-off {
	font-size: 11px;
	color: var(--rc-gold, #b8965a);
	font-weight: 600;
}
.rc-price-normal {
	font-size: 15px;
	font-weight: 600;
	color: var(--rc-ink, #1c1a17);
}

/* WooCommerce inyecta span.woocommerce-Price-amount dentro de wc_price()
   Aseguramos que hereden los estilos correctos */
.rc-card__price .woocommerce-Price-amount,
.rc-card__price .woocommerce-Price-currencySymbol {
	font: inherit;
	color: inherit;
}

/* ════════════════════════════════════════
   SKELETON DE CARD COMPLETA
   Para el AJAX de filtros del home
════════════════════════════════════════ */
.rc-skeleton-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rc-sk-img {
	aspect-ratio: 3/4;
	background: linear-gradient(90deg, #e8e4d9 25%, #eee9df 50%, #e8e4d9 75%);
	background-size: 200% 100%;
	animation: rc-shimmer 1.5s infinite;
	border-radius: 1px;
}

.rc-sk-line {
	height: 11px;
	background: linear-gradient(90deg, #e8e4d9 25%, #eee9df 50%, #e8e4d9 75%);
	background-size: 200% 100%;
	animation: rc-shimmer 1.5s infinite;
	border-radius: 2px;
}

.rc-sk-line--short {
	width: 55%;
}
.rc-sk-line--price {
	width: 40%;
	height: 14px;
}

/* ════════════════════════════════════════
   ACCESIBILIDAD
════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
	.rc-card__img,
	.rc-card__add-bar,
	.rc-card__wishlist {
		transition: none;
	}
	.rc-card__img-skeleton {
		animation: none;
		opacity: 0.6;
	}
	.rc-sk-img,
	.rc-sk-line {
		animation: none;
		opacity: 0.6;
	}
	.rc-product-card:hover .rc-card__img {
		transform: none;
	}
}
