/* Inner pages of theme Khung (shop, product, cart, checkout, account, posts): quiet, readable, in the template's
   accent colour (--k-accent, set by khung-runtime.js from the frame) and font (inherited from the frame's body). */
.kh-main { display: block; background: #fff; color: #222; }
.kh-wrap { max-width: 1200px; margin: 0 auto; padding: 36px 20px 64px; box-sizing: border-box; }
.kh-wrap *, .kh-wrap *::before, .kh-wrap *::after { box-sizing: border-box; }
.kh-title, .kh-wrap .page-title, .kh-wrap .product_title { margin: 0 0 22px; font-size: clamp(24px, 3vw, 32px); line-height: 1.25; font-weight: 700; color: #111; }
.kh-wrap a { color: var(--k-accent, #c0392b); }
.kh-wrap img { max-width: 100%; height: auto; }
.kh-content { font-size: 16px; line-height: 1.7; }
.kh-content p { margin: 0 0 1em; }
.kh-empty { color: #666; }

/* posts */
.kh-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.kh-post { border: 1px solid #eee; border-radius: 10px; overflow: hidden; background: #fff; }
.kh-post__img img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.kh-post__body { padding: 16px 18px 20px; }
.kh-post__body h2 { margin: 6px 0 8px; font-size: 18px; line-height: 1.35; }
.kh-post__body h2 a { color: #111; text-decoration: none; }
.kh-post__body p { margin: 0; color: #555; font-size: 14px; line-height: 1.6; }
.kh-post__date { color: #888; font-size: 13px; }
.kh-article { max-width: 780px; margin: 0 auto; }
.kh-article__img { margin: 10px 0 24px; }
.kh-wrap .nav-links { display: flex; gap: 8px; margin-top: 28px; }
.kh-wrap .page-numbers { display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid #ddd; border-radius: 6px; color: #333; text-decoration: none; }
.kh-wrap .page-numbers.current { background: var(--k-accent, #c0392b); border-color: var(--k-accent, #c0392b); color: #fff; }

/* WooCommerce: lists */
.kh-wrap .woocommerce-breadcrumb { margin-bottom: 14px; color: #777; font-size: 14px; }
.kh-wrap .woocommerce-result-count { float: left; margin: 0 0 20px; color: #666; font-size: 14px; }
.kh-wrap .woocommerce-ordering { float: right; margin: 0 0 20px; }
.kh-wrap ul.products { clear: both; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 24px; margin: 0; padding: 0; list-style: none; }
.kh-wrap ul.products::before, .kh-wrap ul.products::after { display: none; }
.kh-wrap ul.products li.product { position: relative; width: auto !important; margin: 0 !important; float: none !important; text-align: left; }
.kh-wrap ul.products li.product img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; margin: 0 0 12px; border-radius: 6px; background: #f4f4f4; }
.kh-wrap ul.products li.product .woocommerce-loop-product__title { margin: 0 0 6px; padding: 0; font-size: 15px; font-weight: 500; line-height: 1.4; color: #222; }
.kh-wrap ul.products li.product a { text-decoration: none; }
.kh-wrap .price { color: var(--k-accent, #c0392b); font-weight: 700; }
.kh-wrap .price del { color: #999; font-weight: 400; margin-right: 6px; }
.kh-wrap .price ins { text-decoration: none; }
.kh-wrap span.onsale { position: absolute; top: 10px; left: 10px; z-index: 1; min-height: 0; min-width: 0; padding: 3px 8px; border-radius: 4px; background: var(--k-accent, #c0392b); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.4; }

/* buttons, fields */
.kh-wrap .button, .kh-wrap button.button, .kh-wrap input.button, .kh-wrap #place_order, .kh-wrap .checkout-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border: 0; border-radius: 6px;
  background: var(--k-accent, #c0392b); color: #fff !important; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.kh-wrap .button:hover, .kh-wrap #place_order:hover { filter: brightness(.92); }
.kh-wrap ul.products li.product .price { display: block; margin: 0 0 4px; }
.kh-wrap ul.products li.product .button { display: flex; width: fit-content; min-height: 38px; margin-top: 10px; padding: 0 16px; font-size: 14px; }
.kh-wrap ul.products li.product .added_to_cart { display: block; margin-top: 6px; font-size: 13px; }
.kh-wrap input[type=text], .kh-wrap input[type=email], .kh-wrap input[type=tel], .kh-wrap input[type=number], .kh-wrap input[type=password],
.kh-wrap input[type=search], .kh-wrap textarea, .kh-wrap select {
  box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d5d5d5; border-radius: 6px; background: #fff; color: #222; font: inherit; }
.kh-wrap .quantity input.qty { width: 76px; text-align: center; }
.kh-wrap label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.kh-wrap .form-row { margin: 0 0 14px; }
.kh-wrap :focus-visible { outline: 3px solid color-mix(in srgb, var(--k-accent, #c0392b) 45%, transparent); outline-offset: 2px; }

/* single product */
.kh-wrap div.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.kh-wrap div.product .woocommerce-product-gallery { width: auto !important; float: none !important; }
.kh-wrap div.product .summary { width: auto !important; float: none !important; }
.kh-wrap div.product .summary .price { font-size: 24px; margin: 0 0 16px; }
.kh-wrap div.product form.cart { display: flex; gap: 12px; align-items: center; margin: 20px 0; }
.kh-wrap div.product .woocommerce-tabs, .kh-wrap div.product .related, .kh-wrap div.product .upsells { grid-column: 1 / -1; }
.kh-wrap .woocommerce-tabs ul.tabs { display: flex; gap: 6px; padding: 0; margin: 0 0 16px; list-style: none; border-bottom: 1px solid #eee; }
.kh-wrap .woocommerce-tabs ul.tabs li a { display: block; padding: 10px 14px; color: #444; text-decoration: none; }
.kh-wrap .woocommerce-tabs ul.tabs li.active a { color: var(--k-accent, #c0392b); box-shadow: inset 0 -2px 0 currentColor; }

/* cart, checkout, notices */
.kh-wrap table.shop_table { width: 100%; border-collapse: collapse; margin: 0 0 24px; }
.kh-wrap table.shop_table th, .kh-wrap table.shop_table td { padding: 12px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: middle; }
.kh-wrap table.shop_table img { width: 64px; border-radius: 4px; }
.kh-wrap .cart-collaterals .cart_totals { max-width: 440px; margin-left: auto; }
.kh-wrap .woocommerce-message, .kh-wrap .woocommerce-info, .kh-wrap .woocommerce-error {
  list-style: none; margin: 0 0 20px; padding: 14px 16px; border-radius: 8px; background: #f6f7f9; border-left: 4px solid var(--k-accent, #c0392b); }
.kh-wrap .woocommerce-message .button { float: right; min-height: 34px; }
.kh-wrap .col2-set { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.kh-wrap .col2-set::before, .kh-wrap .col2-set::after, .kh-wrap .woocommerce-checkout::before, .kh-wrap .woocommerce-checkout::after { display: none; }

/* Footer the theme adds when the template's own footer is only a thin strip */
.kh-foot { background: #161616; color: #cfcfcf; font-size: 14px; line-height: 1.7; }
.kh-foot__in { max-width: 1200px; margin: 0 auto; padding: 44px 20px 28px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; box-sizing: border-box; }
.kh-foot h2 { margin: 0 0 12px; color: #fff; font-size: 17px; font-weight: 700; }
.kh-foot p { margin: 0 0 6px; }
.kh-foot ul { margin: 0; padding: 0; list-style: none; }
.kh-foot a { color: #fff; text-decoration: none; }
.kh-foot a:hover { color: var(--k-accent, #e74c3c); }
.kh-foot__copy { max-width: 1200px; margin: 0 auto; padding: 14px 20px 22px; border-top: 1px solid #2a2a2a; color: #8d8d8d; font-size: 13px; box-sizing: border-box; }
@media (max-width: 760px) { .kh-foot__in { grid-template-columns: 1fr; gap: 22px; } }
.kh-wrap .col2-set .col-1, .kh-wrap .col2-set .col-2 { width: auto; float: none; }

@media (max-width: 900px) {
  .kh-wrap ul.products, .kh-posts { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .kh-wrap div.product, .kh-wrap .col2-set { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .kh-wrap { padding: 24px 16px 48px; }
  .kh-posts { grid-template-columns: 1fr; }
  .kh-wrap table.shop_table_responsive thead { display: none; }
  .kh-wrap table.shop_table_responsive tr td { display: block; text-align: right; }
  .kh-wrap table.shop_table_responsive tr td::before { content: attr(data-title) ": "; float: left; font-weight: 600; }
}
