.rcw-caja {
	--rcw-acento: #1f5fbf;
	--rcw-borde: #d7dbe0;
	--rcw-fondo: #fff;
	--rcw-suave: #f5f7fa;
	max-width: 620px;
	margin: 0 auto 2rem;
	padding: 1.75rem;
	background: var(--rcw-fondo);
	border: 1px solid var(--rcw-borde);
	border-radius: 10px;
	box-sizing: border-box;
}
.rcw-caja *, .rcw-caja *::before, .rcw-caja *::after { box-sizing: border-box; }

/* Pestañas */
.rcw-tabs__nav { display: flex; gap: .25rem; margin: -.5rem 0 1.5rem; border-bottom: 1px solid var(--rcw-borde); }
.rcw-tab {
	flex: 1; padding: .8rem 1rem; background: none; border: 0; border-bottom: 3px solid transparent;
	font: inherit; font-weight: 600; color: #667; cursor: pointer; margin-bottom: -1px;
}
.rcw-tab[aria-selected="true"] { color: var(--rcw-acento); border-bottom-color: var(--rcw-acento); }

/* Formularios */
.rcw-form { display: flex; flex-direction: column; gap: 1rem; }
.rcw-form h4 { margin: .5rem 0 0; font-size: 1rem; }
.rcw-grupo { display: flex; flex-direction: column; gap: 1rem; }
.rcw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rcw-campo { display: flex; flex-direction: column; gap: .35rem; }
.rcw-campo label { font-weight: 600; font-size: .92rem; }
.rcw-campo small { color: #667; font-size: .8rem; }
.rcw-campo input {
	width: 100%; padding: .65rem .8rem; border: 1px solid var(--rcw-borde); border-radius: 6px; font: inherit;
}
.rcw-campo input:focus { outline: 2px solid var(--rcw-acento); outline-offset: -1px; border-color: var(--rcw-acento); }
.rcw-campo input.rcw-invalido { border-color: #c62828; }

.rcw-tipo { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.rcw-tipo legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }
.rcw-opcion { position: relative; cursor: pointer; }
.rcw-opcion input { position: absolute; opacity: 0; }
.rcw-opcion span {
	display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem;
	border: 2px solid var(--rcw-borde); border-radius: 8px; transition: border-color .15s, background .15s;
}
.rcw-opcion small { color: #667; font-size: .82rem; }
.rcw-opcion input:checked + span { border-color: var(--rcw-acento); background: var(--rcw-suave); }
.rcw-opcion input:focus-visible + span { outline: 2px solid var(--rcw-acento); outline-offset: 2px; }

.rcw-fila { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.rcw-fila--between { justify-content: space-between; }
.rcw-check { display: flex; gap: .5rem; align-items: center; font-size: .92rem; }

.rcw-btn {
	display: inline-block; padding: .8rem 1.4rem; border: 0; border-radius: 6px;
	background: var(--rcw-acento, #1f5fbf); color: #fff !important; font: inherit; font-weight: 600;
	text-align: center; text-decoration: none; cursor: pointer;
}
.rcw-btn:hover { filter: brightness(1.1); }
.rcw-btn--sec { background: var(--rcw-suave, #f5f7fa); color: #222 !important; border: 1px solid var(--rcw-borde, #d7dbe0); }

.rcw-errores { background: #fdecea; border-left: 4px solid #c62828; padding: .75rem 1rem; border-radius: 4px; }
.rcw-errores ul { margin: 0; padding-left: 1.1rem; }
.rcw-ok { background: #e8f5e9; border-left: 4px solid #2e7d32; padding: .75rem 1rem; border-radius: 4px; }
.rcw-cambiar { text-align: center; margin: 1.25rem 0 0; font-size: .92rem; }

.rcw-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.rcw-credito-badge {
	display: inline-block; padding: .6rem 1rem; border-radius: 6px; background: #eef4fd; color: #123;
}
.rcw-credito-badge strong { font-size: 1.15em; }
.rcw-mi-credito { margin-top: 1.5rem; }
.rcw-ver-precio { font-size: .9em; font-weight: 600; }
.rcw-aviso-precio { margin-bottom: .5rem; }

.rcw-caja [hidden] { display: none !important; }

@media (max-width: 560px) {
	.rcw-caja { padding: 1.25rem 1rem; }
	.rcw-grid, .rcw-tipo { grid-template-columns: 1fr; }
}

/* Texto "Inicia sesión para ver precio" */
.rcw-ver-precio { display: inline-flex; align-items: center; gap: .35em; text-decoration: none; }
.rcw-ver-precio:hover { text-decoration: underline; }
.rcw-ver-precio__icono { flex: none; }

/* Ícono de cuenta (menú / shortcode) */
.rcw-cuenta-wrap { display: inline-flex; align-items: center; gap: .75em; }
.rcw-cuenta,
.rcw-cuenta-item > a { display: inline-flex !important; align-items: center; gap: .4em; text-decoration: none; color: inherit; }
.rcw-cuenta__icono { flex: none; }
.rcw-cuenta__salir { font-size: .85em; opacity: .75; color: inherit; }
.rcw-cuenta__salir:hover { opacity: 1; }

/* Aviso de bienvenida */
.rcw-toast {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 99999;
	max-width: calc(100% - 32px); padding: .85rem 1.25rem; border-radius: 8px;
	background: #1e293b; color: #fff; font-size: .95rem; box-shadow: 0 8px 24px rgba(0,0,0,.2);
	transition: opacity .4s, transform .4s;
}
.rcw-toast--fuera { opacity: 0; transform: translate(-50%, 10px); pointer-events: none; }


/* Botón para visitantes en el catálogo: que no se corte en tarjetas angostas */

/* Submenú de cuenta (cliente con sesión) */
.rcw-cuenta-wrap--submenu {
	--rcw-sub-fondo: #fff;
	--rcw-sub-texto: #1f2937;
	--rcw-sub-hover: #f3f4f6;
	--rcw-sub-acento: #4caf50;
	position: relative;
}
.rcw-cuenta-wrap--submenu .rcw-cuenta { cursor: pointer; }
.rcw-cuenta__caret { flex: none; transition: transform .2s; }
.rcw-abierto .rcw-cuenta__caret { transform: rotate(180deg); }
.rcw-submenu {
	position: absolute; top: 100%; right: 0; z-index: 9999;
	min-width: 200px; margin: 8px 0 0; padding: 6px 0; list-style: none;
	background: var(--rcw-sub-fondo); border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.06);
	opacity: 0; visibility: hidden; transform: translateY(-4px);
	transition: opacity .15s, transform .15s, visibility .15s;
	text-transform: none; letter-spacing: normal;
}
/* Puente invisible para que el mouse no "caiga" entre el ícono y el submenú */
.rcw-submenu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.rcw-abierto > .rcw-submenu { opacity: 1; visibility: visible; transform: none; }
.rcw-submenu li { margin: 0; padding: 0; }
.rcw-submenu__item {
	display: block; padding: .6rem 1.1rem; white-space: nowrap;
	color: var(--rcw-sub-texto) !important; text-decoration: none !important; font-size: .95rem;
}
.rcw-submenu__item:hover, .rcw-submenu__item:focus { background: var(--rcw-sub-hover); color: var(--rcw-sub-acento) !important; outline: none; }
.rcw-submenu__item--salir { border-top: 1px solid rgba(0,0,0,.08); margin-top: 4px; }
.rcw-submenu__item--carrito { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.rcw-carrito-num {
	min-width: 1.4em; height: 1.4em; padding: 0 .4em; border-radius: 999px;
	background: var(--rcw-sub-acento, #4caf50); color: #fff; font-size: .75rem; font-weight: 600;
	display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.rcw-carrito-num--vacio { display: none; }

/* ===== Responsivo ===== */

/* Botón "Crear cuenta o iniciar sesión" (catálogo y ficha) */
.rcw-btn-login {
	display: inline-flex !important; align-items: center; justify-content: center;
	max-width: 100%; box-sizing: border-box;
	white-space: normal !important; text-align: center; line-height: 1.3 !important;
	overflow-wrap: anywhere; height: auto !important;
}
/* En las tarjetas del catálogo ocupa el ancho de la tarjeta */
.products .product .rcw-btn-login,
.elementor-widget-woocommerce-products .rcw-btn-login,
.elementor-widget-loop-grid .rcw-btn-login,
.wc-block-grid__product .rcw-btn-login { display: flex !important; width: 100%; }

@media (max-width: 767px) {
	/* Catálogo: botón más compacto para tarjetas angostas (2 columnas en celular) */
	.products .product .rcw-btn-login,
	.elementor-widget-woocommerce-products .rcw-btn-login,
	.elementor-widget-loop-grid .rcw-btn-login,
	.wc-block-grid__product .rcw-btn-login {
		padding: .55em .6em !important; font-size: .82rem !important; min-height: 2.6em;
	}
	/* Ficha del producto: botón a lo ancho, fácil de tocar */
	.single-product .summary .rcw-btn-login,
	.elementor-widget-woocommerce-product-add-to-cart .rcw-btn-login {
		display: flex !important; width: 100%; padding: .85em 1em !important; font-size: 1rem !important;
	}
}

/* Submenú de cuenta: nunca más ancho que la pantalla */
.rcw-submenu { max-width: calc(100vw - 24px); box-sizing: border-box; }
.rcw-submenu__item { white-space: normal; }
@media (max-width: 767px) {
	.rcw-submenu { min-width: 210px; }
	.rcw-submenu__item { padding: .8rem 1.1rem; font-size: 1rem; } /* zonas de toque de 44px aprox. */
}
@media (max-width: 480px) {
	/* En celulares chicos: solo el ícono, sin texto, para que no empuje el menú */
	.rcw-cuenta-wrap .rcw-cuenta__texto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.rcw-cuenta-wrap .rcw-cuenta__icono { width: 22px; height: 22px; }
}

/* CAPTCHA (Turnstile) */
.rcw-captcha { min-height: 65px; }
