/*
Theme Name: Kiosko Touch
Description: Tema de kiosko de autoservicio para pantalla táctil vertical de 20". Funciona con el plugin Kiosko BlockChyp Terminal.
Version: 1.4.0
Text Domain: kiosko-touch
*/

/* ---------- Base ---------- */
:root {
	--navy: #13264f;
	--navy-deep: #0a1633;
	--red: #d7263d;
	--red-deep: #b21b30;
	--white: #ffffff;
	--amber: #ffb81c;
	--bg: #eef1f7;
	--ink: #0f1b3a;
	--muted: #5b6785;
	--line: #d6dce9;
	--radius: 1.1rem;
}

/* 1rem = 1/54 del lado corto de la pantalla (1080 px => 20 px). Vertical u horizontal, el tamaño de botones y texto es el mismo y solo cambia cuántas columnas caben. */
html {
	font-size: clamp(12px, calc(min(100vw, 100vh) / 54), 30px);
	touch-action: manipulation;
	-webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
	font-size: 1.3rem;
	line-height: 1.35;
	overscroll-behavior: none;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
#wpadminbar { display: none !important; }

.kt-shell { width: 100%; min-height: 100vh; display: flex; flex-direction: column; }
.kt-main { flex: 1; width: 100%; padding: 1.4rem 1.6rem 11rem; }
/* Pantallas de una sola columna: no se estiran en horizontal. */
.woocommerce-cart .kt-main, .woocommerce-checkout .kt-main, .single-product .kt-main { max-width: 64rem; margin: 0 auto; }

/* ---------- Encabezado ---------- */
.kt-header { background: var(--white); padding: 1.1rem 1.6rem 1rem; border-bottom: 1px solid var(--line); }
.kt-brand { display: inline-flex; align-items: center; min-height: 4.4rem; }
.kt-brand img, .kt-brand .custom-logo, .custom-logo-link img { height: 4.4rem; width: auto; max-width: 200px; object-fit: contain; }
/* Logo oculto en el encabezado (se ve en la pantalla de bienvenida). Para mostrarlo de nuevo, borra la línea siguiente. */
.kt-brand { display: none; }
.kt-brand-name { font-size: 1.8rem; font-weight: 800; color: var(--navy); }

.kt-steps { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; gap: .6rem; }
/* En horizontal el encabezado pasa a una sola fila (el botón de idioma queda a la derecha). */
@media (min-aspect-ratio: 1/1) {
	.kt-header { display: flex; align-items: center; justify-content: space-between; padding-right: 14rem; }
	.kt-steps { margin: 0; width: 100%; max-width: 46rem; }
}
.kt-steps li {
	flex: 1;
	display: flex;
	align-items: center;
	gap: .7rem;
	padding: .5rem .9rem .5rem .5rem;
	border-radius: 999px;
	background: var(--bg);
	color: var(--muted);
	font-weight: 700;
	font-size: 1.05rem;
}
.kt-step-n {
	display: inline-grid;
	place-items: center;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 50%;
	background: var(--white);
	color: var(--muted);
	font-weight: 800;
	flex: none;
}
.kt-steps li.is-current { background: var(--navy); color: var(--white); }
.kt-steps li.is-current .kt-step-n { background: var(--amber); color: var(--navy); }
.kt-steps li.is-done { color: var(--navy); }
.kt-steps li.is-done .kt-step-n { background: var(--navy); color: var(--white); }

/* Botón de idioma del plugin, dentro del encabezado. */
#kiosko-lang-toggle {
	top: 1.3rem !important;
	right: 1.6rem !important;
	min-height: 3.5rem !important;
	padding: 0 1.6rem !important;
	background: var(--white) !important;
	color: var(--navy) !important;
	border: .18rem solid var(--navy) !important;
	border-radius: 999px !important;
	font-size: 1.15rem !important;
	font-weight: 800 !important;
}

/* ---------- Botones ---------- */
a.button, button.button, input.button, button#place_order, .kt-link-btn, .kt-tray-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	min-height: 3.8rem !important;
	padding: 0 1.5rem !important;
	border: 0;
	border-radius: var(--radius);
	background: var(--red);
	color: var(--white);
	font-family: inherit;
	font-weight: 800;
	line-height: 1.1;
	font-size: 1.3rem !important;
	text-align: center;
	cursor: pointer;
}
a.button:active, button.button:active, button#place_order:active, .kt-link-btn:active, .kt-tray-btn:active {
	background: var(--red-deep);
	transform: scale(.985);
}
a.button.loading, button.button.loading { opacity: .6; }
a.button.added::before { content: "✓"; font-weight: 900; }
a.added_to_cart { display: none !important; }
.button.disabled, .button:disabled, button[disabled] { opacity: .4; pointer-events: none; }

.kt-link-btn {
	background: var(--white);
	color: var(--navy);
	border: .18rem solid var(--navy);
	width: 100%;
}
.kt-link-btn.is-quiet { border-color: var(--line); color: var(--muted); }
.kt-link-btn.is-primary { background: var(--red); color: var(--white); border-color: var(--red); min-height: 4.6rem !important; font-size: 1.6rem !important; margin-top: 2rem; }
.kt-secondary { display: grid; gap: .8rem; margin-top: 1rem; }
.kt-back { display: inline-flex; align-items: center; min-height: 3.6rem; padding: 0 1.2rem; margin-bottom: 1rem; border-radius: 999px; background: var(--white); font-weight: 800; color: var(--navy); }

/* ---------- Categorías ---------- */
.kt-chips { display: flex; flex-wrap: wrap; gap: .7rem; flex: 1 1 100%; }
.kt-chip {
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	padding: 0 1.6rem;
	border-radius: 999px;
	background: var(--white);
	border: .15rem solid var(--line);
	color: var(--navy);
	font-weight: 800;
	font-size: 1rem;
}
.kt-chip.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* ---------- Catálogo ---------- */
ul.products { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1.2rem; }
ul.products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 1rem 1rem 1.1rem;
	background: var(--white);
	border-radius: 1.3rem;
	overflow: hidden;
}
ul.products li.product img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: .8rem; margin-bottom: .8rem; }
.woocommerce-loop-product__title {
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.2;
	min-height: 2.4em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	padding: 0;
	margin: 0 0 .4rem;
}
.kt-sku { font-size: 1rem; font-weight: 600; color: var(--muted); margin: -.2rem 0 .5rem; word-break: break-word; }
.kt-sku-label { font-weight: 700; }
.single-product .kt-sku { font-size: 1.15rem; margin: 0 0 .6rem; }
.price { display: block; font-size: 1.6rem; font-weight: 800; color: var(--navy); margin-bottom: .9rem; }
.price del { font-size: 1.05rem; font-weight: 600; color: var(--muted); margin-right: .4rem; }
.price ins { text-decoration: none; background: var(--amber); padding: 0 .4rem; border-radius: .4rem; }
ul.products li.product .button { margin-top: auto; width: 100%; }
.onsale {
	position: absolute;
	top: 1.4rem;
	left: 1.4rem;
	z-index: 2;
	padding: .3rem .9rem;
	border-radius: 999px;
	background: var(--amber);
	color: var(--navy);
	font-weight: 800;
	font-size: 1rem;
}

/* Paginación: botones Anterior / Siguiente en vez de números. */
.kt-pager { margin-top: 1.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.kt-pager-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 13rem;
	min-height: 3.8rem;
	padding: 0 1.6rem;
	border-radius: var(--radius);
	background: var(--navy);
	color: var(--white);
	font-size: 1.2rem;
	font-weight: 800;
}
.kt-pager-btn:active { background: var(--navy-deep); transform: scale(.985); }
.kt-pager-btn.is-disabled { background: var(--line); color: var(--muted); opacity: .6; pointer-events: none; }
.kt-pager-info { font-size: 1.1rem; font-weight: 700; color: var(--muted); text-align: center; }

/* ---------- Cantidades ---------- */
.quantity { display: inline-flex; align-items: center; background: var(--white); border: .15rem solid var(--line); border-radius: 1rem; overflow: hidden; }
.quantity .kt-step {
	width: 4.6rem;
	height: 4.6rem;
	min-height: 0;
	padding: 0;
	border: 0;
	background: var(--bg);
	color: var(--navy);
	font-size: 2rem;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
}
.quantity .kt-step:active { background: var(--line); }
.quantity input.qty {
	width: 4.4rem;
	min-height: 0;
	height: 4.6rem;
	padding: 0;
	border: 0;
	text-align: center;
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--ink);
	background: transparent;
	-moz-appearance: textfield;
}
.quantity input.qty::-webkit-outer-spin-button, .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Barra inferior del pedido ---------- */
.kt-tray {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 50;
	background: var(--navy);
	color: var(--white);
	border-radius: 1.8rem 1.8rem 0 0;
	box-shadow: 0 -.6rem 2rem rgba(10, 22, 51, .35);
	padding: 1.3rem 1.6rem calc(1.3rem + env(safe-area-inset-bottom, 0px));
}
.kt-tray-inner { max-width: 80rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; min-height: 5.8rem; }
.kt-tray-info { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.kt-count { display: grid; place-items: center; min-width: 4.4rem; height: 4.4rem; padding: 0 .6rem; border-radius: 50%; background: var(--amber); color: var(--navy); font-size: 1.6rem; font-weight: 900; }
.kt-count.is-empty { background: rgba(255, 255, 255, .15); color: rgba(255, 255, 255, .6); }
.kt-tray-text { display: flex; flex-direction: column; }
.kt-tray-label { font-size: 1.05rem; opacity: .85; }
.kt-total { font-size: 2.1rem; font-weight: 900; color: var(--amber); line-height: 1.1; }
.kt-tray-hint { font-size: 1.15rem; font-weight: 700; }
.kt-tray-btn { min-height: 4.4rem !important; padding: 0 1.8rem !important; font-size: 1.45rem !important; flex: none; }
.kt-tray.kt-bump { animation: kt-bump .35s ease-out; }
@keyframes kt-bump {
	0% { transform: translateY(0); }
	40% { transform: translateY(-.7rem); }
	100% { transform: translateY(0); }
}

/* ---------- Avisos ---------- */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
	list-style: none;
	margin: 0 0 1.2rem;
	padding: 1.2rem 1.4rem;
	border-radius: var(--radius);
	background: var(--white);
	border-left: .6rem solid var(--navy);
	font-weight: 700;
	font-size: 1.2rem;
}
.woocommerce-error { border-left-color: var(--red); background: #fff1f3; color: #7a1020; }
.woocommerce-message .button { display: none; }
.cart-empty { text-align: center; font-size: 1.6rem; font-weight: 800; padding: 3rem 1rem 1rem; }
.return-to-shop { text-align: center; }

/* ---------- Pedido (carrito) ---------- */
.woocommerce-cart-form table, .woocommerce-cart-form tbody, .woocommerce-cart-form tr, .woocommerce-cart-form td { display: block; width: 100%; border: 0; padding: 0; }
.woocommerce-cart-form thead { display: none; }
.woocommerce-cart-form tr.cart_item {
	display: grid;
	grid-template-columns: 8rem 1fr auto;
	grid-template-areas: "thumb name remove" "thumb qty subtotal";
	gap: .5rem 1.2rem;
	align-items: center;
	margin-bottom: 1rem;
	padding: 1rem;
	background: var(--white);
	border-radius: 1.3rem;
}
.woocommerce-cart-form td.product-thumbnail { grid-area: thumb; }
.woocommerce-cart-form td.product-thumbnail img { width: 8rem; height: 8rem; object-fit: contain; border-radius: .8rem; }
.woocommerce-cart-form td.product-name { grid-area: name; font-size: 1.3rem; font-weight: 700; }
.woocommerce-cart-form td.product-price { display: none; }
.woocommerce-cart-form td.product-quantity { grid-area: qty; }
.woocommerce-cart-form td.product-subtotal { grid-area: subtotal; text-align: right; font-size: 1.6rem; font-weight: 900; color: var(--navy); width: auto; }
.woocommerce-cart-form td.product-remove { grid-area: remove; width: auto; }
.woocommerce-cart-form a.remove {
	display: grid;
	place-items: center;
	width: 4.2rem;
	height: 4.2rem;
	border-radius: 50%;
	border: .15rem solid var(--red);
	color: var(--red);
	font-size: 2rem;
	font-weight: 700;
}
.woocommerce-cart-form td.actions { display: none; }
.cart-collaterals .cart_totals { margin-top: 1.4rem; padding: 1.4rem 1.6rem; background: var(--white); border-radius: 1.3rem; }
.cart_totals h2 { display: none; }
.cart_totals table, .cart_totals tbody, .cart_totals tr { display: block; width: 100%; }
.cart_totals tr { display: flex; justify-content: space-between; align-items: baseline; padding: .6rem 0; }
.cart_totals th, .cart_totals td { padding: 0; border: 0; font-size: 1.25rem; text-align: left; }
.cart_totals tr.order-total th, .cart_totals tr.order-total td { font-size: 1.9rem; font-weight: 900; color: var(--navy); }
.cart_totals tr.order-total td { background: var(--amber); padding: .1rem .8rem; border-radius: .5rem; }
.wc-proceed-to-checkout { margin-top: 1.2rem; }
.wc-proceed-to-checkout a.checkout-button { width: 100%; min-height: 4.6rem !important; font-size: 1.7rem !important; }

/* ---------- Pago ---------- */
form.checkout { display: grid; gap: 1.2rem; }
form.checkout .col2-set, form.checkout .col-1, form.checkout .col-2 { width: 100%; float: none; }
#customer_details:empty { display: none; }
.woocommerce-billing-fields h3, #order_review_heading, .woocommerce-additional-fields { display: none; }
.woocommerce-billing-fields__field-wrapper { padding: 1.4rem 1.6rem; background: var(--white); border-radius: 1.3rem; }
.form-row { margin: 0; }
.form-row label { display: block; margin-bottom: .6rem; font-weight: 700; font-size: 1.1rem; color: var(--muted); }
input.input-text, input[type="email"], input[type="text"] {
	width: 100%;
	min-height: 5.2rem;
	padding: 0 1.2rem;
	border: .15rem solid var(--line);
	border-radius: 1rem;
	background: var(--white);
	font: inherit;
	font-size: 1.4rem;
	color: var(--ink);
}
input.input-text:focus { outline: .2rem solid var(--navy); border-color: var(--navy); }
#order_review { padding: 1.4rem 1.6rem; background: var(--white); border-radius: 1.3rem; }
#order_review table, #order_review tbody, #order_review tfoot, #order_review tr { display: block; width: 100%; }
#order_review thead { display: none; }
#order_review tr { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; }
#order_review th, #order_review td { padding: 0; border: 0; font-size: 1.2rem; text-align: left; }
#order_review .product-quantity { font-weight: 800; color: var(--muted); }
#order_review tr.order-total th, #order_review tr.order-total td { font-size: 1.9rem; font-weight: 900; color: var(--navy); }
#order_review tr.order-total td { background: var(--amber); padding: .1rem .8rem; border-radius: .5rem; }
#payment { margin-top: 1rem; }
#payment ul.payment_methods { list-style: none; margin: 0; padding: 0; }
#payment ul.payment_methods > li { padding: 1.1rem 1.2rem; border: .15rem solid var(--navy); border-radius: 1rem; }
#payment ul.payment_methods input[type="radio"] { display: none; }
#payment ul.payment_methods label { font-size: 1.4rem; font-weight: 800; color: var(--navy); margin: 0; }
#payment .payment_box { margin-top: .4rem; font-size: 1.15rem; color: var(--muted); }
#payment .payment_box p { margin: 0; }
.woocommerce-terms-and-conditions-wrapper, .woocommerce-privacy-policy-text { display: none; }
/* Cancelar junto a Pagar: los dos en una fila (el tema emite "Cancelar" justo antes del botón). */
.form-row.place-order { display: flex; align-items: stretch; gap: .9rem; margin-top: 1.2rem; }
.form-row.place-order .kt-cancel { flex: none; width: auto; }
#place_order { flex: 1 1 auto; width: 100%; margin-top: 0; min-height: 5rem !important; font-size: 1.8rem !important; }

/* ---------- Gracias ---------- */
.woocommerce-order { text-align: center; padding-top: 3rem; }
.woocommerce-thankyou-order-received { margin: 0 0 2rem; padding: 0; border: 0; background: none; font-size: 2.4rem; font-weight: 900; color: var(--navy); }
.woocommerce-thankyou-order-received::before {
	content: "✓";
	display: grid;
	place-items: center;
	width: 9rem;
	height: 9rem;
	margin: 0 auto 1.6rem;
	border-radius: 50%;
	background: var(--navy);
	color: var(--amber);
	font-size: 5rem;
}
ul.woocommerce-order-overview { list-style: none; margin: 0 auto; padding: 1.2rem 1.6rem; display: inline-grid; gap: .5rem; background: var(--white); border-radius: 1.3rem; text-align: left; font-size: 1.2rem; }
ul.woocommerce-order-overview li.date, ul.woocommerce-order-overview li.email, ul.woocommerce-order-overview li.method { display: none; }
ul.woocommerce-order-overview strong { display: block; font-size: 1.6rem; color: var(--navy); }
.woocommerce-order-details, .woocommerce-customer-details { display: none; }

/* ---------- Producto individual ---------- */
.single-product div.product { display: flex; flex-direction: column; gap: 1.2rem; padding: 1.2rem; background: var(--white); border-radius: 1.3rem; }
.single-product .woocommerce-product-gallery__image a { pointer-events: none; }
.single-product .woocommerce-product-gallery img { width: 100%; max-height: 34rem; object-fit: contain; }
.single-product .product_title { font-size: 1.9rem; font-weight: 800; }
.single-product .summary .price { font-size: 2.1rem; }
.single-product form.cart { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.single-product form.cart .single_add_to_cart_button { flex: 1; min-height: 4.6rem !important; }
.single-product table.variations, .single-product table.variations tbody, .single-product table.variations tr, .single-product table.variations td { display: block; width: 100%; border: 0; padding: 0; }
.single-product table.variations select { width: 100%; min-height: 5.2rem; font-size: 1.3rem; border-radius: 1rem; border: .15rem solid var(--line); padding: 0 1rem; }

/* ---------- Mensaje mientras se espera la tarjeta ---------- */
#kiosko-wait { background: rgba(10, 22, 51, .96) !important; }
#kiosko-wait .kiosko-wait-box::before {
	content: "";
	display: block;
	width: 8rem;
	height: 8rem;
	margin: 0 auto 2.6rem;
	border: .7rem solid rgba(255, 255, 255, .2);
	border-top-color: var(--amber);
	border-radius: 50%;
	animation: kt-spin 1s linear infinite;
}
#kiosko-wait p { font-size: 2.2rem !important; font-weight: 800; }
@keyframes kt-spin { to { transform: rotate(360deg); } }

/* ---------- Pantalla de bienvenida (la crea el plugin) ---------- */
#kiosko-lang { background: var(--white) !important; color: var(--navy) !important; }
#kiosko-lang .kiosko-lang-box {
	position: absolute;
	inset: 0;
	transform: none;
	width: 100%;
	max-width: none;
	display: flex;
	flex-direction: column;
	align-items: center;
}
#kiosko-lang h1 { margin: auto 0 0; padding: 0 2rem; font-size: 3.6rem; font-weight: 900; }
#kiosko-lang h1::before {
	content: "";
	display: block;
	width: 300px;
	max-width: 80vw;
	height: 8rem;
	margin: 0 auto 3rem;
	background: var(--kt-logo, none) center / contain no-repeat;
}
#kiosko-lang p { margin: .6rem 0 auto; padding: 0 2rem 2rem; font-size: 1.6rem; color: var(--muted); }
#kiosko-lang .kiosko-lang-buttons {
	width: 100%;
	flex-wrap: nowrap;
	gap: 1.4rem;
	padding: 3.2rem 2rem 5rem;
	background: var(--navy);
	border-top: .7rem solid var(--red);
}
#kiosko-lang .kiosko-lang-buttons button {
	flex: 1;
	min-width: 0;
	min-height: 5rem;
	border: 0;
	border-radius: 3rem;
	background: var(--white);
	color: var(--navy);
	font-family: inherit;
	font-size: 2rem;
	font-weight: 900;
}
#kiosko-lang .kiosko-lang-buttons button:active { background: var(--amber); }

@media (min-aspect-ratio: 1/1) {
	#kiosko-lang .kiosko-lang-buttons { padding-left: 20vw; padding-right: 20vw; }
}

/* Con imágenes o videos (WooCommerce > Kiosko: inicio): cubren toda la zona blanca de arriba. */
#kiosko-lang.has-media .kiosko-lang-media {
	position: relative;
	inset: auto;
	flex: 1 1 0;
	width: 100%;
	min-height: 0;
}
#kiosko-lang.has-media h1 { display: none; }
#kiosko-lang.has-media p {
	width: 100%;
	margin: 0;
	padding: 2.2rem 2rem 0;
	background: var(--navy);
	border-top: .7rem solid var(--red);
	color: var(--white);
	font-size: 1.7rem;
	font-weight: 800;
	text-align: center;
}
#kiosko-lang.has-media .kiosko-lang-buttons { border-top: 0; padding-top: 1.6rem; }
.kiosko-lang-logo {
	position: absolute;
	top: 2.4rem;
	left: 50%;
	z-index: 2;
	transform: translateX(-50%);
	padding: 1.2rem 2.4rem;
	background: var(--white);
	border-radius: 1.2rem;
	box-shadow: 0 .4rem 1.6rem rgba(0, 0, 0, .25);
}
.kiosko-lang-logo span {
	display: block;
	width: 300px;
	max-width: 60vw;
	height: 7rem;
	background: var(--kt-logo, none) center / contain no-repeat;
}

/* Aviso de reinicio por inactividad, con los colores de la tienda. */
#kiosko-idle { background: rgba(10, 22, 51, .95) !important; }
#kiosko-idle .kiosko-idle-count { color: var(--amber) !important; }
#kiosko-idle button { background: var(--amber) !important; color: var(--navy) !important; font-family: inherit; }
#kiosko-idle button:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
	.kt-tray.kt-bump, #kiosko-wait .kiosko-wait-box::before { animation: none; }
}

/* En horizontal las fotos son más bajas para que el botón quede a la vista sin desplazarse. */
@media (min-aspect-ratio: 1/1) {
	ul.products li.product img { aspect-ratio: 3 / 2; }
}


/* ---------- Buscador ---------- */
.kt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.kt-search {
	flex: 1 1 100%;
	display: flex;
	align-items: center;
	gap: .7rem;
	min-height: 4.8rem;
	padding: .4rem .4rem .4rem 1.2rem;
	background: var(--white);
	border: .18rem solid var(--line);
	border-radius: 999px;
	cursor: text;
	transition: border-color .18s ease, box-shadow .18s ease;
}
.kt-search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 .35rem rgba(19, 38, 79, .14); }
.kt-search-icon { flex: none; width: 2rem; height: 2rem; color: var(--navy); }
.kt-search-input {
	flex: 1;
	min-width: 0;
	height: 3.8rem;
	min-height: 0;
	padding: 0;
	border: 0;
	outline: none;
	background: transparent;
	font: inherit;
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--ink);
	-webkit-appearance: none;
	appearance: none;
}
.kt-search-input::placeholder { color: var(--muted); font-weight: 500; }
.kt-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.kt-search-clear {
	flex: none;
	display: grid;
	place-items: center;
	width: 3.2rem;
	height: 3.2rem;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bg);
	color: var(--navy);
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
}
.kt-search-input:placeholder-shown ~ .kt-search-clear { display: none; }
.kt-search-go {
	flex: none;
	min-height: 3.4rem;
	padding: 0 1.8rem;
	border: 0;
	border-radius: 999px;
	background: var(--red);
	color: var(--white);
	font-family: inherit;
	font-size: 1.1rem;
	font-weight: 800;
	cursor: pointer;
}
.kt-search-go:active { background: var(--red-deep); transform: scale(.97); }

@media (min-aspect-ratio: 1/1) {
	.kt-search { flex: 0 1 32rem; }
	.kt-chips { flex: 1 1 0; }
}

.kt-results { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.2rem; }
.kt-results h1 { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.kt-empty { text-align: center; padding: 4rem 1rem 2rem; }
.kt-empty h2 { font-size: 2rem; font-weight: 900; color: var(--navy); margin-bottom: .8rem; }
.kt-empty p { margin: 0 0 2rem; font-size: 1.3rem; color: var(--muted); }
.kt-empty .kt-link-btn { width: auto; min-width: 26rem; }

/* ---------- Teclado en pantalla ---------- */
.kt-osk {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 60000;
	padding: 1rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
	background: var(--navy);
	border-radius: 1.8rem 1.8rem 0 0;
	box-shadow: 0 -.8rem 2.4rem rgba(10, 22, 51, .4);
	transform: translateY(100%);
	transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.kt-osk[hidden] { display: none; }
.kt-osk.is-open { transform: translateY(0); }
.kt-osk-bar, .kt-osk-keys { max-width: 62rem; margin: 0 auto; }
.kt-osk-bar { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.kt-osk-preview {
	flex: 1;
	min-width: 0;
	min-height: 3.8rem;
	padding: .4rem 1.2rem;
	display: flex;
	align-items: center;
	border-radius: 999px;
	background: var(--white);
	color: var(--ink);
	font-size: 1.25rem;
	font-weight: 700;
	overflow: hidden;
	white-space: nowrap;
}
.kt-osk-ph { color: var(--muted); font-weight: 500; }
.kt-caret { width: .16rem; height: 1.8rem; margin-left: .15rem; background: var(--red); animation: kt-blink 1s steps(1) infinite; }
.kt-osk-clear {
	flex: none;
	min-height: 3.8rem;
	padding: 0 1.3rem;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .16);
	color: var(--white);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
}
.kt-osk-row { display: flex; gap: .45rem; margin-bottom: .45rem; }
.kt-key {
	flex: 1 1 0;
	min-width: 0;
	height: 4.2rem;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: .8rem;
	background: var(--white);
	color: var(--navy);
	font-family: inherit;
	font-size: 1.3rem;
	font-weight: 700;
	touch-action: manipulation;
	transition: background-color .08s ease, transform .08s ease;
}
.kt-key:active { background: var(--amber); transform: scale(.94); }
.kt-key-fn { flex: 1.5 1 0; background: rgba(255, 255, 255, .18); color: var(--white); }
.kt-key-fn:active { background: rgba(255, 255, 255, .35); }
.kt-key-fn.is-on { background: var(--amber); color: var(--navy); }
.kt-key-space { flex: 5 1 0; font-size: 1rem; font-weight: 600; }
.kt-key-mid { flex: 2 1 0; }
.kt-key-act { flex: 2.4 1 0; background: var(--red); color: var(--white); font-size: 1.15rem; font-weight: 800; }
.kt-key-act:active { background: var(--red-deep); }
.kt-osk-open .kt-main { padding-bottom: calc(11rem + var(--kt-osk-h, 0px)); }
@keyframes kt-blink { 50% { opacity: 0; } }

/* ---------- Movimiento suave (solo opacidad y transform) ---------- */
@keyframes kt-rise { from { opacity: 0; transform: translateY(.9rem); } to { opacity: 1; transform: none; } }
@keyframes kt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kt-pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }

ul.products li.product { animation: kt-rise .34s ease-out both; }
ul.products li.product:nth-child(2) { animation-delay: .04s; }
ul.products li.product:nth-child(3) { animation-delay: .08s; }
ul.products li.product:nth-child(4) { animation-delay: .12s; }
ul.products li.product:nth-child(5) { animation-delay: .16s; }
ul.products li.product:nth-child(6) { animation-delay: .2s; }
ul.products li.product:nth-child(7) { animation-delay: .24s; }
ul.products li.product:nth-child(8) { animation-delay: .28s; }
.woocommerce-cart .kt-main, .woocommerce-checkout .kt-main { animation: kt-fade .25s ease-out; }
.kt-tray.kt-bump .kt-count { animation: kt-pop .35s ease-out; }
a.button.added::before { display: inline-block; animation: kt-pop .3s ease-out; }
a.button, button.button, .kt-link-btn, .kt-chip, .kt-tray-btn { transition: background-color .12s ease, transform .12s ease; }
.kt-chip:active { transform: scale(.96); }

@media (prefers-reduced-motion: reduce) {
	ul.products li.product, .woocommerce-cart .kt-main, .woocommerce-checkout .kt-main,
	.kt-tray.kt-bump .kt-count, a.button.added::before, .kt-caret { animation: none !important; }
	.kt-osk { transition: none; }
}

/* En horizontal el teclado es más bajo para dejar a la vista el buscador y los productos. */
@media (min-aspect-ratio: 1/1) {
	.kt-key { height: 3.6rem; }
	.kt-osk-preview, .kt-osk-clear { min-height: 3.4rem; }
}
