/**
 * Estilos base del widget "Planes Hebra360". Los colores/tipografías finos se
 * controlan desde Elementor; aquí va solo la estructura (grid, tabs, tarjeta).
 */

.hebra360-plans {
	/* Acento de marca de Hebra360 (morado). Se puede sobrescribir desde Elementor. */
	--h360-brand: #b026ff;
	--h360-brand-contrast: #ffffff;
}

.hebra360-plans__topbar {
	display: flex;
	justify-content: center;
	margin: 0 0 1.5rem;
}

.hebra360-plans__topbar:empty {
	display: none;
}

.hebra360-plans .hebra360-currency-selector {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 999px;
	padding: 0.35em 0.9em;
	/* Todo el contenedor es la zona de clic. */
	cursor: pointer;
	user-select: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.hebra360-plans .hebra360-currency-selector:hover {
	border-color: var(--h360-brand);
}

.hebra360-plans .hebra360-currency-selector:focus,
.hebra360-plans .hebra360-currency-selector.is-open {
	outline: none;
	border-color: var(--h360-brand);
	box-shadow: 0 0 0 3px rgba(176, 38, 255, 0.18);
}

.hebra360-plans .hebra360-currency-selector .hebra360-currency__label {
	margin: 0;
	font-weight: 600;
	pointer-events: none;
}

.hebra360-plans .hebra360-currency__value {
	font-weight: 600;
	pointer-events: none;
}

.hebra360-plans .hebra360-currency__arrow {
	display: inline-flex;
	align-items: center;
	pointer-events: none;
	transition: transform 0.2s ease;
}

.hebra360-plans .hebra360-currency-selector.is-open .hebra360-currency__arrow {
	transform: rotate(180deg);
}

/* Fallback sin JS: el <select> nativo cubre todo el pill y queda invisible, de
   modo que un clic en cualquier punto del contenedor abre el desplegable. */
.hebra360-plans .hebra360-currency-select {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	font: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

/* Con JS activo, el desplegable custom sustituye al <select> nativo. */
.hebra360-plans .hebra360-currency-selector.is-enhanced .hebra360-currency-select {
	display: none;
}

/* ── Desplegable estilo Material UI ─────────────────────────────────────────── */
.hebra360-currency__menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%) scale(0.9);
	transform-origin: top center;
	z-index: 999;
	min-width: 100%;
	width: max-content;
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
	background: #fff;
	color: #1b1c19;
	border-radius: 8px;
	box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
		0 8px 10px 1px rgba(0, 0, 0, 0.14),
		0 3px 14px 2px rgba(0, 0, 0, 0.12);
	opacity: 0;
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: none;
}

.hebra360-currency__menu.is-open {
	opacity: 1;
	transform: translateX(-50%) scale(1);
	pointer-events: auto;
}

.hebra360-currency__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 1rem;
	font: inherit;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.12s ease;
}

.hebra360-currency__option:hover,
.hebra360-currency__option.is-active {
	background: rgba(0, 0, 0, 0.06);
}

.hebra360-currency__option.is-selected {
	color: var(--h360-brand);
	font-weight: 600;
	background: rgba(176, 38, 255, 0.08);
}

.hebra360-currency__option .hebra360-currency__check {
	width: 18px;
	height: 18px;
	opacity: 0;
}

.hebra360-currency__option.is-selected .hebra360-currency__check {
	opacity: 1;
}

.hebra360-plans__tabs-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.hebra360-plans__tab {
	cursor: pointer;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: transparent;
	padding: 0.6em 1.2em;
	border-radius: 999px;
	font: inherit;
	line-height: 1.2;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.hebra360-plans__tab.is-active {
	background: var(--h360-brand);
	color: var(--h360-brand-contrast);
	border-color: var(--h360-brand);
}

.hebra360-plans__panel {
	display: none;
}

.hebra360-plans__panel.is-active {
	display: block;
}

.hebra360-plans__grid {
	display: grid;
	grid-template-columns: repeat(var(--h360-cols, 3), minmax(0, 1fr));
	gap: 1.5rem;
}

.hebra360-plans__card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	padding: 1.5rem;
	background: #fff;
}

.hebra360-plans__card.is-featured {
	border-color: var(--h360-brand);
	box-shadow: 0 8px 30px rgba(176, 38, 255, 0.15);
}

.hebra360-plans__image img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

.hebra360-plans__title {
	margin: 0;
}

.hebra360-plans__price {
	font-size: 1.4em;
	font-weight: 700;
	color: var(--h360-brand);
}

.hebra360-plans__price del {
	opacity: 0.6;
	font-weight: 400;
	margin-right: 0.4em;
}

.hebra360-plans__features {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.hebra360-plans__feature {
	display: flex;
	align-items: flex-start;
	gap: var(--h360-feature-gap, 0.5rem);
}

.hebra360-plans__feature-icon {
	flex: 0 0 auto;
	line-height: 1.4;
	color: var(--h360-brand);
	display: inline-flex;
	align-items: center;
}

.hebra360-plans__feature-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* El texto ocupa el hueco para que el costo del adicional quede a la derecha. */
.hebra360-plans__feature-text {
	flex: 1 1 auto;
}

/* Una feature que el plan no incluye se apaga; la que es adicional muestra su
   costo en la moneda del comprador. */
.hebra360-plans__feature.is-not-included .hebra360-plans__feature-icon {
	color: rgba(0, 0, 0, 0.35);
}

.hebra360-plans__feature.is-not-included .hebra360-plans__feature-text {
	opacity: 0.7;
}

.hebra360-plans__feature-price {
	flex: 0 0 auto;
	margin-left: auto;
	font-size: 0.85em;
	white-space: nowrap;
	border-radius: 999px;
	padding: 0 0.5em;
}

.hebra360-plans__feature-price .amount {
	font-weight: 600;
}

.hebra360-plans__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: auto;
}

.hebra360-plans__actions .button {
	flex: 1 1 auto;
	text-align: center;
	border-radius: 8px;
}

/* "Agregar al carrito": contorno de marca. */
.hebra360-plans__add {
	background: transparent;
	color: var(--h360-brand);
	border: 1px solid var(--h360-brand);
}

.hebra360-plans__add:hover {
	background: var(--h360-brand);
	color: var(--h360-brand-contrast);
}

/* "Comprar ahora": relleno de marca. */
.hebra360-plans__buy {
	background: var(--h360-brand);
	color: var(--h360-brand-contrast);
	border: 1px solid var(--h360-brand);
}

.hebra360-plans__buy:hover {
	filter: brightness(0.92);
	color: var(--h360-brand-contrast);
}

/* Estado de carga del AJAX add-to-cart (respaldo por si el CSS de WooCommerce no
   está en la página): atenúa el botón y muestra un spinner. */
.hebra360-plans .button.loading {
	position: relative;
	opacity: 0.75;
	pointer-events: none;
}

.hebra360-plans .button.loading::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 10px;
	width: 14px;
	height: 14px;
	margin-top: -7px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: hebra360-spin 0.7s linear infinite;
}

.hebra360-plans .button.added::after {
	content: "";
}

@keyframes hebra360-spin {
	to {
		transform: rotate(360deg);
	}
}

.hebra360-plans__empty {
	grid-column: 1 / -1;
	opacity: 0.7;
}
