/*
 * Los !important son deliberados: los temas (Electro entre ellos) dan estilo a
 * .button con selectores muy específicos y pisarían el color de WhatsApp.
 */
a.gpw-button,
a.gpw-button:focus,
a.gpw-button:visited {
	background-color: #25d366 !important;
	background-image: none !important;
	border-color: #25d366 !important;
	color: #fff !important;
}

a.gpw-button:hover,
a.gpw-button:active {
	background-color: #1ebe5a !important;
	border-color: #1ebe5a !important;
	color: #fff !important;
}

a.gpw-button::before {
	content: "" !important;
	display: block;
	flex: 0 0 auto;
	background: url(../img/whatsapp.svg) center / contain no-repeat;
}

/* Ficha de producto: botón con icono y texto. */
.gpw-single {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.6em;
	margin: 1em 0;
}

/* Botón de compartir: secundario, con borde en vez de relleno. */
.gpw-single a.gpw-button.gpw-button--share,
.gpw-single a.gpw-button.gpw-button--share:focus,
.gpw-single a.gpw-button.gpw-button--share:visited {
	background-color: #fff !important;
	border: 2px solid #25d366 !important;
	color: #128c7e !important;
}

.gpw-single a.gpw-button.gpw-button--share:hover,
.gpw-single a.gpw-button.gpw-button--share:active {
	background-color: #e9fbf0 !important;
	border-color: #1ebe5a !important;
	color: #128c7e !important;
}

.gpw-single a.gpw-button.gpw-button--share::before {
	background-image: url(../img/share.svg);
}

.gpw-single a.gpw-button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	width: auto;
	max-width: 100%;
	padding: 0.9em 1.8em;
	border-radius: 2em;
	font-weight: 600;
	line-height: 1.2;
	text-indent: 0;
	white-space: nowrap;
}

.gpw-single a.gpw-button::before {
	width: 1.5em;
	height: 1.5em;
}

/* Listados: botón redondo solo con el icono; el texto queda para lectores de pantalla (aria-label). */
a.gpw-button--loop {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 38px !important;
	height: 38px !important;
	min-width: 0;
	padding: 0 !important;
	border-radius: 50% !important;
	font-size: 0 !important;
	text-indent: 0 !important;
}

a.gpw-button--loop::before {
	width: 20px;
	height: 20px;
}

/* Listados con el carrito visible: los dos botones en columna, el de WhatsApp debajo. */
.add-to-cart-wrap:has(> a.gpw-button--loop):has(> a:not(.gpw-button)) {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}

/* Icono y panel del carrito de la cabecera: ocultos cuando WhatsApp sustituye al carrito en toda la tienda. */
.gpw-hide-cart .header-icon__cart,
.gpw-hide-cart .handheld-header-links li.cart,
.gpw-hide-cart .off-canvas-cart,
.gpw-hide-cart .site-header-cart,
.gpw-hide-cart .wc-block-mini-cart {
	display: none !important;
}

/* Botón flotante: círculo verde fijo en una esquina, solo el icono. */
a.gpw-float {
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	display: block;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #25d366 url(../img/whatsapp.svg) center / 32px no-repeat;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, background-color 0.15s ease;
}

a.gpw-float--right {
	right: 20px;
}

a.gpw-float--left {
	left: 20px;
}

a.gpw-float:hover,
a.gpw-float:focus-visible {
	background-color: #1ebe5a;
	transform: scale(1.06);
}

a.gpw-float:focus-visible {
	outline: 3px solid #128c7e;
	outline-offset: 3px;
}

/* Texto al pasar el ratón (solo en pantallas con ratón). */
a.gpw-float::after {
	content: attr(data-tooltip);
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	padding: 6px 10px;
	border-radius: 4px;
	background: #333;
	color: #fff;
	font-size: 13px;
	line-height: 1.3;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

a.gpw-float--right::after {
	right: calc(100% + 10px);
}

a.gpw-float--left::after {
	left: calc(100% + 10px);
}

@media (hover: hover) {
	a.gpw-float:hover::after,
	a.gpw-float:focus-visible::after {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	a.gpw-float {
		transition: none;
	}
}
