/* ==========================================================================
   Formulario de pago (inc/formulario/formulario-pago.php)
   Usa los tokens de diseño del tema (main.css).
   ========================================================================== */

/* Página sin barra lateral, todo centrado */
.page-form.home-content {
	grid-template-columns: minmax(0, 1fr);
	padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.page-form .single-post__content {
	max-width: none;
}

/* Fondo blanco en formulario, checkout y página de gracias */
html:has(body.tfp-bare),
.tfp-bare,
.tfp-bare .site-main {
	background: #ffffff;
}

/* Sin header ni footer: formulario, checkout y página de gracias */
.tfp-bare .site-header,
.tfp-bare .site-footer {
	display: none;
}

/* Formulario centrado vertical y horizontalmente */
.tfp-bare .site-main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100vh;
	min-height: 100svh;
}

.tfp-bare .page-form.home-content {
	padding-block: clamp(1.5rem, 4vw, 3rem);
}

.tfp {
	--tfp-radius: 8px;
	max-width: 760px;
	margin: 0 auto;
}

.tfp__card {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
	color: #1a1a1a;
}

/* Logo */
.tfp__logo {
	display: flex;
	justify-content: center;
	margin-bottom: 2rem;
}

.tfp__logo img,
.tfp__logo .custom-logo {
	display: block;
	width: auto;
	max-width: 220px;
	max-height: 80px;
	height: auto;
}

.tfp__logo-text {
	font-family: var(--font-display);
	font-size: 1.6rem;
	font-weight: 800;
	color: #111111;
}

/* Errores */
.tfp__errors {
	margin-bottom: 1.25rem;
	padding: 0.85rem 1.1rem;
	border: 1px solid var(--color-accent);
	border-radius: var(--radius);
	background: #fdecec;
	color: #7a0001;
	font-size: 0.95rem;
}

.tfp__errors ul {
	margin: 0;
	padding-left: 1.1rem;
}

/* Layout */
.tfp__form {
	display: grid;
	gap: 1rem;
}

.tfp__row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.tfp__field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-width: 0;
}

.tfp__field label {
	font-family: var(--font-display);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #4a4a4a;
	margin: 0;
}

.tfp__req {
	color: var(--color-accent);
}

/* Inputs */
.tfp__field input[type="text"],
.tfp__field input[type="email"],
.tfp__field input[type="tel"] {
	width: 100%;
	height: 3rem;
	padding: 0 1rem;
	border: 1px solid #d6d6d6;
	border-radius: var(--tfp-radius);
	background: #ffffff;
	color: #111111;
	font-family: var(--font-sans);
	font-size: 1rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tfp__field input::placeholder {
	color: #a3a3a3;
}

.tfp__field input:focus {
	outline: none;
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.tfp__field input.is-invalid,
.tfp__money:has( input.is-invalid ) {
	border-color: var(--color-accent-hover);
}

/* Teléfono con prefijo */
.tfp__phone {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
}

.tfp__phone > input {
	flex: 1;
	min-width: 0;
}

.tfp__phone select {
	flex: 0 0 auto;
	width: 10rem;
	height: 3rem;
	padding: 0 0.75rem;
	border: 1px solid #d6d6d6;
	border-radius: var(--tfp-radius);
	background: #ffffff;
	color: #111111;
	font-family: var(--font-sans);
	font-size: 1rem;
	text-overflow: ellipsis;
}

/* Con JS se oculta el select y se usa el selector con bandera */
.tfp__phone.is-enhanced select {
	display: none;
}

.tfp-cc {
	position: relative;
	flex: 0 0 auto;
}

.tfp-cc__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	height: 3rem;
	padding: 0 0.85rem;
	border: 1px solid #d6d6d6;
	border-radius: var(--tfp-radius);
	background: #ffffff;
	color: #111111;
	font-family: var(--font-sans);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tfp-cc__btn:hover {
	border-color: #b9b9b9;
}

.tfp-cc__btn:focus-visible,
.tfp-cc__btn[aria-expanded="true"] {
	outline: none;
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.tfp-cc__slot {
	display: inline-flex;
}

.tfp-cc__chev {
	color: #6b6b6b;
	transition: transform 0.2s ease;
}

.tfp-cc__btn[aria-expanded="true"] .tfp-cc__chev {
	transform: rotate(180deg);
}

.tfp-cc__flag {
	display: block;
	width: 24px;
	height: 18px;
	border-radius: 3px;
	object-fit: cover;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
	background: #ececec;
}

.tfp-cc__panel {
	position: absolute;
	z-index: 20;
	top: calc(100% + 0.4rem);
	left: 0;
	width: min(20rem, 86vw);
	border: 1px solid #e0e0e0;
	border-radius: var(--tfp-radius);
	background: #ffffff;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
	overflow: hidden;
}

.tfp-cc__panel[hidden] {
	display: none;
}

.tfp-cc__search {
	display: block;
	width: 100%;
	height: 2.75rem;
	padding: 0 0.9rem;
	border: 0;
	border-bottom: 1px solid #ececec;
	border-radius: 0;
	background: #ffffff;
	color: #111111;
	font-family: var(--font-sans);
	font-size: 0.95rem;
}

.tfp-cc__search:focus {
	outline: none;
	background: #fafafa;
}

.tfp-cc__list {
	max-height: 16rem;
	margin: 0;
	padding: 0.25rem;
	overflow-y: auto;
	list-style: none;
}

.tfp-cc__item {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0;
	padding: 0.5rem 0.6rem;
	border-radius: 6px;
	font-size: 0.95rem;
	color: #1a1a1a;
	cursor: pointer;
}

.tfp-cc__item[hidden] {
	display: none;
}

.tfp-cc__item:hover,
.tfp-cc__item.is-active {
	background: var(--color-accent-soft);
}

.tfp-cc__item[aria-selected="true"] .tfp-cc__name {
	font-weight: 700;
}

.tfp-cc__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tfp-cc__num {
	color: #6b6b6b;
	font-variant-numeric: tabular-nums;
}

.tfp-cc__empty {
	padding: 0.75rem;
	color: #6b6b6b;
	text-align: center;
	font-size: 0.9rem;
}

/* Autocompletado del navegador sin el azul por defecto */
.tfp__field input:-webkit-autofill,
.tfp__field input:-webkit-autofill:hover,
.tfp__field input:-webkit-autofill:focus {
	-webkit-text-fill-color: #111111;
	-webkit-box-shadow: 0 0 0 1000px #ffffff inset;
	transition: background-color 9999s ease-out 0s;
}

/* Campos de dinero */
.tfp__money {
	display: flex;
	align-items: center;
	height: 3rem;
	border: 1px solid #d6d6d6;
	border-radius: var(--tfp-radius);
	background: #ffffff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tfp__money:focus-within {
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.tfp__money .tfp__symbol {
	padding-left: 1rem;
	font-weight: 700;
	color: #6b6b6b;
}

.tfp__money input[type="text"] {
	flex: 1;
	height: 100%;
	padding-left: 0.5rem;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-weight: 700;
}

.tfp__money input[type="text"]:focus {
	box-shadow: none;
}

.tfp__money--readonly {
	background: #ffffff;
}

.tfp__output {
	flex: 1;
	padding-left: 0.5rem;
	font-size: 1.05rem;
	font-weight: 700;
	color: #111111;
}

.tfp__money--total {
	border-color: var(--color-accent);
}

.tfp__money--total .tfp__output {
	font-size: 1.2rem;
}

/* Botón */
.tfp__submit {
	margin-top: 0.5rem;
	height: 3.25rem;
	border: 0;
	border-radius: 10px;
	background: var(--color-accent);
	color: var(--color-white);
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.tfp__submit:hover {
	background: var(--color-accent-hover);
}

.tfp__submit:active {
	transform: translateY(1px);
}

.tfp__submit:focus-visible {
	outline: 2px solid var(--color-white);
	outline-offset: 3px;
}

/* Honeypot */
.tfp__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 600px) {
	.tfp__row {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Checkout (finalizar-compra) y página de gracias: misma tarjeta blanca
   ========================================================================== */

/* Checkout: usa el ancho configurado del tema (.container → --container-width) */
.tfp-checkout .page-form .home-content__primary {
	width: 100%;
	max-width: none;
}

.tfp-checkout .single-post__content {
	max-width: none;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #1a1a1a;
	font-size: 1rem;
	line-height: 1.5;
}

.tfp-checkout .wp-block-woocommerce-checkout {
	max-width: none;
	width: 100%;
}

.tfp-checkout .single-post__content > * + * {
	margin-top: 0;
}

.tfp-checkout .single-post__content h1,
.tfp-checkout .single-post__content h2,
.tfp-checkout .single-post__content h3,
.tfp-checkout .single-post__content h4,
.tfp-checkout .single-post__content .wc-block-components-title,
.tfp-checkout .single-post__content .wc-block-components-checkout-step__title {
	margin-top: 0;
	font-family: var(--font-display);
	color: #111111;
}

.tfp-checkout .single-post__content a {
	color: var(--color-accent);
	text-decoration: underline;
}

.tfp-checkout .single-post__content a:hover {
	color: var(--color-accent-hover);
}

/* Campos y botón alineados con el formulario de pago */
.tfp-checkout .wc-block-components-text-input input,
.tfp-checkout .wc-block-components-text-input textarea,
.tfp-checkout .wc-block-components-combobox .components-combobox-control__input,
.tfp-checkout .wc-block-components-country-input select,
.tfp-checkout .wc-block-components-state-input select,
.tfp-checkout .wc-blocks-components-select__select {
	border: 1px solid #d6d6d6;
	border-radius: 8px;
	background-color: #ffffff;
	color: #111111;
}

.tfp-checkout .wc-block-components-text-input input:focus,
.tfp-checkout .wc-blocks-components-select__select:focus {
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px var(--color-accent-soft);
	outline: none;
}

.tfp-checkout .wc-block-components-button,
.tfp-checkout .wc-block-components-checkout-place-order-button,
.tfp-checkout .woocommerce-order .button {
	border: 0;
	border-radius: 10px;
	background: var(--color-accent);
	color: #ffffff;
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
}

.tfp-checkout .wc-block-components-button:hover,
.tfp-checkout .wc-block-components-checkout-place-order-button:hover,
.tfp-checkout .woocommerce-order .button:hover {
	background: var(--color-accent-hover);
	color: #ffffff;
}

/* ==========================================================================
   Página de gracias (pedido recibido)
   ========================================================================== */

.tfp-checkout .woocommerce-order {
	max-width: 960px;
	margin-inline: auto;
}

/* Mensaje de éxito */
.tfp-checkout .woocommerce-thankyou-order-received {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.9rem;
	margin: 0 0 1.75rem;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: center;
	font-family: var(--font-display);
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	font-weight: 800;
	line-height: 1.25;
	color: #111111;
}

.tfp-checkout .woocommerce-thankyou-order-received::before {
	content: "\2713";
	display: grid;
	place-items: center;
	width: 3.4rem;
	height: 3.4rem;
	border-radius: 50%;
	background: var(--color-accent);
	box-shadow: 0 0 0 8px var(--color-accent-soft);
	color: #ffffff;
	font-size: 1.7rem;
	line-height: 1;
}

/* Resumen en tarjetas: número, fecha, correo, total, método */
.tfp-checkout .woocommerce-order ul.order_details {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
	gap: 0.75rem;
	width: 100%;
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

.tfp-checkout .woocommerce-order ul.order_details::before,
.tfp-checkout .woocommerce-order ul.order_details::after {
	content: none;
	display: none;
}

.tfp-checkout .woocommerce-order ul.order_details li {
	float: none;
	margin: 0;
	padding: 1rem 1.1rem;
	border: 1px solid #e6e6e6;
	border-radius: var(--radius);
	background: #fafafa;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-transform: uppercase;
	color: #6b6b6b;
}

.tfp-checkout .woocommerce-order ul.order_details li strong {
	display: block;
	margin-top: 0.35rem;
	font-family: var(--font-sans);
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: #111111;
	overflow-wrap: anywhere;
}

.tfp-checkout .woocommerce-order ul.order_details li.woocommerce-order-overview__total {
	border-color: var(--color-accent);
	background: #fff5f5;
}

.tfp-checkout .woocommerce-order ul.order_details li.woocommerce-order-overview__total strong {
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--color-accent);
}

/* Títulos de sección */
.tfp-checkout .woocommerce-order h2,
.tfp-checkout .woocommerce-order .woocommerce-order-details__title,
.tfp-checkout .woocommerce-order .woocommerce-column__title {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 2rem 0 0.85rem;
	font-family: var(--font-display);
	font-size: 1.1rem;
	font-weight: 800;
	color: #111111;
}

.tfp-checkout .woocommerce-order h2::before {
	content: "";
	width: 4px;
	height: 1.1em;
	border-radius: 2px;
	background: var(--color-accent);
}

/* Tabla de detalles */
.tfp-checkout .woocommerce-order table.shop_table {
	display: table;
	width: 100%;
	margin: 0;
	border: 1px solid #e6e6e6;
	border-collapse: separate;
	border-spacing: 0;
	border-radius: var(--radius);
	overflow: hidden;
	background: #ffffff;
}

.tfp-checkout .woocommerce-order table.shop_table th,
.tfp-checkout .woocommerce-order table.shop_table td {
	padding: 0.85rem 1.1rem;
	border: 0;
	border-bottom: 1px solid #efefef;
	text-align: left;
	color: #1a1a1a;
}

.tfp-checkout .woocommerce-order table.shop_table thead th {
	background: #f7f7f8;
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #6b6b6b;
}

.tfp-checkout .woocommerce-order table.shop_table th:last-child,
.tfp-checkout .woocommerce-order table.shop_table td:last-child {
	text-align: right;
}

.tfp-checkout .woocommerce-order table.shop_table tfoot th {
	font-weight: 600;
	color: #4a4a4a;
}

.tfp-checkout .woocommerce-order table.shop_table tfoot td {
	font-weight: 700;
}

.tfp-checkout .woocommerce-order table.shop_table tr:last-child th,
.tfp-checkout .woocommerce-order table.shop_table tr:last-child td {
	border-bottom: 0;
}

/* Dirección de facturación */
.tfp-checkout .woocommerce-order address {
	margin: 0;
	padding: 1.1rem 1.25rem;
	border: 1px solid #e6e6e6;
	border-radius: var(--radius);
	background: #fafafa;
	font-style: normal;
	line-height: 1.8;
	color: #1a1a1a;
}

.tfp-checkout .woocommerce-order address p {
	margin: 0.25rem 0 0;
}

/* ==========================================================================
   Diseño del checkout
   ========================================================================== */

/* Cabecera */
.tfp-checkout__brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
	padding-bottom: clamp(1.25rem, 3vw, 1.75rem);
	border-bottom: 1px solid #ececec;
	text-align: center;
}

.tfp-checkout__logo img,
.tfp-checkout__logo .custom-logo {
	display: block;
	width: auto;
	max-width: 200px;
	max-height: 70px;
	height: auto;
}

.tfp-checkout__title {
	margin: 0.75rem 0 0;
	font-family: var(--font-display);
	font-size: clamp(1.5rem, 3.5vw, 2rem);
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #111111;
}

.tfp-checkout__secure {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	font-size: 0.9rem;
	color: #6b6b6b;
}

.tfp-checkout__secure svg {
	color: var(--color-accent);
}

/* Columnas: formulario + resumen */
.tfp-checkout .wc-block-components-sidebar-layout {
	gap: clamp(1.5rem, 4vw, 3rem);
}

.tfp-checkout .wc-block-components-sidebar-layout .wc-block-components-main {
	padding-right: 0;
}

/* Pasos numerados */
.tfp-checkout .wp-block-woocommerce-checkout-fields-block {
	counter-reset: tfp-step;
}

.tfp-checkout .wc-block-components-checkout-step {
	position: relative;
	margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
	padding: 0;
	border: 0;
	counter-increment: tfp-step;
}

.tfp-checkout .wc-block-components-checkout-step::before {
	content: none;
}

.tfp-checkout .wc-block-components-checkout-step__heading {
	margin: 0 0 1rem;
}

.tfp-checkout .wc-block-components-checkout-step__title {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.tfp-checkout .wc-block-components-checkout-step__title::before {
	content: counter(tfp-step);
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 50%;
	background: var(--color-accent);
	color: #ffffff;
	font-family: var(--font-display);
	font-size: 0.9rem;
	font-weight: 800;
}

.tfp-checkout .wc-block-components-checkout-step__content {
	padding: 0;
}

/* Resumen: una sola tarjeta blanca; adentro solo separadores */
.tfp-checkout .wc-block-components-sidebar {
	position: sticky;
	top: 1.5rem;
	align-self: flex-start;
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
	border: 1px solid #e6e6e6;
	border-radius: var(--radius-lg);
	background: #ffffff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.tfp-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title,
.tfp-checkout .wc-block-components-sidebar .wc-block-components-title {
	margin: 0 0 0.5rem;
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-transform: none;
	color: #111111;
}

/* Sin recuadro interno */
.tfp-checkout .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block,
.tfp-checkout .wc-block-components-sidebar .wc-block-components-order-summary {
	border: 0;
	background: transparent;
	box-shadow: none;
}

.tfp-checkout .wc-block-components-sidebar .wc-block-components-totals-wrapper,
.tfp-checkout .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-totals-block {
	border-color: #e6e6e6;
}

.tfp-checkout .wc-block-components-order-summary-item__image img {
	border-radius: 8px;
}

.tfp-checkout .wc-block-components-order-summary-item__quantity {
	border: 0;
	background: #111111;
	box-shadow: none;
	color: #ffffff;
}

/* Total destacado */
.tfp-checkout .wc-block-components-totals-footer-item {
	align-items: baseline;
	margin: 0;
	padding: 0 0.8rem;
	border: 0;
}

.tfp-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-family: var(--font-display);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #111111;
}

.tfp-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-family: var(--font-display);
	font-size: 1.8rem;
	font-weight: 800;
	color: var(--color-accent);
}

/* Botón de pago */
.tfp-checkout .wc-block-checkout__actions {
	padding: 0;
}

.tfp-checkout .wc-block-checkout__actions_row {
	display: block;
}

.tfp-checkout .wc-block-components-checkout-place-order-button {
	width: 100%;
	min-height: 3.4rem;
	padding: 0 1.5rem;
	font-size: 1rem;
}

.tfp-checkout .wc-block-components-checkout-return-to-cart-button {
	display: none;
}

.tfp-checkout .wc-block-checkout__terms {
	margin: 1rem 0;
	font-size: 0.85rem;
	color: #6b6b6b;
}

/* Campos del checkout: borde limpio, rojo solo al enfocar */
.tfp-checkout .wc-block-components-text-input input,
.tfp-checkout .wc-block-components-text-input.is-active input {
	border: 1px solid #d6d6d6;
	box-shadow: none;
}

.tfp-checkout .wc-block-components-text-input input:focus {
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px var(--color-accent-soft);
	outline: none;
}

.tfp-checkout .wc-block-components-text-input.has-error input {
	border-color: #cc1818;
}

@media (max-width: 782px) {
	.tfp-checkout .wc-block-components-sidebar {
		position: static;
	}
}
