/* =========================================================================
   Checkout, carrito y pedido recibido · Árbol de Ser
   Capa de estilo sobre los bloques de WooCommerce. Objetivo: limpio, aireado,
   intuitivo en PC y móvil. No cambia la lógica de WooCommerce.
   ========================================================================= */

:root {
	--ck-green: #00635b;
	--ck-green-dark: #004d47;
	--ck-ink: #1d1d1f;
	--ck-ink-soft: #3a3a3c;
	--ck-muted: #6e6e73;
	--ck-line: #e5e5ea;
	--ck-bg: #f5f5f7;
	--ck-card: #ffffff;
	--ck-radius: 18px;
	--ck-radius-sm: 12px;
	--ck-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	--ck-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}

/* ---------- Página ---------- */
body.woocommerce-checkout #content,
body.woocommerce-cart #content,
body.woocommerce-order-received #content { background: var(--ck-bg); }

body.woocommerce-checkout .ast-container,
body.woocommerce-cart .ast-container,
body.woocommerce-order-received .ast-container { max-width: 1120px; }

body.woocommerce-checkout .entry-header,
body.woocommerce-cart .entry-header { max-width: 1040px; margin: 0 auto; }

body.woocommerce-checkout .entry-title,
body.woocommerce-cart .entry-title,
body.woocommerce-order-received .entry-title {
	font-family: var(--ck-font); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; color: var(--ck-ink); margin: 8px 0 20px;
}

/* El widget flotante de WhatsApp tapa el botón de pago en móvil: fuera del checkout */
body.woocommerce-checkout .qlwapp { display: none !important; }

/* ---------- Checkout por bloques ---------- */
.wp-block-woocommerce-checkout,
.wc-block-checkout { font-family: var(--ck-font); color: var(--ck-ink); max-width: 1040px; margin: 0 auto; }

.wc-block-checkout__form { max-width: none; }
.wc-block-components-checkout-form { display: block; }

/* Columnas */
.wc-block-checkout .wc-block-components-sidebar-layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
.wc-block-checkout .wc-block-components-main { width: 100%; padding: 0; }
.wc-block-checkout .wc-block-components-sidebar { width: 100%; padding: 0; margin: 0; }

/* Pasos como tarjetas */
.wc-block-components-checkout-step {
	background: var(--ck-card); border: 1px solid var(--ck-line); border-radius: var(--ck-radius); box-shadow: var(--ck-shadow);
	padding: 24px 20px; margin: 0 0 16px;
}
.wc-block-components-checkout-step::before,
.wc-block-components-checkout-step::after { display: none; }
.wc-block-components-checkout-step__heading { margin: 0 0 6px; }
.wc-block-components-checkout-step__title {
	font-family: var(--ck-font); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: var(--ck-ink); margin: 0;
}
.wc-block-components-checkout-step__description { font-size: 14px; color: var(--ck-muted); margin: 0 0 14px; line-height: 1.5; }
.wc-block-components-checkout-step__container { padding: 0; }
.wc-block-components-checkout-step__content { padding: 0; }

/* Campos */
.wc-block-components-form .wc-block-components-text-input,
.wc-block-components-select,
.wc-block-components-combobox,
.wc-block-components-country-input,
.wc-block-components-state-input { margin: 0 0 12px; }

.wc-block-components-text-input input[type="text"],
.wc-block-components-text-input input[type="email"],
.wc-block-components-text-input input[type="tel"],
.wc-block-components-text-input input[type="url"],
.wc-block-components-text-input input[type="number"],
.wc-block-components-select .components-custom-select-control__button,
.wc-block-components-combobox .components-combobox-control__input,
.wc-block-components-form .wc-block-components-select-input select,
.wc-block-components-form select {
	height: 54px; border: 1px solid var(--ck-line); border-radius: var(--ck-radius-sm); background: #fff;
	font-family: var(--ck-font); font-size: 16px; color: var(--ck-ink); padding: 18px 14px 6px; box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.wc-block-components-text-input input:focus,
.wc-block-components-select .components-custom-select-control__button:focus,
.wc-block-components-combobox .components-combobox-control__input:focus,
.wc-block-components-form select:focus {
	outline: none; border-color: var(--ck-green); box-shadow: 0 0 0 4px rgba(0, 99, 91, 0.12);
}
.wc-block-components-text-input label,
.wc-block-components-select label,
.wc-block-components-combobox label,
.wc-block-components-form .wc-block-components-select-input label {
	font-family: var(--ck-font); font-size: 15px; color: var(--ck-muted); left: 14px;
}
.wc-block-components-text-input.is-active label,
.wc-block-components-text-input input:focus + label,
.wc-block-components-text-input input:not(:placeholder-shown) + label,
.wc-block-components-select.is-active label,
.wc-block-components-combobox.is-active label { font-size: 12px; }
.wc-block-components-text-input.has-error input { border-color: #d6453d; }
.wc-block-components-validation-error p { font-size: 13px; }

/* Dos columnas para nombre/apellidos y CP/ciudad en escritorio */
.wc-block-components-address-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.wc-block-components-address-form > * { grid-column: span 2; }
.wc-block-components-address-form .wc-block-components-address-form__first_name,
.wc-block-components-address-form .wc-block-components-address-form__last_name,
.wc-block-components-address-form .wc-block-components-address-form__postcode,
.wc-block-components-address-form .wc-block-components-address-form__city,
.wc-block-components-address-form .wc-block-components-address-form__state,
.wc-block-components-address-form .wc-block-components-address-form__phone { grid-column: span 1; }
.wc-block-components-address-form .wc-block-components-address-form__address_2-toggle { font-size: 14px; color: var(--ck-green); margin: -4px 0 12px; }

/* Tarjeta de dirección guardada */
.wc-block-components-address-card { border: 1px solid var(--ck-line); border-radius: var(--ck-radius-sm); padding: 14px 16px; font-size: 15px; }
.wc-block-components-address-card__edit { color: var(--ck-green); font-weight: 500; }

/* Opciones de pago */
.wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control__option {
	border: 1px solid var(--ck-line); border-radius: var(--ck-radius-sm); padding: 14px 16px 14px 46px; margin: 0 0 10px; background: #fff;
	font-family: var(--ck-font); font-size: 15px; transition: border-color 0.15s, background-color 0.15s;
}
.wc-block-components-radio-control-accordion-option:last-child { margin-bottom: 0; }
.wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.wc-block-components-radio-control__option--checked-option-highlighted,
.wc-block-components-radio-control-accordion-option:has(input:checked) { border-color: var(--ck-green); background: #f2f8f7; }
.wc-block-components-radio-control__input { left: 16px; top: 18px; width: 20px; height: 20px; border: 1.5px solid #c7c7cc; }
.wc-block-components-radio-control__input:checked { border-color: var(--ck-green); }
.wc-block-components-radio-control__input:checked::before { background: var(--ck-green); width: 10px; height: 10px; }
.wc-block-components-radio-control__label { font-weight: 500; color: var(--ck-ink); }
.wc-block-components-radio-control__label img { max-height: 22px; margin-left: 10px; vertical-align: middle; }
.wc-block-components-radio-control-accordion-content { padding: 10px 0 0; font-size: 14px; color: var(--ck-muted); line-height: 1.55; }
.wc-block-components-radio-control-accordion-content p { margin: 0 0 6px; }

/* Nota al pedido y checkboxes */
.wc-block-checkout__add-note .wc-block-components-checkbox { margin-top: 4px; }
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #c7c7cc; }
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked { background: var(--ck-green); border-color: var(--ck-green); }
.wc-block-components-checkbox__label { font-size: 15px; color: var(--ck-ink-soft); }

/* Términos y botón */
.wc-block-checkout__terms { font-size: 13px; color: var(--ck-muted); margin: 8px 0 14px; }
.wc-block-checkout__terms a { color: var(--ck-green); }
.wc-block-checkout__actions { margin: 0; }
.wc-block-checkout__actions_row { justify-content: stretch; }
/* Los botones globales de Astra/Elementor (10 px, mayúsculas, radio 30) tienen más especificidad: se fuerza aquí */
.wc-block-checkout .wc-block-components-checkout-place-order-button.wp-element-button,
.wc-block-checkout .wc-block-components-checkout-place-order-button,
.wc-block-cart .wc-block-cart__submit-button.wp-element-button,
.wc-block-cart .wc-block-cart__submit-button {
	width: 100% !important; min-height: 56px !important; height: auto !important; padding: 16px 24px !important;
	border-radius: 14px !important; background: var(--ck-green) !important; color: #fff !important; border: 0 !important;
	font-family: var(--ck-font) !important; font-size: 17px !important; font-weight: 600 !important; line-height: 1.2 !important;
	letter-spacing: 0 !important; text-transform: none !important;
	box-shadow: 0 6px 18px rgba(0, 99, 91, 0.25); transition: background-color 0.15s, transform 0.1s;
}
.wc-block-checkout .wc-block-components-checkout-place-order-button:hover,
.wc-block-cart .wc-block-cart__submit-button:hover { background: var(--ck-green-dark) !important; color: #fff !important; }
.wc-block-components-checkout-place-order-button .wc-block-components-button__text { font-size: inherit; }

/* Tipografía uniforme dentro del checkout y el carrito (el cuerpo del sitio usa una fuente serif) */
.wc-block-checkout :is(p, label, span, div, button, input, select, textarea, h2, h3, a, li),
.wc-block-cart :is(p, label, span, div, button, input, select, textarea, h2, h3, a, li) { font-family: var(--ck-font); }
.wc-block-components-checkout-order-summary__title-text,
.wc-block-components-sidebar h2 { font-family: var(--ck-font) !important; font-size: 18px !important; font-weight: 600 !important; color: var(--ck-ink); }
.wc-block-components-checkout-place-order-button:active { transform: translateY(1px); }
.wc-block-components-checkout-return-to-cart-button { color: var(--ck-muted); font-size: 14px; }

/* Resumen del pedido */
.wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block,
.wc-block-components-sidebar .wc-block-components-order-summary {
	background: var(--ck-card); border: 1px solid var(--ck-line); border-radius: var(--ck-radius); box-shadow: var(--ck-shadow); padding: 20px; font-family: var(--ck-font);
}
.wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-order-summary { background: none; border: 0; box-shadow: none; padding: 0; }
.wc-block-components-checkout-order-summary__title { font-family: var(--ck-font); font-size: 18px; font-weight: 600; color: var(--ck-ink); padding: 0 0 12px; border-bottom: 1px solid var(--ck-line); }
.wc-block-components-checkout-order-summary__title-text { font-family: var(--ck-font); }
.wc-block-components-order-summary-item { padding: 14px 0; border-bottom: 1px solid var(--ck-line); }
.wc-block-components-order-summary-item__image { width: 56px; }
.wc-block-components-order-summary-item__image img { border-radius: 10px; }
.wc-block-components-order-summary-item__quantity { background: var(--ck-green); border-color: var(--ck-green); color: #fff; font-size: 12px; box-shadow: none; }
.wc-block-components-product-name { font-size: 15px; font-weight: 500; color: var(--ck-ink); }
.wc-block-components-order-summary-item__total-price { font-weight: 600; }
.wc-block-components-order-summary-item__individual-prices,
.wc-block-components-product-metadata { font-size: 13px; color: var(--ck-muted); }
.wc-block-components-product-metadata__description { display: none; } /* la descripción corta repite la ficha */
.wc-block-components-totals-wrapper { padding: 12px 0; border-top: 1px solid var(--ck-line); }
.wc-block-components-totals-item { font-size: 15px; color: var(--ck-ink-soft); }
.wc-block-components-totals-footer-item { padding: 14px 0 0; }
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label { font-size: 18px; font-weight: 600; color: var(--ck-ink); }
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value { font-size: 22px; font-weight: 600; color: var(--ck-green); }
.wc-block-components-totals-coupon .wc-block-components-panel__button { font-size: 15px; color: var(--ck-green); font-weight: 500; }
.wc-block-components-totals-coupon__form .wc-block-components-text-input input { height: 48px; }
.wc-block-components-totals-coupon__button { height: 48px; border-radius: 10px; background: var(--ck-ink); border-color: var(--ck-ink); color: #fff; }
.wc-block-components-chip { background: #f2f8f7; border-color: var(--ck-green); color: var(--ck-green); }

/* Avisos */
.wc-block-components-notice-banner { border-radius: var(--ck-radius-sm); font-family: var(--ck-font); }

/* Resumen plegable en móvil */
.wc-block-components-sidebar .wc-block-components-panel__button { font-family: var(--ck-font); }

/* ---------- Carrito por bloques ---------- */
.wp-block-woocommerce-cart { font-family: var(--ck-font); color: var(--ck-ink); max-width: 1040px; margin: 0 auto; }
.wc-block-cart .wc-block-components-sidebar-layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
.wc-block-cart .wc-block-components-main,
.wc-block-cart .wc-block-components-sidebar { width: 100%; padding: 0; margin: 0; }
.wc-block-cart .wc-block-cart-items,
.wc-block-cart .wp-block-woocommerce-cart-order-summary-block {
	background: var(--ck-card); border: 1px solid var(--ck-line); border-radius: var(--ck-radius); box-shadow: var(--ck-shadow); padding: 20px;
}
.wc-block-cart-items__header { display: none; }
.wc-block-cart-items .wc-block-cart-item__image img { border-radius: 10px; }
.wc-block-cart-item__product .wc-block-components-product-name { font-size: 16px; font-weight: 500; }
.wc-block-cart-item__remove-link { font-size: 13px; color: var(--ck-muted); }
.wc-block-components-quantity-selector { border-radius: 10px; }
/* (botón del carrito: reglas unificadas más arriba con el de finalizar compra) */

/* ---------- Pedido recibido (clásico) ---------- */
body.woocommerce-order-received .woocommerce { font-family: var(--ck-font); color: var(--ck-ink); max-width: 760px; margin: 0 auto; }
body.woocommerce-order-received .woocommerce-thankyou-order-received {
	font-size: 22px; font-weight: 600; color: var(--ck-green); margin: 0 0 18px; letter-spacing: -0.01em;
}
body.woocommerce-order-received .woocommerce-order-overview {
	display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; list-style: none; margin: 0 0 24px; padding: 20px;
	background: var(--ck-card); border: 1px solid var(--ck-line); border-radius: var(--ck-radius); box-shadow: var(--ck-shadow);
}
body.woocommerce-order-received .woocommerce-order-overview li { border: 0; margin: 0; padding: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ck-muted); float: none; }
body.woocommerce-order-received .woocommerce-order-overview li strong { display: block; font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--ck-ink); margin-top: 4px; }
body.woocommerce-order-received .woocommerce-bacs-bank-details,
body.woocommerce-order-received .woocommerce-order-details,
body.woocommerce-order-received .woocommerce-customer-details {
	background: var(--ck-card); border: 1px solid var(--ck-line); border-radius: var(--ck-radius); box-shadow: var(--ck-shadow); padding: 20px; margin: 0 0 20px;
}
body.woocommerce-order-received .woocommerce-order-details__title,
body.woocommerce-order-received .woocommerce-column__title,
body.woocommerce-order-received .wc-bacs-bank-details-heading { font-family: var(--ck-font); font-size: 18px; font-weight: 600; margin: 0 0 12px; }
body.woocommerce-order-received table.woocommerce-table { border: 0; font-size: 15px; }
body.woocommerce-order-received table.woocommerce-table th,
body.woocommerce-order-received table.woocommerce-table td { border-color: var(--ck-line); padding: 10px 6px; }
body.woocommerce-order-received .ads-redsys-aviso { border-radius: var(--ck-radius-sm); }
body.woocommerce-order-received #redsys_payment_form #submit_redsys_payment_form { min-height: 54px; border-radius: 14px; font-family: var(--ck-font); font-size: 16px; }

/* ---------- Escritorio ---------- */
@media (min-width: 900px) {
	.wc-block-checkout .wc-block-components-sidebar-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
	.wc-block-checkout .wc-block-components-sidebar { position: sticky; top: 110px; }
	.wc-block-components-checkout-step { padding: 28px 28px; }
	.wc-block-cart .wc-block-components-sidebar-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
	.wc-block-cart .wc-block-components-sidebar { position: sticky; top: 110px; }
}

/* ---------- Móvil ---------- */
@media (max-width: 899px) {
	.wc-block-components-checkout-step { padding: 20px 16px; border-radius: 14px; }
	.wc-block-components-address-form { grid-template-columns: 1fr; }
	.wc-block-components-address-form > * { grid-column: span 1; }
	.wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block { padding: 14px 16px; }
	.wc-block-components-checkout-place-order-button { position: sticky; bottom: 12px; z-index: 5; }
	body.woocommerce-checkout .entry-title { font-size: 24px; }
}
