/* =====================================================================
   SmartParts - checkout y "Gracias"
   Reune: "CSS CHECKOUT NUEVO CLAUDE", estilos de "Fix + Rediseño Metodos
   de Pago" y de "Resumen de Pedido v2".
   ===================================================================== */

.woocommerce-checkout .sp-page { max-width: 1180px; }

/* Pasos */
.sp-steps { display: flex; align-items: center; justify-content: center; margin: 6px auto 26px; }
.sp-steps__step { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--sp-muted); text-decoration: none; }
.sp-steps__step.is-active { color: var(--sp-text); font-weight: 600; }
.sp-steps__step.is-done { color: var(--sp-green); }
a.sp-steps__step:hover .sp-steps__txt { text-decoration: underline; }
.sp-steps__num { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #ccc; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: var(--sp-card); }
.sp-steps__step.is-active .sp-steps__num, .sp-steps__step.is-done .sp-steps__num { background: var(--sp-green); border-color: var(--sp-green); color: #fff; }
.sp-steps__line { width: 44px; height: 1px; background: #ddd; margin: 0 6px; }
.sp-steps__line.is-done { background: var(--sp-green); }
@media (max-width: 640px) { .sp-steps__txt { font-size: 11px; } .sp-steps__num { width: 20px; height: 20px; font-size: 10px; } .sp-steps__line { width: 22px; } }

/* Layout: datos a la izquierda, resumen y pago a la derecha */
@media (min-width: 992px) {
	form.checkout.woocommerce-checkout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 26px; align-items: start; }
	form.checkout #customer_details { grid-column: 1; }
	form.checkout #order_review_heading { display: none; }
	form.checkout #order_review { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 140px; }
	form.checkout > .woocommerce-NoticeGroup { grid-column: 1 / -1; }
}
form.checkout #order_review_heading { display: none; }
#customer_details .col-1, #customer_details .col-2 { width: 100%; float: none; }

.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields {
	background: var(--sp-card); border-radius: 14px; border: 1px solid var(--sp-border); padding: 20px 22px; margin-bottom: 16px;
}
.woocommerce-checkout h3 { font-size: 16px; font-weight: 800; margin: 0 0 14px; }
.woocommerce-billing-fields__field-wrapper { display: flex; flex-wrap: wrap; justify-content: space-between; }
.woocommerce-checkout .form-row { width: 100%; margin: 0 0 12px; padding: 0; }
.woocommerce-checkout .form-row label { display: block; font-size: 12px; font-weight: 600; color: var(--sp-muted); margin-bottom: 4px; }
.woocommerce-checkout .form-row .required { color: #e53935; text-decoration: none; }
.woocommerce-checkout .form-row input.input-text, .woocommerce-checkout .form-row select, .woocommerce-checkout .form-row textarea { width: 100%; height: 42px; font-size: 14px; }
.woocommerce-checkout .form-row textarea { height: auto; min-height: 80px; }
.woocommerce-checkout .select2-container .select2-selection--single { height: 42px; border: 1px solid var(--sp-border); border-radius: 10px; background: var(--sp-card); }
.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__rendered { line-height: 40px; color: var(--sp-text); }
.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__arrow { height: 40px; }
#billing_country_field, .woocommerce-account-fields, .create-account { display: none !important; }
@media (min-width: 641px) {
	#billing_first_name_field, #billing_last_name_field, #billing_phone_field, #billing_email_field,
	#billing_city_field, #billing_state_field, #billing_tipo_documento_field, #billing_numero_documento_field,
	#billing_documento_field, #billing_cpf_field, #billing_wooccm8_field { width: 48.5%; }
}
#billing_company_field { order: 99; opacity: .8; }

/* Resumen propio (la tabla nativa queda oculta) */
.woocommerce-checkout-review-order-table:not(.sp-ro) { display: none !important; }
#sp-order-summary { background: var(--sp-card); border-radius: 14px; border: 1px solid var(--sp-border); padding: 18px 20px; margin-bottom: 16px; }
#sp-order-summary.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.sp-os__title { font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.sp-os__item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--sp-border); }
.sp-os__item:last-child { border-bottom: 0; }
.sp-os__item img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--sp-bg-alt); flex-shrink: 0; }
.sp-os__name { font-size: 12.5px; font-weight: 500; line-height: 1.4; margin: 0 0 2px; }
.sp-os__qty { font-size: 11.5px; color: var(--sp-muted); margin: 0; }
.sp-os__price { font-size: 12.5px; font-weight: 600; color: var(--sp-blue); margin-left: auto; white-space: nowrap; }
.sp-os__divider { height: 1px; background: var(--sp-border); margin: 12px 0; }
.sp-os__row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; }
.sp-os__row > span:first-child { color: var(--sp-muted); display: flex; align-items: center; gap: 6px; }
.sp-os__row > span:last-child { font-weight: 600; }
.sp-os__row .is-green { color: #0f6e56; }
.sp-os__badge { font-size: 10px; font-weight: 600; background: #e1f5ee; color: #0f6e56; border-radius: 99px; padding: 1px 7px; }
.sp-os__total { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--sp-border); }
.sp-os__total span { font-size: 14px; font-weight: 700; }
.sp-os__total strong { font-size: 19px; color: var(--sp-blue); }
html.sp-dark .sp-os__total strong, html.sp-dark .sp-os__price { color: var(--sp-cyan); }
#sp-os-savings { background: #e1f5ee; border-radius: 10px; padding: 12px 14px; margin: 12px 0 4px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: #0f6e56; }
#sp-os-savings[hidden] { display: none; }

/* Medios de pago como tarjetas */
#payment { background: transparent !important; }
#payment ul.wc_payment_methods { display: flex; flex-direction: column; gap: 10px; padding: 0; margin: 0 0 14px; list-style: none; border: 0; }
#payment ul.wc_payment_methods li.wc_payment_method { position: relative; background: var(--sp-card); border: 1.5px solid var(--sp-border); border-radius: 14px; padding: 0; overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease; }
#payment ul.wc_payment_methods li.wc_payment_method:has(input:checked) { border-color: var(--sp-green); box-shadow: 0 0 0 3px rgba(14, 138, 110, .08); }
#payment ul.wc_payment_methods li.wc_payment_method > label { display: flex !important; align-items: center; gap: 12px; padding: 15px 16px; margin: 0; cursor: pointer; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
#payment ul.wc_payment_methods li.wc_payment_method > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
#payment ul.wc_payment_methods li.wc_payment_method > label::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c9c7bf; flex-shrink: 0; box-sizing: border-box; }
#payment ul.wc_payment_methods li.wc_payment_method:has(input:checked) > label::before { border: 6px solid var(--sp-green); }
#payment ul.wc_payment_methods li.wc_payment_method label img { max-height: 22px; width: auto; margin-left: auto !important; }
#payment .payment_box { background: var(--sp-bg-alt) !important; border-top: 1px solid var(--sp-border); padding: 14px 16px !important; margin: 0 !important; font-size: 13px; color: var(--sp-muted); line-height: 1.6; }
#payment .payment_box::before { display: none !important; }
#payment .payment_box p:last-child { margin-bottom: 0; }
.woocommerce-checkout.processing #payment, .woocommerce-checkout.processing #sp-order-summary { opacity: .5; pointer-events: none; }
#payment .place-order { padding: 0; margin: 0; }
#place_order { width: 100%; height: 50px; border-radius: 12px; background: var(--sp-green) !important; color: #fff; font-size: 15px; font-weight: 700; border: 0; cursor: pointer; }
#place_order:hover { filter: brightness(1.08); }
#place_order:disabled { opacity: .5; cursor: not-allowed; }
.woocommerce-terms-and-conditions-wrapper { font-size: 12.5px; color: var(--sp-muted); margin: 6px 0 12px; }

.sp-trust-row { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin: 12px 0; padding: 12px; background: var(--sp-bg-alt); border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--sp-muted); }
.sp-trust { margin-top: 12px; font-size: 11.5px; color: var(--sp-muted); line-height: 1.5; }
.sp-trust p { margin: 0 0 4px; }

/* Barra fija en celular */
#sp-sticky-bar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999; background: var(--sp-bg); border-top: 1px solid var(--sp-border); padding: 10px 14px; box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); align-items: center; justify-content: space-between; gap: 12px; }
.sp-sticky__total { display: flex; flex-direction: column; line-height: 1.2; }
.sp-sticky__total span { font-size: 10.5px; color: var(--sp-muted); }
.sp-sticky__total strong { font-size: 16px; color: var(--sp-blue); }
#sp-sticky-btn { background: var(--sp-green); color: #fff; border: 0; border-radius: 10px; padding: 12px 20px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
@media (max-width: 991px) {
	#sp-sticky-bar { display: flex; }
	.woocommerce-checkout .sp-main { padding-bottom: 76px; }
}
.woocommerce-order-received #sp-sticky-bar { display: none !important; }

/* ---------- Pagina de "Gracias" ---------- */
.woocommerce-order-received .woocommerce-thankyou-order-received,
.woocommerce-order-received .woocommerce-order-overview,
.woocommerce-order-received .woocommerce-order-details,
.woocommerce-order-received .woocommerce-customer-details,
.woocommerce-order-received .woocommerce-bacs-bank-details > h2 { display: none !important; }
.sp-ty { max-width: 740px; margin: 0 auto; }
.sp-ty__hero, .sp-ty__card, .sp-ty__meta > div { background: var(--sp-card); border: 1px solid var(--sp-border); border-radius: 16px; }
.sp-ty__hero { text-align: center; padding: 30px 22px; margin-bottom: 14px; }
.sp-ty__icon { width: 56px; height: 56px; border-radius: 50%; background: var(--sp-green); color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.sp-ty__title { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.sp-ty__sub { font-size: 13px; color: var(--sp-muted); }
.sp-ty__meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.sp-ty__meta > div { padding: 12px; text-align: center; border-radius: 12px; }
.sp-ty__meta small { display: block; font-size: 11px; color: var(--sp-muted); margin-bottom: 4px; }
.sp-ty__meta b { font-size: 13px; }
.is-green, .sp-ty__meta .is-green, .sp-ty__meta .is-green .woocommerce-Price-amount { color: var(--sp-green); }
.sp-ty__card { margin-bottom: 14px; overflow: hidden; }
.sp-ty__cardhead { padding: 13px 20px; border-bottom: 1px solid var(--sp-border); font-size: 14px; font-weight: 700; }
.sp-ty__next { margin: 0; padding: 16px 20px 16px 40px; font-size: 13px; color: var(--sp-muted); }
.sp-ty__next li { margin-bottom: 8px; }
.sp-ty__item { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--sp-border); font-size: 13px; }
.sp-ty__thumb img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.sp-ty__name { flex: 1; font-weight: 600; }
.sp-ty__name small { display: block; font-weight: 400; color: var(--sp-muted); }
.sp-ty__totals { padding: 12px 20px; font-size: 13px; }
.sp-ty__totals > div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--sp-muted); }
.sp-ty__grand { font-size: 16px !important; font-weight: 700; color: var(--sp-text) !important; border-top: 1px solid var(--sp-border); margin-top: 6px; padding-top: 10px !important; }
.sp-ty__addr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 20px; font-size: 12.5px; color: var(--sp-muted); line-height: 1.8; }
.sp-ty__addr small { display: block; text-transform: uppercase; letter-spacing: .5px; font-size: 11px; font-weight: 700; }
.sp-ty__cta { display: flex; gap: 10px; }
.sp-ty__cta .sp-btn { flex: 1; padding: 13px; }
@media (max-width: 560px) { .sp-ty__meta { grid-template-columns: 1fr 1fr; } .sp-ty__addr { grid-template-columns: 1fr; } .sp-ty__cta { flex-direction: column; } }

/* Igual que el child theme anterior: sin bloque de "enviar a otra direccion". */
.woocommerce-checkout .woocommerce-shipping-fields { display: none !important; }

/* Eleccion de envio (review-order.php del tema) */
.sp-ro { display: block !important; background: var(--sp-card); border: 1px solid var(--sp-border); border-radius: 14px; padding: 16px 18px; margin: 0 0 16px; width: 100%; }
.sp-ro__label { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.sp-ro__table { width: 100%; border: 0 !important; margin: 0 !important; border-collapse: collapse; }
.sp-ro__table tr, .sp-ro__table th, .sp-ro__table td { display: block; border: 0 !important; padding: 0 !important; background: none !important; width: 100%; }
.sp-ro__table tr.woocommerce-shipping-totals > th { display: none; }
.sp-ro__table td::before { display: none !important; }
.sp-ro .woocommerce-shipping-destination, .sp-ro .woocommerce-shipping-calculator { display: none; }
.sp-ro .sm-address { display: none; }
