/* VEIL sticky add to cart — mobile-first.
   Colores: sobrescribe las variables en Elementor > Ajustes del sitio > CSS personalizado:
   .veil-sticky { --vs-accent: #2f6b86; } */

.veil-sticky {
	--vs-accent: #004a17;
	--vs-accent-text: #fff;
	--vs-accent-hover: #00330f;
	--vs-bg: #fff;
	--vs-text: #333;
	--vs-muted: #6b716d;
	--vs-line: #d9dfda;
	--vs-radius: 10px;
	--vs-pill-on-bg: #e8f1ea;
	--vs-price: #004a17;
	--vs-font: Poppins, system-ui, -apple-system, 'Segoe UI', sans-serif;
	display: none;
}

.veil-sticky.vs-ready {
	display: block;
}

.veil-sticky *,
.veil-sticky *::before,
.veil-sticky *::after {
	box-sizing: border-box;
}

html.vs-lock {
	overflow: hidden;
}

body.veil-sticky-on {
	padding-bottom: var(--vs-h, 0);
}

/* ---------- barra ---------- */
.vs-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
	background: var(--vs-bg);
	border-top: 1px solid var(--vs-line);
	box-shadow: 0 -4px 18px rgba(0, 0, 0, .08);
	color: var(--vs-text);
	font-family: var(--vs-font);
	font-size: 14px;
	line-height: 1.3;
	transform: translateY(110%);
	visibility: hidden;
	transition: transform .25s ease, visibility 0s linear .25s;
}

.veil-sticky.is-visible .vs-bar {
	transform: none;
	visibility: visible;
	transition: transform .25s ease;
}

.vs-info {
	flex: 1 1 auto;
	min-width: 0;
}

.vs-name {
	display: none;
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vs-line {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.vs-summary {
	order: -1;
	overflow: hidden;
	font-size: 12px;
	color: var(--vs-muted);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.veil-sticky:not(.has-summary) .vs-summary {
	display: none;
}

.vs-price {
	white-space: nowrap;
	font-weight: 600;
	color: var(--vs-price);
}

.vs-price .price,
.vs-price ins {
	text-decoration: none;
}

.vs-price del {
	margin-right: 4px;
	font-weight: 400;
	color: var(--vs-muted);
}

.vs-price--bar,
.vs-opts,
.vs-qty.vs-qty--desktop {
	display: none;
}

.veil-sticky .vs-cta {
	flex: none;
	border-radius: 999px;
	min-height: 46px;
	padding: 0 20px;
	border: 0;
	background: var(--vs-accent);
	color: var(--vs-accent-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.veil-sticky .vs-cta:focus-visible,
.veil-sticky .vs-pill:focus-visible,
.veil-sticky .vs-qty__btn:focus-visible,
.veil-sticky .vs-panel__close:focus-visible,
.veil-sticky .vs-info--tap:focus-visible {
	outline: 2px solid var(--vs-text);
	outline-offset: 2px;
}

.veil-sticky .vs-cta:hover,
.veil-sticky .vs-cta:focus,
.veil-sticky .vs-cta:active {
	background: var(--vs-accent-hover);
	color: var(--vs-accent-text);
	text-decoration: none;
}

.veil-sticky .vs-cta.is-muted,
.veil-sticky .vs-cta:disabled {
	background: #b7beb9;
	color: #fff;
	cursor: not-allowed;
}

.veil-sticky .vs-cta.is-done {
	background: #2f6b3d;
}

/* ---------- cantidad ---------- */
.vs-qty {
	display: inline-flex;
	flex: none;
	align-items: center;
	border: 1px solid var(--vs-line);
	border-radius: var(--vs-radius);
	background: var(--vs-bg);
}

.veil-sticky .vs-qty__btn {
	width: 38px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--vs-text);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.veil-sticky .vs-qty__input {
	width: 42px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--vs-text);
	font: inherit;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.veil-sticky .vs-qty__input::-webkit-outer-spin-button,
.veil-sticky .vs-qty__input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

/* ---------- opciones ---------- */
.vs-group {
	margin: 0 0 14px;
}

.vs-label {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	text-transform: capitalize;
}

.vs-label__val {
	text-transform: none;
	font-weight: 600;
	color: var(--vs-accent);
}

.vs-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.veil-sticky .vs-pill {
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid var(--vs-accent);
	border-radius: 999px;
	background: var(--vs-bg);
	color: var(--vs-text);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.veil-sticky .vs-pill.is-on {
	border-color: var(--vs-accent);
	background: var(--vs-accent);
	color: var(--vs-accent-text);
	font-weight: 600;
}

.veil-sticky .vs-pill.vs-dot {
	width: 40px;
	min-width: 40px;
	height: 40px;
	min-height: 40px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px #9aa59d;
	background-size: cover;
	background-position: center;
}

.veil-sticky .vs-pill.vs-dot.is-on {
	border-color: #fff;
	box-shadow: 0 0 0 3px var(--vs-accent);
}

.veil-sticky .vs-pill:disabled {
	border-color: var(--vs-line);
	opacity: .4;
	text-decoration: line-through;
	cursor: not-allowed;
}

.veil-sticky .vs-select {
	width: 100%;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--vs-line);
	border-radius: var(--vs-radius);
	background: var(--vs-bg);
	color: var(--vs-text);
	font: inherit;
}

.veil-sticky .vs-pickbtn {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	padding: 4px 40px 4px 12px;
	border: 1px solid var(--vs-line);
	border-radius: var(--vs-radius);
	background: var(--vs-bg);
	color: var(--vs-text);
	font: inherit;
	text-align: left;
	text-transform: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.veil-sticky .vs-pickbtn::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 14px;
	width: 14px;
	height: 9px;
	margin-top: -4px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%23004a17' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 9px no-repeat;
}

.veil-sticky .vs-pickbtn:hover,
.veil-sticky .vs-pickbtn:focus,
.veil-sticky .vs-pickbtn:active {
	border-color: var(--vs-line);
	background: var(--vs-bg);
	color: var(--vs-text);
}

.veil-sticky .vs-pickbtn:focus-visible {
	outline: 2px solid var(--vs-text);
	outline-offset: 2px;
}

.vs-pickbtn__thumb {
	flex: none;
	width: 32px;
	height: 32px;
	overflow: hidden;
	border: 1px solid var(--vs-line);
	border-radius: 50%;
	background: #fff;
}

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

.vs-pickbtn__text {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- hoja inferior (móvil) ---------- */
.vs-sheet {
	position: fixed;
	inset: 0;
	z-index: 1000;
	visibility: hidden;
	pointer-events: none;
}

.vs-sheet.is-open {
	visibility: visible;
	pointer-events: auto;
}

.vs-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	transition: opacity .2s ease;
}

.vs-sheet.is-open .vs-backdrop {
	opacity: 1;
}

.vs-panel {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	max-height: 85vh;
	max-height: 85dvh;
	overflow-y: auto;
	padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
	border-radius: 16px 16px 0 0;
	background: var(--vs-bg);
	color: var(--vs-text);
	transform: translateY(100%);
	transition: transform .25s ease;
	outline: none;
}

.vs-sheet.is-open .vs-panel {
	transform: none;
}

.vs-panel__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 14px;
}

.vs-panel__title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.veil-sticky .vs-panel__close {
	flex: none;
	width: 40px;
	height: 40px;
	margin: -8px -8px 0 0;
	border: 0;
	background: transparent;
	color: var(--vs-text);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.vs-panel__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 6px 0 12px;
}

.vs-price--sheet {
	font-size: 18px;
}

.vs-panel .vs-cta {
	width: 100%;
}

/* ---------- ayuda cuando falta elegir (escritorio) ---------- */
.vs-need {
	outline: 2px solid var(--vs-accent);
	outline-offset: 4px;
	border-radius: 8px;
}

/* ---------- producto simple en móvil: cantidad en la barra ---------- */
.vs--simple .vs-bar {
	gap: 8px;
}

.vs--simple .vs-qty__btn {
	width: 32px;
}

.vs--simple .vs-qty__input {
	width: 34px;
}

.vs--simple .vs-cta {
	padding: 0 16px;
}

/* ---------- tablet y escritorio ---------- */
@media (min-width: 1024px) {
	.vs-bar {
		justify-content: center;
		gap: 18px;
		padding-left: max(24px, calc((100% - 1200px) / 2));
		padding-right: max(24px, calc((100% - 1200px) / 2));
	}

	.vs-name {
		display: block;
	}

	.vs-line .vs-price--line {
		display: none;
	}

	/* En escritorio las opciones elegidas ya se ven en los botones: el resumen sobra. */
	.vs-summary {
		display: none;
	}

	.vs-info {
		flex: 0 1 260px;
	}

	.vs-opts {
		display: flex;
		flex: 1 1 auto;
		flex-wrap: wrap;
		gap: 4px 22px;
		min-width: 0;
		max-height: 30vh;
		overflow-y: auto;
	}

	.vs-opts .vs-group {
		margin: 0;
	}

	.vs-opts .vs-label {
		margin-bottom: 4px;
		font-size: 12px;
	}

	.vs-opts .vs-pill {
		min-height: 34px;
		padding: 0 13px;
		font-size: 13px;
	}

	.vs-opts .vs-select {
		min-width: 150px;
		min-height: 38px;
	}

	.vs-opts .vs-pickbtn {
		min-width: 190px;
		max-width: 260px;
		min-height: 38px;
		padding-top: 2px;
		padding-bottom: 2px;
	}

	.vs-opts .vs-pickbtn__thumb {
		width: 28px;
		height: 28px;
	}

	.vs-price--bar {
		display: block;
		flex: none;
		font-size: 18px;
	}

	.vs-qty.vs-qty--desktop {
		display: inline-flex;
	}

	.vs-sheet {
		display: none;
	}

	.vs--simple .vs-info {
		flex: 1 1 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vs-bar,
	.vs-panel,
	.vs-backdrop {
		transition: none;
	}
}

/* El tema reinicia botones con color rosa al pasar el mouse o enfocar: se neutraliza aquí. */
.veil-sticky .vs-pill:hover,
.veil-sticky .vs-pill:focus,
.veil-sticky .vs-pill:active {
	border-color: var(--vs-accent);
	background: var(--vs-pill-on-bg);
	color: var(--vs-text);
}

.veil-sticky .vs-pill.is-on:hover,
.veil-sticky .vs-pill.is-on:focus,
.veil-sticky .vs-pill.is-on:active {
	border-color: var(--vs-accent);
	background: var(--vs-accent);
	color: var(--vs-accent-text);
}

.veil-sticky .vs-qty__btn:hover,
.veil-sticky .vs-qty__btn:focus,
.veil-sticky .vs-qty__btn:active,
.veil-sticky .vs-panel__close:hover,
.veil-sticky .vs-panel__close:focus {
	background: transparent;
	color: var(--vs-accent);
}

/* Móvil, producto variable: tocar el resumen abre las opciones para cambiarlas. */
.vs-info--tap {
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.vs-info--tap .vs-line::after {
	content: "";
	position: absolute;
	width: 0;
	height: 0;
}

@media (max-width: 1023px) {
	.vs-info--tap .vs-price--line::after {
		content: "";
		display: inline-block;
		width: 7px;
		height: 7px;
		margin: 0 0 3px 8px;
		border-right: 2px solid var(--vs-accent);
		border-bottom: 2px solid var(--vs-accent);
		transform: rotate(-135deg);
	}
}

@media (min-width: 1024px) {
	.vs-info--tap {
		cursor: default;
	}
}

.veil-sticky .vs-cta.is-muted:hover,
.veil-sticky .vs-cta:disabled:hover {
	background: #b7beb9;
}

.veil-sticky .vs-cta.is-done:hover {
	background: #2f6b3d;
}

/* ---------- disponibilidad ---------- */
.vs-pricebox {
	min-width: 0;
}

.vs-stock {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 2px;
	font-size: 13px;
	font-weight: 500;
	color: var(--vs-accent);
}

.vs-stock:empty {
	display: none;
}

.vs-stock::before {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.vs-stock.is-out {
	color: #a33232;
}

.vs-stock--line {
	display: none;
}

@media (min-width: 1024px) {
	.vs-stock--line {
		display: flex;
		font-size: 12px;
	}

	.vs-stock--line:empty {
		display: none;
	}
}

/* ---------- tablet (768–1023 px): misma barra compacta + hoja de opciones que el móvil ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
	.vs-bar {
		padding-left: 24px;
		padding-right: 24px;
		gap: 16px;
	}

	.vs-info {
		flex: 1 1 auto;
	}

	.vs-name {
		display: block;
		font-size: 14px;
	}

	.vs-line {
		flex-direction: row;
		align-items: center;
		gap: 10px;
	}

	.vs-summary {
		order: 0;
	}

	.vs-stock--line {
		display: flex;
	}

	.vs-stock--line:empty {
		display: none;
	}

	.vs-panel {
		left: 50%;
		right: auto;
		width: min(560px, 100%);
		transform: translate(-50%, 100%);
	}

	.vs-sheet.is-open .vs-panel {
		transform: translate(-50%, 0);
	}

	.veil-sticky .vs-cta {
		min-width: 190px;
	}
}

.veil-sticky .vs-pill.vs-dot:hover,
.veil-sticky .vs-pill.vs-dot:focus,
.veil-sticky .vs-pill.vs-dot:active {
	box-shadow: 0 0 0 2px var(--vs-accent);
	border-color: #fff;
}

.veil-sticky .vs-pill.vs-dot.is-on:hover,
.veil-sticky .vs-pill.vs-dot.is-on:focus {
	box-shadow: 0 0 0 3px var(--vs-accent);
}

/* ---------- móvil (menos de 768 px): precio en oferta apilado y barra más compacta ----------
   El precio regular tachado va pequeño encima del precio de oferta, para que no choque con la cantidad y el botón. */
@media (max-width: 767px) {
	.vs-price--line .price {
		display: inline-block;
		vertical-align: middle;
	}

	.vs-price--line del,
	.vs-price--line ins {
		display: block;
		margin: 0;
	}

	.vs-price--line del {
		font-size: 12px;
		line-height: 1.15;
	}

	.vs-info {
		flex: 1 0 auto;
	}
}

@media (max-width: 430px) {
	.vs-bar {
		gap: 8px;
		padding-left: 10px;
		padding-right: 10px;
	}

	.veil-sticky .vs-qty__btn {
		width: 32px;
	}

	.veil-sticky .vs-qty__input {
		width: 30px;
	}

	.veil-sticky .vs-cta {
		padding: 0 14px;
	}
}
