/* Kira Miyagi - estilo de tienda, carrito y checkout.
   Todo va encapsulado bajo las clases de body de WooCommerce. */

body.woocommerce-checkout,
body.woocommerce-cart,
body.woocommerce-shop,
body.tax-product_cat,
body.tax-product_tag,
body.single-product {
	--km-ink: #111827;
	--km-text: #4b5563;
	--km-muted: #6b7280;
	--km-line: #e5e7eb;
	--km-soft: #f6f6f7;
	--km-radius: 10px;
	--km-focus: 0 0 0 3px rgba(17, 24, 39, 0.18);
}

/* ---------- Carrito y checkout: encabezado compacto ---------- */
body.woocommerce-checkout .page-header,
body.woocommerce-cart .page-header {
	background: transparent;
	padding: 28px 0 4px;
	margin: 0;
	border: 0;
}
body.woocommerce-checkout .page-header .entry-title,
body.woocommerce-cart .page-header .entry-title {
	font-size: 26px;
	font-weight: 600;
	color: var(--km-ink);
	margin: 0 0 4px;
}
body.woocommerce-checkout .site-content,
body.woocommerce-cart .site-content {
	padding-top: 20px;
}

/* ---------- Texto base con contraste suficiente ---------- */
body.woocommerce-checkout .wc-block-checkout,
body.woocommerce-cart .wc-block-cart {
	color: var(--km-text);
	font-size: 15px;
	line-height: 1.5;
}

/* ---------- Columnas ---------- */
@media (min-width: 992px) {
	body.woocommerce-checkout .wc-block-components-sidebar-layout,
	body.woocommerce-cart .wc-block-components-sidebar-layout {
		display: flex;
		flex-wrap: nowrap;
		align-items: flex-start;
		gap: 48px;
	}
	body.woocommerce-checkout .wc-block-components-sidebar-layout .wc-block-components-main,
	body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-main {
		flex: 1 1 0;
		width: auto;
		min-width: 0;
		padding-right: 0;
	}
	body.woocommerce-checkout .wc-block-components-sidebar-layout .wc-block-components-sidebar,
	body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar {
		flex: 0 0 420px;
		width: 420px;
		padding: 24px;
		position: sticky;
		top: 96px;
	}
}

/* ---------- Panel de resumen ---------- */
body.woocommerce-checkout .wc-block-components-sidebar,
body.woocommerce-cart .wc-block-components-sidebar {
	background: var(--km-soft);
	border: 1px solid var(--km-line);
	border-radius: var(--km-radius);
	padding: 24px;
	box-sizing: border-box;
}
body.woocommerce-checkout .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block,
body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-wrapper,
body.woocommerce-cart .wc-block-components-sidebar .wc-block-components-totals-wrapper {
	border: 0;
	background: transparent;
}
body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-wrapper,
body.woocommerce-cart .wc-block-components-sidebar .wc-block-components-totals-wrapper {
	padding: 12px 0;
	border-top: 1px solid var(--km-line);
}
body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-wrapper:first-child,
body.woocommerce-cart .wc-block-components-sidebar .wc-block-components-totals-wrapper:first-child {
	border-top: 0;
}
body.woocommerce-checkout .wc-block-components-checkout-order-summary__title-text,
body.woocommerce-cart .wc-block-cart__totals-title {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	color: var(--km-ink);
}
body.woocommerce-checkout .wc-block-components-totals-item__label,
body.woocommerce-cart .wc-block-components-totals-item__label {
	color: var(--km-text);
	font-size: 15px;
}
body.woocommerce-checkout .wc-block-components-totals-item__value,
body.woocommerce-cart .wc-block-components-totals-item__value {
	color: var(--km-ink);
	font-size: 15px;
	font-weight: 500;
}
body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-size: 17px;
	font-weight: 600;
	color: var(--km-ink);
}
body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-size: 22px;
	font-weight: 700;
	color: var(--km-ink);
}
body.woocommerce-checkout .wc-block-components-totals-footer-item-tax,
body.woocommerce-cart .wc-block-components-totals-footer-item-tax {
	color: var(--km-muted);
	font-size: 13px;
}

/* ---------- Productos dentro del resumen y del carrito ---------- */
body.woocommerce-checkout .wc-block-components-product-name,
body.woocommerce-cart .wc-block-components-product-name {
	color: var(--km-ink);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}
body.woocommerce-checkout .wc-block-components-product-metadata,
body.woocommerce-cart .wc-block-components-product-metadata,
body.woocommerce-checkout .wc-block-components-product-details,
body.woocommerce-cart .wc-block-components-product-details {
	color: var(--km-muted);
	font-size: 13px;
}
body.woocommerce-checkout .wc-block-components-order-summary-item__image img,
body.woocommerce-cart .wc-block-cart-item__image img {
	border-radius: 8px;
	border: 1px solid var(--km-line);
	background: #fff;
}
body.woocommerce-checkout .wc-block-components-sale-badge,
body.woocommerce-cart .wc-block-components-sale-badge,
body.woocommerce-checkout .wc-block-components-product-badge,
body.woocommerce-cart .wc-block-components-product-badge {
	background: #ecfdf3;
	color: #166534;
	border: 0;
	border-radius: 999px;
	padding: 2px 10px;
	font-size: 12px;
	font-weight: 600;
	text-transform: none;
}
body.woocommerce-cart .wc-block-cart-items th {
	color: var(--km-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
}
body.woocommerce-cart .wc-block-cart-items td {
	border-color: var(--km-line);
	padding-top: 20px;
	padding-bottom: 20px;
}
body.woocommerce-cart .wc-block-cart-item__total .wc-block-components-product-price {
	color: var(--km-ink);
	font-size: 15px;
	font-weight: 600;
}
body.woocommerce-cart .wc-block-components-quantity-selector {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	min-height: 40px;
}
body.woocommerce-cart .wc-block-components-quantity-selector::after {
	border: 0;
}
body.woocommerce-cart .wc-block-components-quantity-selector__button {
	min-width: 40px;
	color: var(--km-ink);
	opacity: 1;
}
body.woocommerce-cart .wc-block-components-quantity-selector__input {
	color: var(--km-ink);
	font-size: 15px;
}

/* ---------- Pasos del checkout ---------- */
body.woocommerce-checkout .wc-block-components-checkout-step {
	margin-bottom: 32px;
}
body.woocommerce-checkout .wc-block-components-checkout-step__title {
	font-size: 19px;
	font-weight: 600;
	color: var(--km-ink);
}
body.woocommerce-checkout .wc-block-components-checkout-step__description {
	color: var(--km-muted);
	font-size: 14px;
}

/* ---------- Campos ---------- */
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-textarea,
body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__container,
body.woocommerce-cart .wc-block-components-text-input input,
body.woocommerce-cart .wc-blocks-components-select .wc-blocks-components-select__container {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	color: var(--km-ink);
	font-size: 16px; /* evita el zoom automático en iPhone */
	box-shadow: none;
}
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-cart .wc-block-components-text-input input {
	min-height: 52px;
}
body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__select {
	border-radius: 8px;
	color: var(--km-ink);
	font-size: 16px;
}
body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-blocks-components-select__label,
body.woocommerce-cart .wc-block-components-text-input label {
	color: var(--km-muted);
}
body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-textarea:focus,
body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__container:focus-within,
body.woocommerce-cart .wc-block-components-text-input input:focus {
	border-color: var(--km-ink);
	box-shadow: var(--km-focus);
	outline: 0;
}
body.woocommerce-checkout .wc-block-components-text-input.has-error input {
	border-color: #b91c1c;
}
body.woocommerce-checkout .wc-block-components-validation-error {
	color: #b91c1c;
	font-size: 13px;
}
body.woocommerce-checkout .wc-block-components-checkbox__input[type="checkbox"] {
	border: 1px solid #9ca3af;
	border-radius: 5px;
}
body.woocommerce-checkout .wc-block-components-checkbox__label,
body.woocommerce-checkout .wc-block-checkout__terms {
	color: var(--km-text);
	font-size: 14px;
}

/* ---------- Opciones de envío y de pago como tarjetas ---------- */
body.woocommerce-checkout .wc-block-components-radio-control--highlight-checked,
body.woocommerce-checkout .wc-block-components-radio-control--highlight-checked::after {
	border-color: transparent;
}
body.woocommerce-checkout .wc-block-components-radio-control__option,
body.woocommerce-checkout .wc-block-components-radio-control-accordion-option {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	margin-bottom: 8px;
	box-shadow: none;
}
body.woocommerce-checkout .wc-block-components-radio-control-accordion-option::after,
body.woocommerce-checkout .wc-block-components-radio-control__option::after {
	display: none;
}
body.woocommerce-checkout .wc-block-components-radio-control__option {
	padding-top: 14px;
	padding-bottom: 14px;
}
body.woocommerce-checkout .wc-block-components-radio-control__option-checked,
body.woocommerce-checkout .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
body.woocommerce-checkout .wc-block-components-radio-control__option--checked-option-highlighted {
	border-color: var(--km-ink);
	box-shadow: inset 0 0 0 1px var(--km-ink);
}
body.woocommerce-checkout .wc-block-components-radio-control__label,
body.woocommerce-checkout .wc-block-components-radio-control__secondary-label {
	color: var(--km-ink);
	font-size: 15px;
	font-weight: 500;
}
body.woocommerce-checkout .wc-block-components-radio-control__input:checked {
	border-color: var(--km-ink);
}
body.woocommerce-checkout .wc-block-components-radio-control__input:checked::before {
	background: var(--km-ink);
}

/* ---------- Botones principales ---------- */
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-cart .wc-block-cart__submit-button {
	background: var(--km-ink);
	color: #fff;
	border: 0;
	border-radius: 8px;
	min-height: 56px;
	width: 100%;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	transition: background-color 0.15s ease;
}
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover,
body.woocommerce-cart .wc-block-cart__submit-button:hover {
	background: #000;
	color: #fff;
}
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:focus-visible,
body.woocommerce-cart .wc-block-cart__submit-button:focus-visible {
	outline: 0;
	box-shadow: var(--km-focus);
}
body.woocommerce-checkout .wc-block-checkout__actions_row {
	flex-direction: column-reverse;
	align-items: stretch;
	gap: 14px;
}
body.woocommerce-checkout .wc-block-components-checkout-return-to-cart-button {
	color: var(--km-text);
	font-size: 14px;
	align-self: center;
}
body.woocommerce-checkout .wc-block-components-totals-coupon__button,
body.woocommerce-cart .wc-block-components-totals-coupon__button {
	border-radius: 8px;
	min-height: 52px;
}
body.woocommerce-checkout .wc-block-components-panel__button,
body.woocommerce-cart .wc-block-components-panel__button {
	color: var(--km-ink);
	font-size: 15px;
}

/* ---------- Avisos ---------- */
body.woocommerce-checkout .wc-block-components-notice-banner,
body.woocommerce-cart .wc-block-components-notice-banner {
	border-radius: 8px;
	font-size: 14px;
}

/* ---------- Tienda y categorías ---------- */
body.woocommerce-shop ul.products li.product .product-loop-image-wrapper,
body.tax-product_cat ul.products li.product .product-loop-image-wrapper,
body.tax-product_tag ul.products li.product .product-loop-image-wrapper {
	border-radius: var(--km-radius);
	overflow: hidden;
	background: var(--km-soft);
}
body.woocommerce-shop ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__title,
body.woocommerce-shop ul.products li.product .woocommerce-loop-product__title a,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title a,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__title a {
	color: var(--km-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
}
body.woocommerce-shop ul.products li.product .price,
body.tax-product_cat ul.products li.product .price,
body.tax-product_tag ul.products li.product .price {
	color: var(--km-ink);
	font-size: 15px;
	font-weight: 600;
}
body.woocommerce-shop ul.products li.product .price del,
body.tax-product_cat ul.products li.product .price del,
body.tax-product_tag ul.products li.product .price del {
	color: var(--km-muted);
	font-weight: 400;
}
body.woocommerce-shop ul.products li.product .price ins,
body.tax-product_cat ul.products li.product .price ins,
body.tax-product_tag ul.products li.product .price ins {
	text-decoration: none;
}
body.woocommerce-shop ul.products li.product .woocommerce-price-suffix,
body.tax-product_cat ul.products li.product .woocommerce-price-suffix,
body.tax-product_tag ul.products li.product .woocommerce-price-suffix,
body.single-product .summary .woocommerce-price-suffix {
	color: var(--km-muted);
	font-size: 12px;
	font-weight: 400;
}
body.woocommerce-shop ul.products li.product .onsale,
body.tax-product_cat ul.products li.product .onsale,
body.tax-product_tag ul.products li.product .onsale {
	background: var(--km-ink);
	color: #fff;
	border-radius: 999px;
	min-height: 0;
	min-width: 0;
	line-height: 1;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 600;
}
body.woocommerce-shop .woocommerce-result-count,
body.tax-product_cat .woocommerce-result-count,
body.woocommerce-shop .woocommerce-ordering select,
body.tax-product_cat .woocommerce-ordering select {
	color: var(--km-text);
	font-size: 14px;
}
body.woocommerce-shop .woocommerce-ordering select,
body.tax-product_cat .woocommerce-ordering select {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	min-height: 44px;
}
body.woocommerce-shop .widget-area,
body.tax-product_cat .widget-area {
	color: var(--km-text);
}

/* ---------- Página de producto ---------- */
body.single-product .summary .price {
	color: var(--km-ink);
	font-weight: 600;
}
body.single-product .summary .price del {
	color: var(--km-muted);
	font-weight: 400;
}
body.single-product .summary .single_add_to_cart_button {
	border-radius: 8px;
	min-height: 52px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0;
}
body.single-product .summary .variations select {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	min-height: 44px;
	color: var(--km-ink);
}

/* ---------- Móvil ---------- */
@media (max-width: 991px) {
	body.woocommerce-checkout .wc-block-components-sidebar,
	body.woocommerce-cart .wc-block-components-sidebar {
		padding: 16px;
		margin-bottom: 24px;
	}
	body.woocommerce-checkout .page-header .entry-title,
	body.woocommerce-cart .page-header .entry-title {
		font-size: 22px;
	}
}

/* El tema pinta el borde de los campos muy oscuro; se suaviza aquí. */
body.woocommerce-checkout .wc-block-components-text-input input:not(:focus),
body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__container:not(:focus-within),
body.woocommerce-checkout .wc-block-components-textarea:not(:focus) {
	border-color: #d1d5db !important;
}

/* v1.0.1: panel de totales con margen parejo */
body.woocommerce-checkout .wc-block-components-sidebar,
body.woocommerce-cart .wc-block-components-sidebar {
	padding: 24px !important;
}
body.woocommerce-cart .wc-block-cart__totals-title {
	padding: 0 0 12px;
	margin: 0;
}
body.woocommerce-cart .wc-block-components-sidebar .wp-block-woocommerce-cart-order-summary-block {
	margin-bottom: 8px;
}
body.woocommerce-cart .wc-block-cart__submit {
	margin: 0;
}
body.woocommerce-cart .wc-block-cart__submit-container {
	padding: 0;
}

/* v1.0.1: etiqueta de oferta */
body.woocommerce-shop ul.products li.product .onsale,
body.tax-product_cat ul.products li.product .onsale,
body.tax-product_tag ul.products li.product .onsale {
	background: var(--km-ink) !important;
	border-radius: 999px !important;
	width: auto;
	height: auto;
}
