/* Task 011: structure only. XTRA/Elementor keep colors, type, content and media.
 * Native product background/border controls style the enclosing card via PHP. */
.kp-store { --kp-ink: #303a23; --kp-muted: #626756; --kp-edge: #e0e3d5; }
:where(.kp-store #page_content) { color: var(--kp-ink); }
:where(.kp-store #page_content) h1 { font-size: clamp(26px,3vw,38px); line-height: 1.7; margin: 0 0 24px; }
.kp-store #page_content > .row { padding-block: 12px; }
.kp-store #page_content :is(.content,.cz_is_blank,.sidebar) { min-width: 0; }

/* Slick owns slide widths and spacing once XTRA initializes its carousels. */
body.kp-store ul.products:not(.slick-slider) {
	display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px;
	margin: 0; padding: 0; align-items: stretch;
}
.kp-store ul.products::before,.kp-store ul.products::after { display: none; }
body.kp-store ul.products li.product {
	box-sizing: border-box; display: flex; flex-direction: column; float: none; clear: none;
	/* XTRA forces full width and bottom margins on mobile. Grid owns spacing. */
	width: auto !important; margin: 0 !important; min-width: 0; padding: 12px;
	background: var(--kp-card-background); border: var(--kp-card-border);
	border-radius: var(--kp-card-radius); box-shadow: var(--kp-card-shadow);
	transition: transform 180ms ease,box-shadow 180ms ease;
}
/* Fill the width allocated by Slick instead of shrinking inline-block cards. */
body.kp-store ul.products .slick-slide li.product { width: 100% !important; }
body.kp-store ul.products li.product .woocommerce-loop-product__link,
body.kp-store ul.products li.product:hover .woocommerce-loop-product__link {
	display: flex; flex: 1; flex-direction: column; min-width: 0;
	background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
.kp-store ul.products .xtra-product-thumbnail { position: relative; aspect-ratio: 1; overflow: hidden; }
.kp-store ul.products :is(.cz_image_in,.cz_main_image) { width: 100%; height: 100%; }
.kp-store ul.products .xtra-product-thumbnail:has(.kp-product-empty) { aspect-ratio: 4/3; max-height: 220px; }
.kp-store ul.products li.product a img { width: 100%; height: 100%; object-fit: contain; aspect-ratio: 1; }
.kp-store .kp-product-empty { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; height: 100%; padding: 16px; color: #70765c; font-size: 12px; line-height: 1.9; text-align: center; }
.kp-store ul.products li.product .woocommerce-loop-product__title { min-height: 66px; }
.kp-store ul.products li.product .codevz-product-category-after-title { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--kp-muted); line-height: 1.8; opacity: 1; }
body.kp-store ul.products li.product .price { position: static; display: block; margin: auto 4px 16px; }
.kp-store ul.products .woocommerce-Price-currencySymbol { font-size: 12px; font-weight: 400; margin-inline-end: 5px; }
body.kp-store ul.products li.product .button { box-sizing: border-box; position: relative; float: none; width: 100%; min-height: 44px; text-align: center; white-space: normal; }
.kp-store ul.products a.added_to_cart { display: block; text-align: center; padding: 8px 0 0; }
/* XTRA centers this toolbar with translateY(-50%). Reset it at the inset corner,
 * including hover, so it cannot overlap the rounded image/card edge. */
body.kp-store ul.products li.product .xtra-product-icons,
body.kp-store ul.products li.product:hover .xtra-product-icons {
	top: 10px; left: 10px; right: auto; bottom: auto; transform: none;
	flex-direction: column; gap: 4px;
	background: transparent; box-shadow: none; border-radius: 0;
}
.kp-store ul.products .xtra-product-icons i { border-radius: 8px; background: var(--kp-card-background); }
@media (min-width:481px) {
	body.kp-store ul.products li.product .xtra-product-icons { display: flex; }
}

.kp-store .woocommerce :is(form.login,form.lost_reset_password,.woocommerce-checkout-review-order,.cart_totals),
.kp-store .woocommerce .woocommerce-MyAccount-content,
.kp-store.single-product .summary {
	box-sizing: border-box; padding: 28px; background: var(--kp-card-background);
	border: var(--kp-card-border); border-radius: var(--kp-card-radius); box-shadow: var(--kp-card-shadow);
}
.kp-store .woocommerce :is(input.input-text,textarea,select) { box-sizing: border-box; min-height: 46px; font-family: inherit; }
.kp-store .woocommerce :is(button.button,a.button,input.button) { min-height: 44px; box-sizing: border-box; }
.kp-store .woocommerce table.shop_table { background: var(--kp-card-background); border-radius: var(--kp-card-radius); border-color: var(--kp-edge); }
.kp-store .woocommerce :is(.woocommerce-info,.woocommerce-message,.woocommerce-error) { border-radius: 12px; line-height: 1.9; }
.kp-store .woocommerce .woocommerce-info { background: #eef0e7; color: var(--kp-ink); border-top-color: #45552c; }
.kp-store :is(.woocommerce-info,.woocommerce-message)::before { color: #45552c; }
.kp-store .woocommerce .woocommerce-breadcrumb { display: block; margin-bottom: 24px; font-size: 13px; color: var(--kp-muted); line-height: 1.9; }
.kp-store.single-product .summary { margin-bottom: 32px; }
.kp-store .woocommerce div.product form.cart { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.kp-store.single-product .quantity { width: auto; margin: 0 !important; }
.kp-store .woocommerce .quantity input.qty { width: 80px; min-height: 46px; }
/* Pagination geometry only; XTRA retains its native color/border controls. */
body.kp-store nav.woocommerce-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; border: 0; }
body.kp-store nav.woocommerce-pagination ul li { float: none; margin: 0; }
body.kp-store nav.woocommerce-pagination ul li :is(a,span) { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; line-height: 1; }
.kp-store .woocommerce :is(.woocommerce-ordering,.woocommerce-result-count) { margin-bottom: 24px; }
.kp-store.single-post .cz_is_blank > .cz_wpe_content { max-width: 850px; margin-inline: auto; }
.kp-store .wpcf7 textarea { min-height: 150px; }
.kp-store .term-description { display: flow-root; padding: 20px 24px; margin-bottom: 28px; background: var(--kp-card-background); border: var(--kp-card-border); border-radius: var(--kp-card-radius); }
.kp-store .term-description p { margin-bottom: 0; }
.kp-store .term-description img { max-width: 140px; border-radius: 10px; }
.kp-store.woocommerce-account:not(.logged-in) #page_content .woocommerce { max-width: 640px; margin-inline: auto; }
.kp-store.woocommerce-account:not(.logged-in) .codevz-woo-login-form { padding: 0; }
.kp-store.woocommerce-account:not(.logged-in) #page_content h1 { max-width: 640px; margin-inline: auto; }
.kp-store.woocommerce-account:not(.logged-in) .woocommerce form.login { margin: 20px 0 0; }
.kp-store.woocommerce-account:not(.logged-in) .woocommerce > h2 { margin-inline: 0; }
.kp-store .codevz-woo-add-to-cart.codevz-woo-add-to-cart-flex { gap: 10px; }
.kp-store .codevz-woo-add-to-cart.codevz-woo-add-to-cart-flex .button { margin-inline: 0; }

@media (hover:hover) and (prefers-reduced-motion:no-preference) {
	.kp-store ul.products li.product:hover { transform: translateY(-4px); box-shadow: var(--kp-card-hover-shadow); }
}
@media (max-width:1024px) {
	body.kp-store ul.products:not(.slick-slider) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
}
@media (max-width:767px) {
	/* Native archive controls: result count above one aligned pair of selects.
	 * XTRA forces a 2em form margin with !important; reset that margin only.
	 * Keep its content, colors, borders, fonts and form submissions native. */
	body.kp-store.woocommerce.archive .woocommerce-result-count {
		float: none; clear: both; width: 100%; margin: 0 0 12px !important;
	}
	body.kp-store.woocommerce.archive .woocommerce-ordering {
		float: right; clear: both; width: calc(60% - 6px); margin: 0 0 20px !important;
	}
	body.kp-store.woocommerce.archive .codevz-products-per-page {
		float: left; width: calc(40% - 6px); margin: 0 0 20px;
	}
	body.kp-store.woocommerce.archive :is(.woocommerce-ordering,.codevz-products-per-page) select {
		display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%;
		height: 48px; min-height: 48px; margin: 0; padding-block: 8px;
		padding-inline: 12px 6px; line-height: 1.6;
		/* Use the browser's centered RTL arrow instead of XTRA's corner triangle. */
		-webkit-appearance: auto; appearance: auto; background-image: none;
	}
	body.kp-store.woocommerce.archive ul.products { clear: both; }
	.kp-store #page_content > .row { padding-block: 8px; }
	body.kp-store ul.products:not(.slick-slider) { gap: 12px; }
	body.kp-store ul.products li.product { padding: 9px; }
	.kp-store ul.products li.product .woocommerce-loop-product__title { min-height: 76px; }
	.kp-store .kp-product-empty { gap: 9px; padding: 10px; font-size: 11px; }
	.kp-store .kp-product-empty svg { width: 34px; height: 40px; }
	body.kp-store ul.products li.product .xtra-product-icons,
	body.kp-store ul.products li.product:hover .xtra-product-icons { top: 8px; left: 8px; flex-direction: row; gap: 3px; }
	.kp-store ul.products .xtra-product-icons i { font-size: 14px; padding: 6px; }
	.kp-store .woocommerce :is(form.login,form.lost_reset_password,.woocommerce-checkout-review-order,.cart_totals),
	.kp-store .woocommerce .woocommerce-MyAccount-content,.kp-store.single-product .summary { padding: 18px; }
	.kp-store .woocommerce form .form-row { float: none; width: 100%; box-sizing: border-box; }
	.kp-store .woocommerce table.shop_table td { overflow-wrap: anywhere; }
}
@media (max-width:380px) {
	body.kp-store.woocommerce.archive :is(.woocommerce-ordering,.codevz-products-per-page) {
		float: none; width: 100%;
	}
	body.kp-store.woocommerce.archive .woocommerce-ordering { margin-bottom: 12px !important; }
	body.kp-store ul.products:not(.slick-slider) { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion:reduce) {
	.kp-store :is(a,button,.button,li.product) { transition: none; }
}

/* Inner-page refinement: geometry only; XTRA/WooCommerce own editable content,
 * color, typography and card styling. Image aspect ratios and zoom stay native. */
body.kp-store.single-product .summary .product_title { overflow-wrap: anywhere; }
body.kp-store.single-product .summary > .price .woocommerce-Price-currencySymbol { margin-inline-end: .35em; }
body.kp-store.single-product .kp-purchase-attributes table.shop_attributes { margin: 0 0 12px; border: 0; font-size: .875em; }
body.kp-store.single-product .kp-purchase-attributes table.shop_attributes :is(th,td) { padding: 4px 8px; line-height: 1.8; font-style: normal; overflow-wrap: anywhere; }
body.kp-store.single-product .kp-purchase-attributes table.shop_attributes th { width: 5em; }
body.kp-store.single-product .kp-purchase-attributes table.shop_attributes td p { margin: 0; padding: 0; }
body.kp-store.single-product .summary .codevz-woo-add-to-cart-flex { flex-wrap: wrap; }
body.kp-store.single-product .summary .codevz-woo-add-to-cart-flex .single_add_to_cart_button { white-space: normal; }
body.kp-store.single-product .summary .quantity input.qty { min-height: 48px; }
body.kp-store.single-product .woocommerce-product-gallery__trigger { min-width: 44px; min-height: 44px; box-sizing: border-box; }
@media (max-width: 768px) {
	/* The native contact bar stays at the end of product pages, in normal flow,
	 * so purchase controls, validation and the lightbox cannot sit behind it. */
	body.kp-store.single-product .xtra-fixed-mobile-nav { position: relative; inset: auto; z-index: auto; }
	body.kp-store.single-product #page_content > .row { padding-block: 0; }
	body.kp-store.single-product #page_content { margin-top: 24px; padding-top: 0; }
	body.kp-store.single-product div.product div.woocommerce-product-gallery { margin-bottom: 16px; }
	body.kp-store.single-product .woocommerce-product-details__short-description { margin-block: 8px 12px; }
	body.kp-store.single-product .woocommerce-product-details__short-description p { margin-block: 0; }
	body.kp-store.single-product .summary form.cart { margin-block: 12px 16px; }
	body.kp-store.single-product .summary .codevz-woo-add-to-cart-flex { gap: 8px; }
	/* XTRA forces full-width quantity and 20px button margins with important. */
	body.kp-store.single-product .summary .codevz-woo-add-to-cart-flex .quantity { width: auto !important; flex: 0 0 auto; }
	body.kp-store.single-product .summary .quantity input.qty { width: 64px; }
	body.kp-store.single-product .summary .codevz-woo-add-to-cart-flex .single_add_to_cart_button { flex: 1; min-width: 150px; margin-block: 0 !important; }
	body.kp-store.tax-product_cat .term-description { padding: 12px 16px; margin-bottom: 16px; }
	body.kp-store.tax-product_cat #page_content .kp-archive-title { margin-bottom: 14px; }
	body.kp-store.tax-product_cat .term-description p { line-height: 1.9; }
}
@media (min-width: 641px) and (max-width: 768px) {
	/* Keep tablet imagery and buying information side by side, without cropping. */
	body.kp-store.single-product .xtra-single-product { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
	body.kp-store.single-product .xtra-single-product::before,
	body.kp-store.single-product .xtra-single-product::after { display: none; }
	body.kp-store.single-product .xtra-single-product > :is(.images,.summary) { min-width: 0; }
}
