/*
Theme Name:   Kulor Pet
Theme URI:    https://kulorpet.com/
Description:  Child theme of Blocksy for Kulor Pet — "Oat & Sage", a cozy, minimal storefront. Leaves Blocksy's layout alone; repaints colours, type and components.
Author:       Guangzhou AoQuan Trade Co., Ltd
Template:     blocksy
Version:      1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  petstore
*/

/* ==========================================================================
   1. Design tokens — change colours / fonts HERE
   ========================================================================== */
:root:root {
	--kp-bg:          #FFFFFF;  /* page */
	--kp-oat:         #F7F4EE;  /* tinted bands, footer, announcement */
	--kp-oat-deep:    #EFE9DF;  /* image placeholders, hover */
	--kp-line:        #E4DDD1;  /* borders */
	--kp-ink:         #1F2A24;  /* headings */
	--kp-text:        #3E4A43;  /* body text */
	--kp-muted:       #6B756E;  /* secondary text (AA on white and oat) */
	--kp-sage:        #5E7B62;  /* buttons, accents */
	--kp-sage-dark:   #465F4A;  /* hover, text links */
	--kp-sage-soft:   #E6EDE4;  /* chips, notes */

	--kp-font: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

	--kp-radius:    12px;
	--kp-radius-sm: 8px;
	--kp-gutter:    clamp(16px, 4vw, 40px);
	--kp-max:       1290px;   /* = Blocksy --theme-normal-container-max-width on this site */
	--kp-space:     clamp(48px, 6.5vw, 88px);
	--kp-measure:   46rem;

	/* Blocksy palette → same values, so Blocksy's header, buttons, forms and Woo UI follow (rule L) */
	--theme-palette-color-1: var(--kp-sage);
	--theme-palette-color-2: var(--kp-sage-dark);
	--theme-palette-color-3: var(--kp-text);
	--theme-palette-color-4: var(--kp-ink);
	--theme-palette-color-5: var(--kp-line);
	--theme-palette-color-6: var(--kp-oat);
	--theme-palette-color-7: #FBF9F5;
	--theme-palette-color-8: var(--kp-bg);

	/* Blocksy global type + controls */
	--theme-font-stack-default: var(--kp-font);
	--theme-font-family: var(--kp-font);
	--theme-button-border-radius: 999px;
	--theme-button-min-height: 48px;
	--theme-button-padding: 10px 26px;
	--theme-button-font-weight: 700;
	--theme-button-font-size: 15px;
	--theme-form-field-border-radius: var(--kp-radius-sm);
	--theme-form-field-height: 48px;
	--theme-form-field-background-initial-color: #FFFFFF;
	--theme-form-field-background-focus-color: #FFFFFF;
	--theme-form-field-border-initial-color: var(--kp-line);
	--theme-form-field-border-focus-color: var(--kp-sage);
}

/* ==========================================================================
   2. Base (rule D box-sizing, rule J [hidden] guard)
   ========================================================================== */
body.kp *,
body.kp *::before,
body.kp *::after { box-sizing: border-box; }

body.kp [hidden] { display: none !important; }

body.kp {
	background-color: var(--kp-bg);
	color: var(--kp-text);
	--theme-font-family: var(--kp-font);
	font-family: var(--kp-font);
	-webkit-font-smoothing: antialiased;
}

/* Headings — rule C-2. Blocksy sets these through variables on h1–h6
   (IBM Plex Serif 700, line-height 1.5, sizes 40/35/30/25/20/16). Every one is re-declared. */
body.kp h1, body.kp h2, body.kp h3, body.kp h4, body.kp h5, body.kp h6 {
	--theme-font-family: var(--kp-font);
	--theme-font-weight: 800;
	--theme-text-transform: none;
	--theme-letter-spacing: -0.015em;
	--theme-text-decoration: none;
	--theme-line-height: 1.2;
	font-style: normal;
	/* colour stays on Blocksy's --theme-heading-color chain (palette-4 = ink), so white titles over images keep working */
}
body.kp h1 { --theme-font-size: clamp(32px, 3.4vw, 44px); --theme-line-height: 1.12; }
body.kp h2 { --theme-font-size: clamp(26px, 2.6vw, 34px); }
body.kp h3 { --theme-font-size: clamp(20px, 1.8vw, 24px); --theme-font-weight: 700; }
body.kp h4 { --theme-font-size: 19px; --theme-font-weight: 700; }
body.kp h5 { --theme-font-size: 17px; --theme-font-weight: 700; }
body.kp h6 { --theme-font-size: 15px; --theme-font-weight: 700; }

body.kp :focus-visible { outline: 2px solid var(--kp-sage); outline-offset: 2px; }

/* Small uppercase labels Blocksy ships (breadcrumbs, result count, tabs) → sentence case;
   card category meta keeps uppercase (a deliberate label style). */
body.kp .ct-breadcrumbs { --theme-text-transform: none; --theme-font-weight: 600; --theme-font-size: 13px; }
body.kp .woo-listing-top .woocommerce-result-count { --theme-text-transform: none; --theme-letter-spacing: 0; --theme-font-size: 14px; }
body.kp .woocommerce-tabs .tabs { --theme-text-transform: none; --theme-font-size: 15px; --theme-font-weight: 700; }
body.kp [data-products] .entry-meta { --theme-letter-spacing: 0.08em; --theme-font-size: 11px; --theme-font-weight: 700; }

/* Own buttons */
body.kp .kp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 50px; padding: 12px 28px;
	border: 1.5px solid var(--kp-sage); border-radius: 999px;
	font: 700 15px/1.2 var(--kp-font); letter-spacing: 0; text-transform: none; text-decoration: none;
	transition: background-color .2s, color .2s, border-color .2s;
}
body.kp .kp-btn--solid { background: var(--kp-sage); color: #fff; }
body.kp .kp-btn--solid:hover { background: var(--kp-sage-dark); border-color: var(--kp-sage-dark); color: #fff; }
body.kp .kp-btn--ghost { background: transparent; color: var(--kp-ink); border-color: var(--kp-ink); }
body.kp .kp-btn--ghost:hover { background: var(--kp-ink); color: #fff; }

body.kp .kp-link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--kp-sage-dark); text-decoration: none; }
body.kp .kp-link-arrow .kp-icon { width: 18px; height: 18px; transition: transform .2s; }
body.kp .kp-link-arrow:hover .kp-icon { transform: translateX(3px); }

body.kp .kp-eyebrow {
	margin: 0 0 10px; font: 700 12px/1.4 var(--kp-font);
	letter-spacing: .12em; text-transform: uppercase; color: var(--kp-sage-dark);
}
body.kp .kp-icon { flex: 0 0 auto; width: 24px; height: 24px; }

body.kp .kp-wrap {
	width: min(var(--kp-max), 100% - 2 * var(--kp-gutter));
	margin-left: auto; margin-right: auto;
}

/* ==========================================================================
   3. Blocksy repaint (leaf nodes / variables only — rule A-1)
   ========================================================================== */
body.kp .ct-header [data-row="middle"] { border-bottom: 1px solid var(--kp-line); }
body.kp .ct-header [data-id="menu"] > ul > li > a { --theme-font-weight: 700; --theme-font-size: 15px; }

/* Footer "reveal" effect targets .ct-footer (not our footer); drop the shadow it leaves on main. */
body.kp[data-footer] .site-main { --footer-box-shadow: none; }  /* beats [data-footer*="type-1"][data-footer*="reveal"] .site-main (0,3,0) */

/* Page title band (Blocksy hero-section, type-2 on archives) */
body.kp .hero-section[data-type="type-2"] { background-color: var(--kp-oat); }
body.kp .hero-section .page-title { --theme-font-size: clamp(30px, 3.4vw, 44px); }

/* Woo notices */
body.kp .woocommerce-message,
body.kp .woocommerce-info { border-radius: var(--kp-radius-sm); }

/* ==========================================================================
   4. Global components (always loaded — rule O)
   ========================================================================== */

/* 4.1 Announcement bar */
body.kp .kp-announce { width: 100%; background: var(--kp-sage-dark); color: #fff; font-size: 13px; line-height: 1.4; font-weight: 600; }
body.kp .kp-announce__inner {
	margin: 0 auto; padding: 9px var(--kp-gutter);
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; text-align: center;
}
body.kp .kp-announce a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
body.kp .kp-announce__dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .55; }
@media (max-width: 600px) { body.kp .kp-hide-sm { display: none; } }

/* 4.2 Promise list (home band, product page, anywhere) */
body.kp .kp-services { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px 24px; }
body.kp .kp-services__item { display: flex; align-items: flex-start; gap: 12px; margin: 0; min-width: 0; }
body.kp .kp-services__icon {
	flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
	display: grid; place-items: center; background: var(--kp-sage-soft); color: var(--kp-sage-dark);
}
body.kp .kp-services__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 2px; }
body.kp .kp-services__title { font-weight: 800; color: var(--kp-ink); line-height: 1.35; text-decoration: none; }
body.kp a.kp-services__title:hover { color: var(--kp-sage-dark); text-decoration: underline; text-underline-offset: 3px; }
body.kp .kp-services__text { font-size: 14px; color: var(--kp-muted); line-height: 1.45; }
body.kp .kp-services--grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.kp .kp-services--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 14px; gap: 12px 16px; }
body.kp .kp-services--compact .kp-services__icon { width: 34px; height: 34px; }
body.kp .kp-services--compact .kp-icon { width: 18px; height: 18px; }
body.kp .kp-services--compact .kp-services__body { padding-top: 7px; }
@media (max-width: 900px) { body.kp .kp-services--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
	body.kp .kp-services--grid,
	body.kp .kp-services--compact { grid-template-columns: minmax(0, 1fr); }
}

/* 4.3 Product cards (shop, categories, related, home, any [products]) */
body.kp [data-products] .product { --theme-text-transform: none; }
body.kp [data-products] .product figure .ct-media-container { border-radius: var(--kp-radius); background: var(--kp-oat-deep); }
body.kp [data-products] .product .woocommerce-loop-product__title,
body.kp ul.products li.product .woocommerce-loop-product__title {
	--theme-font-size: 15px; --theme-font-weight: 700; --theme-line-height: 1.4; --theme-letter-spacing: 0;
	font-size: 15px; font-weight: 700; line-height: 1.4; text-transform: none; letter-spacing: 0;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body.kp [data-products] .product .woocommerce-loop-product__title a { color: var(--kp-ink); }
body.kp [data-products] .product .price { color: var(--kp-ink); font-weight: 700; }
body.kp [data-products] .product .price del { color: var(--kp-muted); font-weight: 400; }
body.kp [data-products] .product .entry-meta a { color: var(--kp-muted); }
body.kp span.onsale,
body.kp [data-products] .onsale { background: var(--kp-sage); color: #fff; border-radius: 999px; font-weight: 700; text-transform: none; letter-spacing: 0; }
/* Hover image (added by inc/woocommerce.php) */
body.kp [data-products] .product .ct-media-container:has(> img.kp-card-alt),
body.kp ul.products li.kp-has-alt figure > a { position: relative; overflow: hidden; }
body.kp img.kp-card-alt {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
	opacity: 0; transition: opacity .35s ease; pointer-events: none; margin: 0;
}
@media (hover: hover) {
	body.kp ul.products li.product:hover img.kp-card-alt,
	body.kp [data-products] .product:hover img.kp-card-alt { opacity: 1; }
}

/* 4.4 Footer (replaces Blocksy #footer on every page type) */
body.kp .kp-footer { width: 100%; background: var(--kp-oat); color: var(--kp-text); font-size: 14px; line-height: 1.6; border-top: 1px solid var(--kp-line); }
body.kp .kp-footer__wrap {
	width: min(var(--kp-max), 100% - 2 * var(--kp-gutter));
	margin: 0 auto; padding: clamp(40px, 6vw, 72px) 0 28px;
}
body.kp .kp-footer__grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
body.kp .kp-footer__logo { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 800 24px/1.1 var(--kp-font); color: var(--kp-ink); letter-spacing: -0.02em; }
body.kp .kp-footer__logo .kp-icon { width: 28px; height: 28px; color: var(--kp-sage); }
body.kp .kp-footer__tagline { margin: 0 0 18px; max-width: 36ch; }
body.kp .kp-footer__contact { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
body.kp .kp-footer__contact .kp-icon { width: 18px; height: 18px; color: var(--kp-sage-dark); }
body.kp .kp-footer__heading { margin: 0 0 14px; font: 800 13px/1.4 var(--kp-font); color: var(--kp-ink); letter-spacing: 0; text-transform: none; }
body.kp .kp-footer ul { list-style: none; margin: 0; padding: 0; }
body.kp .kp-footer li { margin: 0 0 8px; }
body.kp .kp-footer a { color: var(--kp-text); text-decoration: none; }
body.kp .kp-footer a:hover { color: var(--kp-sage-dark); text-decoration: underline; text-underline-offset: 3px; }
body.kp .kp-footer__legal {
	margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--kp-line);
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
	font-size: 12px; color: var(--kp-muted);
}
body.kp .kp-footer__legal p,
body.kp .kp-footer__legal address { margin: 0; font-style: normal; }
@media (max-width: 900px) {
	body.kp .kp-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	body.kp .kp-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) { body.kp .kp-footer__grid { grid-template-columns: minmax(0, 1fr); } }

/* 4.5 Product page promise strip */
body.kp .kp-product-services {
	clear: both; margin: 22px 0; padding: 16px 18px;
	background: var(--kp-oat); border-radius: var(--kp-radius);
}

/* 4.6 Fluent Forms (rule J: no display on nodes Fluent hides; only colours/spacing) */
body.kp .fluentform .ff-el-input--label label { font-weight: 700; color: var(--kp-ink); font-size: 14px; }
body.kp .fluentform .ff-el-is-required.asterisk-right label::after { color: #B0472F; }
body.kp .fluentform .ff-el-form-control {
	min-height: 48px; padding: 10px 14px;
	border: 1px solid var(--kp-line); border-radius: var(--kp-radius-sm);
	background: #fff; color: var(--kp-ink); font-family: var(--kp-font); font-size: 15px;
}
body.kp .fluentform textarea.ff-el-form-control { min-height: 140px; }
body.kp .fluentform .ff-el-form-control:focus { border-color: var(--kp-sage); box-shadow: 0 0 0 3px var(--kp-sage-soft); outline: 0; }
body.kp .fluentform .ff-btn-submit,
body.kp .fluentform .ff_btn_style {
	min-height: 50px; padding: 12px 30px; border: 0; border-radius: 999px;
	background-color: var(--kp-sage); color: #fff;
	font: 700 15px/1.2 var(--kp-font); text-transform: none; letter-spacing: 0;
}
body.kp .fluentform .ff-btn-submit:hover { background-color: var(--kp-sage-dark); }
body.kp .fluentform .ff-el-is-error .ff-el-form-control { border-color: #B0472F; }
body.kp .fluentform .error.text-danger,
body.kp .fluentform .ff-el-is-error .text-danger { color: #9C3B25; font-size: 13px; }
body.kp .ff-errors-in-stack { color: #9C3B25; }
body.kp .ff-message-success {
	border: 0; border-radius: var(--kp-radius); background: var(--kp-sage-soft); color: var(--kp-ink);
	box-shadow: none; padding: 16px 20px;
}
