/* Zero ST – Checkout Ecuador */
:root {
	--zst-primary: var(--porto-primary-color, #4227c6);
	--zst-primary-soft: #f4f2fd;
	--zst-border: #dfe1e7;
	--zst-text: #1d2433;
	--zst-muted: #667085;
	--zst-green: #067647;
	--zst-green-bg: #ecfdf3;
	--zst-green-border: #abefc6;
	--zst-radius: 12px;
}

/* ---------- Funcional (siempre) ---------- */
.zst-hidden { display: none !important; }
#billing_country_field,
#shipping_country_field { display: none !important; }

.zst-hint {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	clear: both;
	width: 100%;
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 1px solid transparent;
	border-radius: var(--zst-radius);
	font-size: 14px;
	line-height: 1.5;
	animation: zstIn .25s ease;
}
.zst-hint svg { flex: 0 0 20px; margin-top: 1px; }
.zst-hint.is-info { background: var(--zst-primary-soft); border-color: #e0dbfb; color: #2a1a8a; }
.zst-hint.is-free { background: var(--zst-green-bg); border-color: var(--zst-green-border); color: var(--zst-green); }
.zst-hint.is-muted { background: #f6f7f9; border-color: #eceef2; color: var(--zst-muted); }

.zst-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 9px;
	border-radius: 999px;
	background: #12b76a;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .05em;
	line-height: 1.6;
	text-transform: uppercase;
	vertical-align: middle;
}

@keyframes zstIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Estilo moderno (opcional desde ajustes) ---------- */
body.zst-modern form.checkout .form-row label { font-weight: 600; color: var(--zst-text); margin-bottom: 6px; }

body.zst-modern form.checkout .form-row input.input-text,
body.zst-modern form.checkout .form-row textarea,
body.zst-modern form.checkout .form-row select {
	min-height: 48px;
	border: 1px solid var(--zst-border);
	border-radius: 10px;
	background: #fff;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
body.zst-modern form.checkout .form-row textarea { min-height: 96px; padding-top: 12px; }
body.zst-modern form.checkout .form-row input.input-text:focus,
body.zst-modern form.checkout .form-row textarea:focus,
body.zst-modern form.checkout .form-row select:focus {
	border-color: var(--zst-primary);
	box-shadow: 0 0 0 3px rgba(66, 39, 198, .14);
	outline: none;
}
body.zst-modern form.checkout .form-row.woocommerce-invalid input.input-text,
body.zst-modern form.checkout .form-row.woocommerce-invalid .select2-selection { border-color: #f04438; }

body.zst-modern form.checkout .select2-container--default .select2-selection--single {
	height: 48px;
	border: 1px solid var(--zst-border);
	border-radius: 10px;
	background: #fff;
}
body.zst-modern form.checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 46px;
	height: 46px;
	padding: 0 34px 0 14px !important;
	color: var(--zst-text);
}
body.zst-modern form.checkout .select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; right: 8px; }
body.zst-modern form.checkout .select2-container--open .select2-selection--single,
body.zst-modern form.checkout .select2-container--focus .select2-selection--single {
	border-color: var(--zst-primary);
	box-shadow: 0 0 0 3px rgba(66, 39, 198, .14);
}
body.zst-modern .select2-dropdown { border-color: var(--zst-border); border-radius: 10px; overflow: hidden; box-shadow: 0 12px 32px rgba(16, 24, 40, .12); }
body.zst-modern .select2-results__group {
	padding: 10px 12px 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--zst-muted);
}
body.zst-modern .select2-results__option--highlighted[aria-selected],
body.zst-modern .select2-results__option--highlighted[data-selected] { background: var(--zst-primary) !important; }

/* Métodos de envío como tarjetas */
body.zst-modern #shipping_method,
body.zst-modern .woocommerce-shipping-methods { list-style: none; margin: 6px 0 0; padding: 0; }
body.zst-modern #shipping_method li.zst-rate,
body.zst-modern .woocommerce-shipping-methods li.zst-rate {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px;
	padding: 12px 14px;
	border: 1px solid var(--zst-border);
	border-radius: var(--zst-radius);
	background: #fff;
	text-align: left;
	transition: border-color .15s ease, background .15s ease;
}
body.zst-modern #shipping_method li.zst-rate input[type=radio] { margin: 0; accent-color: var(--zst-primary); width: 18px; height: 18px; flex: 0 0 18px; }
body.zst-modern #shipping_method li.zst-rate label { margin: 0; cursor: pointer; flex: 1; }
body.zst-modern #shipping_method li.zst-rate.is-selected { border-color: var(--zst-primary); background: var(--zst-primary-soft); }
body.zst-modern #shipping_method li.zst-rate-free.is-selected { border-color: var(--zst-green-border); background: var(--zst-green-bg); }

/* Términos y botón */
body.zst-modern .woocommerce-terms-and-conditions-wrapper .form-row label.checkbox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: 500;
}
body.zst-modern .woocommerce-terms-and-conditions-wrapper input#terms {
	accent-color: var(--zst-primary);
	width: 18px;
	height: 18px;
	margin-top: 2px;
	flex: 0 0 18px;
}
body.zst-modern #place_order {
	border-radius: var(--zst-radius);
	min-height: 54px;
	font-weight: 700;
	letter-spacing: .02em;
	transition: transform .15s ease, box-shadow .15s ease;
}
body.zst-modern #place_order:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16, 24, 40, .18); }

body.zst-modern .wc_payment_methods li.wc_payment_method input[type=radio] { accent-color: var(--zst-primary); }

/* ---------- Cédula / RUC ---------- */
.zst-id-msg { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.4; }
.zst-id-msg:empty { display: none; }
.zst-id-ok .zst-id-msg { color: var(--zst-green); }
.zst-id-ok .zst-id-msg::before { content: "\2713  "; font-weight: 700; }
.zst-id-bad .zst-id-msg { color: #d92d20; }
form.checkout .zst-id-ok input.input-text { border-color: #75e0a7 !important; }
form.checkout .zst-id-bad input.input-text { border-color: #f04438 !important; }
#billing_cedula { letter-spacing: .04em; }

/* ---------- Carrito: fila de envío informativa ---------- */
body.zst-cart-noship .cart_totals tr:has(> th > .woocommerce-shipping-calculator),
body.zst-cart-noship .cart_totals .woocommerce-shipping-calculator { display: none !important; }
.zst-cart-shipping td { text-align: right; }
.zst-cart-shipping__main { display: block; font-weight: 600; color: var(--zst-text); }
.zst-cart-shipping__note {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--zst-green-bg);
	color: var(--zst-green);
	font-size: 12px;
	line-height: 1.4;
	text-align: left;
}
.zst-cart-shipping__note svg { flex: 0 0 16px; width: 16px; height: 16px; }

/* ---------- Checkout: aviso contra entrega ---------- */
.zst-cod-note {
	margin: 0 0 14px;
	padding: 10px 14px;
	border-radius: var(--zst-radius);
	background: #f6f7f9;
	border: 1px solid #eceef2;
	color: var(--zst-muted);
	font-size: 13px;
	line-height: 1.5;
}
.zst-cod-note strong { color: var(--zst-text); }

/* ---------- Shortcode [zero_envio_gratis] (Elementor) ---------- */
.zst-free-box {
	padding: 18px 20px;
	border: 1px solid var(--zst-green-border);
	border-radius: 16px;
	background: var(--zst-green-bg);
	color: var(--zst-text);
}
.zst-free-box__head { display: flex; gap: 12px; align-items: center; color: var(--zst-green); margin-bottom: 12px; }
.zst-free-box__head strong { display: block; font-size: 17px; }
.zst-free-box__head span { display: block; font-size: 14px; color: var(--zst-muted); }
.zst-free-box__group { margin-top: 10px; }
.zst-free-box__group em { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--zst-muted); }
.zst-free-box__group ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.zst-free-box__group li { padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--zst-green-border); font-size: 13px; }

@media (max-width: 575px) {
	.zst-hint { font-size: 13px; }
	body.zst-modern #shipping_method li.zst-rate { padding: 10px 12px; }
}

/* =========================================================================
 * Comprobante de pedido (voucher)
 * ====================================================================== */
.zst-voucher--checkout { margin-top: 22px !important; }
.zst-voucher { --zst-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "Courier New", monospace; margin: 18px 0 14px; }
.zst-v { border: 1px solid var(--zst-border); border-radius: 14px; background: #f8f8fb; overflow: hidden; }
.zst-v.is-static { border: 0; background: transparent; overflow: visible; }

.zst-v__toggle {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 14px; cursor: pointer; list-style: none; user-select: none;
}
.zst-v__toggle::-webkit-details-marker { display: none; }
.zst-v__toggle::marker { content: ""; }
.zst-v__ico { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; background: var(--zst-primary-soft); color: var(--zst-primary); }
.zst-v__toggle-txt { flex: 1; line-height: 1.3; }
.zst-v__toggle-txt strong { display: block; font-size: 14px; color: var(--zst-text); }
.zst-v__toggle-txt small { display: block; font-size: 12px; color: var(--zst-muted); }
.zst-v__chev { width: 9px; height: 9px; border-right: 2px solid var(--zst-muted); border-bottom: 2px solid var(--zst-muted); transform: rotate(45deg); transition: transform .2s ease; margin: -4px 4px 0 0; }
.zst-v[open] .zst-v__chev { transform: rotate(225deg); margin-top: 4px; }
.zst-v[open] .zst-v__paper { animation: zstIn .25s ease; }

/* Papel térmico con bordes dentados */
.zst-v__paper {
	position: relative;
	padding: 20px 18px 18px;
	background: #fff;
	color: #1d2433;
	font-family: var(--zst-mono);
	font-size: 12.5px;
	line-height: 1.5;
	-webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 14px 51% repeat-x,
		conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 51% repeat-x;
	mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 14px 51% repeat-x,
		conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 51% repeat-x;
}
.zst-v__sheet { margin: 4px 14px 18px; filter: drop-shadow(0 1px 1px rgba(16, 24, 40, .08)) drop-shadow(0 6px 14px rgba(16, 24, 40, .07)); }
.zst-v.is-static .zst-v__sheet { margin: 0 auto 14px; max-width: 420px; }

.zst-v__head { text-align: center; color: var(--zst-muted); font-size: 11.5px; line-height: 1.45; }
.zst-v__brand { font-size: 19px; font-weight: 800; letter-spacing: .22em; color: #1d2433; margin-bottom: 2px; text-transform: uppercase; }
.zst-v__tag { margin: 10px auto 12px; width: fit-content; padding: 2px 8px; border: 1px solid #1d2433; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; text-align: center; }

.zst-v__row { display: flex; justify-content: space-between; gap: 12px; padding: 1.5px 0; }
.zst-v__row > span:first-child { color: #475467; }
.zst-v__row > span:last-child { text-align: right; overflow-wrap: anywhere; }
.zst-v__row--kv > span:first-child { flex: 0 0 auto; }
.zst-v__row--kv > span:last-child { max-width: 68%; }
.zst-v__item > span:first-child { color: #1d2433; }
.zst-v__item b { font-weight: 700; }
.zst-v__item > span:last-child { white-space: nowrap; }
.zst-v .is-empty { color: #c0c4cc; }
.zst-v__sec { margin: 2px 0 4px; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #98a2b3; }
.zst-v__cut { margin: 10px 0; border-top: 1px dashed #c9ccd4; }
.zst-v__total { margin-top: 6px; font-size: 16px; font-weight: 800; }
.zst-v__total > span:first-child { color: #1d2433; }
.zst-v__free { font-style: normal; font-weight: 700; color: var(--zst-green); }

.zst-v__barcode {
	height: 38px; margin: 16px 6px 4px;
	background: repeating-linear-gradient(90deg,
		#1d2433 0 2px, #0000 2px 4px, #1d2433 4px 5px, #0000 5px 8px, #1d2433 8px 11px, #0000 11px 12px,
		#1d2433 12px 13px, #0000 13px 16px, #1d2433 16px 18px, #0000 18px 19px, #1d2433 19px 20px, #0000 20px 23px);
	opacity: .9;
}
.zst-v__code { text-align: center; font-size: 11px; letter-spacing: .2em; color: var(--zst-muted); }
.zst-v__note {
	margin: 12px 0 8px !important; padding: 8px 10px; border-radius: 8px;
	background: var(--zst-primary-soft); color: #2a1a8a;
	font-family: inherit; font-size: 11px; line-height: 1.5; text-align: center;
}
.zst-v__thanks { text-align: center; font-weight: 700; letter-spacing: .04em; }
.zst-v__print { display: block; margin: 0 auto 24px !important; border-radius: 10px !important; }
.zst-voucher--thankyou { margin: 10px 0 30px; }

@media print {
	body.zst-print-voucher * { visibility: hidden !important; }
	body.zst-print-voucher .zst-voucher--thankyou,
	body.zst-print-voucher .zst-voucher--thankyou * { visibility: visible !important; }
	body.zst-print-voucher .zst-voucher--thankyou { position: absolute; left: 0; top: 0; width: 100%; }
	body.zst-print-voucher .zst-v__sheet { filter: none; } body.zst-print-voucher .zst-v__paper { -webkit-mask: none; mask: none; border: 1px dashed #999; }
	body.zst-print-voucher .zst-v__print { display: none !important; }
	body.zst-print-voucher .zst-v__barcode, body.zst-print-voucher .zst-v__note { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
