/* Estilos compartidos entre bloques VV: iconos, tarjeta de producto, insignias. */

.vv-icon {
	display: inline-block;
	flex: none;
	vertical-align: middle;
}

/* ---------- Tarjeta de producto ---------- */
.vv-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	text-align: center;
}

.vv-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--xl, 30px);
	background: #fff;
}

.vv-card__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.35s ease;
}

.vv-card:hover .vv-card__img {
	transform: scale(1.04);
}

.vv-card__badges {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	display: flex;
	gap: 6px;
}

.vv-badge {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent, #c4392b);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.vv-badge--muted {
	background: var(--wp--preset--color--muted, #6b6b6b);
}

.vv-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	gap: 0.55rem;
	padding: 0.9rem 0.25rem 0.25rem;
}

.vv-card__title {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.45;
	letter-spacing: 0;
	color: var(--wp--preset--color--body, #3d3d4a);
}

.vv-card__title a {
	color: inherit;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.vv-card__title a:hover {
	color: var(--wp--preset--color--accent, #c4392b);
}

.vv-card__price {
	margin-top: auto;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--wp--preset--color--ink, #1a1a1a);
}

.vv-card__price del {
	margin-right: 0.35em;
	font-weight: 400;
	color: var(--wp--preset--color--muted, #6b6b6b);
}

.vv-card__price ins {
	text-decoration: none;
}

.vv-card__price .woocommerce-price-suffix,
.vv-price-suffix {
	font-size: 0.72rem;
	font-weight: 500;
}

.vv-card__btn.button,
a.vv-card__btn,
button.vv-card__btn,
.vv-card__cta .wp-block-button__link,
.wp-block-vv-required-product .vv-card__cta .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
	margin-top: 0.4rem;
	padding: 0.5rem 1.15rem;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--primary, #2d2d3a);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1.3;
	text-decoration: none;
	text-transform: uppercase;
	transition: background 0.2s ease;
}

.vv-card:hover .vv-card__btn,
.vv-card:hover .vv-card__cta .wp-block-button__link,
.vv-card__cta .wp-block-button__link:hover,
.vv-card__btn:hover,
.vv-card__btn:focus-visible {
	background: var(--wp--preset--color--accent, #c4392b);
	color: #fff;
	text-decoration: none;
}

.vv-card__btn.loading {
	opacity: 0.6;
	pointer-events: none;
}

.vv-card__btn .vv-icon {
	width: 15px;
	height: 15px;
}

.vv-card__btn.added {
	background: #1e8e4a;
}

.vv-card__btn.loading .vv-icon {
	animation: vv-cart-wiggle 0.6s ease infinite;
}

@keyframes vv-cart-wiggle {
	0%, 100% { transform: translateX(0); }
	50% { transform: translateX(3px); }
}

.vv-card__cta.wp-block-button {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	margin: 0;
}

.vv-card__cta .wp-block-button__link {
	width: auto;
	cursor: pointer;
}

.vv-card__cta .wp-block-button__link.loading {
	opacity: 0.6;
}

.vv-card__cta .wc-block-components-product-button__button span[hidden] {
	display: none;
}

.vv-card__cta .added_to_cart,
.vv-card__cta .wc-block-components-product-button__button + a {
	font-size: 0.75rem;
	color: var(--wp--preset--color--accent, #c4392b);
}

/* WooCommerce añade "Ver carrito" tras el AJAX: se muestra como enlace discreto. */
.vv-card .added_to_cart {
	font-size: 0.75rem;
	color: var(--wp--preset--color--accent, #c4392b);
}

/* ---------- Utilidades ---------- */
.vv-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.vv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	padding: 0.65rem 1.4rem;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--wp--preset--color--primary, #2d2d3a);
	color: #fff;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.vv-btn:hover,
.vv-btn:focus-visible {
	background: var(--wp--preset--color--accent, #c4392b);
	color: #fff;
	text-decoration: none;
}

.vv-btn--ghost {
	background: transparent;
	border-color: var(--wp--preset--color--primary, #2d2d3a);
	color: var(--wp--preset--color--primary, #2d2d3a);
}

.vv-btn--ghost:hover,
.vv-btn--ghost:focus-visible {
	background: var(--wp--preset--color--primary, #2d2d3a);
	border-color: var(--wp--preset--color--primary, #2d2d3a);
}

.vv-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---------- Packs: "Este pack incluye" ---------- */
.vv-bundle {
	box-sizing: border-box;
	width: 100%;
	margin-bottom: 1.25rem;
	padding: 1rem 1.1rem;
	border: 1px solid var(--wp--preset--color--line, #e3e3e6);
	border-radius: 14px;
	background: var(--wp--preset--color--cream, #faf9f7);
}

.vv-bundle__title {
	margin: 0 0 0.6rem;
	color: var(--wp--preset--color--ink, #1a1a1a);
	font-weight: 600;
}

.vv-bundle__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vv-bundle__item {
	display: grid;
	grid-template-columns: 52px 1fr auto auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 0;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
}

.vv-bundle__item + .vv-bundle__item {
	border-top: 1px solid var(--wp--preset--color--line, #e3e3e6);
}

.vv-bundle__img {
	width: 52px;
	height: 52px;
	overflow: hidden;
	border-radius: 8px;
	background: #fff;
}

.vv-bundle__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.vv-bundle__name a {
	color: var(--wp--preset--color--ink, #1a1a1a);
	text-decoration: none;
}

.vv-bundle__name a:hover {
	color: var(--wp--preset--color--accent, #c4392b);
}

.vv-bundle__qty {
	color: var(--wp--preset--color--muted, #6b6b6b);
	font-weight: 600;
	white-space: nowrap;
}

.vv-bundle__price {
	min-width: 5.5rem;
	text-align: right;
	font-weight: 600;
	white-space: nowrap;
}

.vv-bundle__saving {
	margin: 0.6rem 0 0;
	color: #1e8e4a;
	font-weight: 600;
}

@media (max-width: 480px) {
	.vv-bundle__item {
		grid-template-columns: 44px 1fr auto;
	}

	.vv-bundle__price {
		grid-column: 2 / -1;
		text-align: left;
	}
}

/* ---------- Tarjeta: elevación y segunda imagen ---------- */
.vv-card {
	border-radius: 24px;
	padding: 10px 10px 14px;
	transition: box-shadow 0.35s ease, transform 0.35s ease, background 0.35s;
}

@media (hover: hover) {
	.vv-card:hover {
		background: #fff;
		box-shadow: 0 18px 40px -12px rgba(45, 45, 58, 0.22);
		transform: translateY(-4px);
	}
}

.vv-card__img--alt {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.45s ease, transform 0.6s ease;
}

@media (hover: hover) {
	.vv-card:hover .vv-card__img--alt {
		opacity: 1;
	}

	.vv-card:has(.vv-card__img--alt):hover .vv-card__img:not(.vv-card__img--alt) {
		opacity: 0;
	}
}

.vv-card__img:not(.vv-card__img--alt) {
	transition: opacity 0.45s ease, transform 0.6s ease;
}

/* En móvil (tarjetas a dos columnas) el botón no debe partirse en dos líneas. */
@media (max-width: 480px) {
	.vv-card__btn.button,
	a.vv-card__btn,
	button.vv-card__btn {
		gap: 0.3em;
		padding: 0.5rem 0.75rem;
		font-size: 0.66rem;
		letter-spacing: 0.01em;
		white-space: nowrap;
	}

	.vv-card__btn .vv-icon {
		width: 13px;
		height: 13px;
	}
}


/* ===== Tablas comparativas (fichas y categorías) ===== */
.vv-compare{margin:1.5rem 0;overflow-x:auto;max-width:100%}
.vv-compare table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:.92rem;line-height:1.45}
.vv-compare th,.vv-compare td{padding:.7rem .75rem;vertical-align:top;text-align:left;word-break:normal;overflow-wrap:anywhere;hyphens:auto}
.vv-compare thead th{font-weight:700;border-bottom:2px solid currentColor}
.vv-compare th,.vv-compare td{width:auto!important}
.vv-compare th:first-child,.vv-compare td:first-child{width:18%!important}
.vv-compare tbody tr{border-bottom:1px solid #e5e5e5}
.vv-compare tbody tr:nth-child(even){background:rgba(0,0,0,.025)}
.vv-compare td:first-child{font-weight:600}
@media (max-width:781px){
 .vv-compare{overflow:visible}
 .vv-compare table,.vv-compare tbody,.vv-compare tr,.vv-compare td{display:block;width:100%!important}
 .vv-compare thead{display:none}
 .vv-compare tbody tr{border:1px solid #e5e5e5;border-radius:8px;margin:0 0 .9rem;padding:.4rem .9rem;background:#fff}
 .vv-compare tbody tr:nth-child(even){background:#fff}
 .vv-compare td{display:flex;gap:.75rem;padding:.4rem 0;border-bottom:1px solid #f0f0f0}
 .vv-compare td:last-child{border-bottom:0}
 .vv-compare td::before{content:attr(data-label);flex:0 0 40%;font-weight:600;color:#555}
 .vv-compare td:first-child{font-size:1rem;padding:.5rem 0}
 .vv-compare td:first-child::before{display:none}
 .vv-compare td,.vv-compare td:first-child{width:100%!important;box-sizing:border-box;background:transparent!important;border-left:0!important;border-right:0!important;border-top:0!important}
 .vv-compare table{border:0!important;background:transparent!important}
 .vv-compare tbody tr{box-sizing:border-box}
}

/* Comparativa: acordeón en móvil y modelo actual */
.vv-compare__tools,.vv-compare__sum,.vv-compare__go{display:none}
.vv-compare__tag{display:inline-block;font-size:.72rem;font-weight:600;line-height:1.4;border-radius:20px;padding:1px 8px;margin-left:6px;vertical-align:middle;background:var(--wp--preset--color--primary,#c62828);color:#fff}
.vv-compare tr.is-current td:first-child{font-weight:700}
@media (max-width:781px){
 .vv-compare__tools{display:flex;justify-content:flex-end;margin:0 0 .5rem}
 .vv-compare__tools button{background:none;border:0;padding:4px;font:inherit;font-size:.85rem;font-weight:600;color:var(--wp--preset--color--primary,#c62828);cursor:pointer}
 .vv-acc tbody tr{padding:0 .9rem}
 .vv-acc tbody tr.is-current{border-color:var(--wp--preset--color--primary,#c62828)!important;box-shadow:0 0 0 1px var(--wp--preset--color--primary,#c62828) inset}
 .vv-acc tbody tr td:not(:first-child){display:none}
 .vv-acc tbody tr.is-open td:not(:first-child){display:flex}
 .vv-acc tbody tr td:first-child{display:block;position:relative;padding:.75rem 2.2rem .75rem 0;cursor:pointer;border-bottom:0!important}
 .vv-acc tbody tr.is-open td:first-child{border-bottom:1px solid #f0f0f0!important}
 .vv-acc tbody tr td:first-child::after{content:"";position:absolute;right:.1rem;top:50%;width:.55rem;height:.55rem;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-70%) rotate(45deg);transition:transform .2s;opacity:.6}
 .vv-acc tbody tr.is-open td:first-child::after{transform:translateY(-30%) rotate(-135deg)}
 .vv-acc .vv-compare__sum{display:block;font-size:.82rem;font-weight:400;opacity:.7;margin-top:2px}
 .vv-acc tr.is-open .vv-compare__sum{display:none}
 .vv-acc tr.is-open td.vv-compare__go{display:block}
 .vv-acc td.vv-compare__go::before{display:none}
 .vv-acc td.vv-compare__go a{font-weight:600;font-size:.88rem}
}
