/**
 * Kaarigar Order Flow — My Account styles.
 *
 * Loaded AFTER kof-frontend.css and dependent on it, so every colour and type
 * decision below inherits from there rather than restating the palette. The
 * token names are --khb-* because kof-frontend.css shares its palette with
 * the Homepage plugin; --kof-* names silently fall through to the hardcoded
 * fallback and stop tracking the brand. If a
 * value here looks like a magic number, it is a bug — take it from a token.
 *
 * PHASE 3A: sign-in panel only. The nav card, orders list, dashboard and order
 * view land in Phase 3B and must match kof-phase3-preview.html.
 */

/* ---------------------------------------------------------------------------
 * Magic-link sign-in panel
 *
 * Sits above WooCommerce's own login form on the My Account page. Astra ships
 * its own myaccount templates, so this is scoped tightly to .kof-signin and
 * inherits rather than overrides — anything broader ends up fighting Astra.
 * ------------------------------------------------------------------------ */

.kof-signin {
	max-width: 460px;
	margin: 0 0 28px;
	padding: 24px;
	border: 1px solid var(--khb-line, #EFDCD3);
	border-radius: 10px;
	background: var(--khb-paper, #FFFDFB);
	font-family: 'Jost', sans-serif;
}

.kof-signin-title {
	margin: 0 0 6px;
	font-family: 'Marcellus', serif;
	font-size: 20px;
	font-weight: 400;
	color: var(--khb-rose-deep, #8C4A55);
}

.kof-signin-lede {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.55;
	opacity: .85;
}

.kof-signin-field {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 500;
}

.kof-signin-form input[type="email"] {
	width: 100%;
	padding: 11px 13px;
	margin: 0 0 12px;
	border: 1px solid var(--khb-line, #EFDCD3);
	border-radius: 6px;
	font-family: inherit;
	font-size: 15px;
	background: #fff;
}

.kof-signin-form input[type="email"]:focus {
	outline: none;
	border-color: var(--khb-rose, #B76E79);
	box-shadow: 0 0 0 3px var(--khb-blush, #FBEDE8);
}

.kof-signin-form .kof-btn-primary {
	width: 100%;
}

/* Feedback after a request. Both variants are intentionally low-key: the
 * message is identical whether or not the email is registered, so a loud
 * success state would be misleading half the time. */
.kof-signin-note {
	margin: 0 0 14px;
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
}

.kof-signin-note-ok {
	background: var(--khb-blush, #FBEDE8);
	color: var(--khb-rose-deep, #8C4A55);
}

.kof-signin-note-warn {
	background: #FDF4E7;
	color: #8A5A12;
}

/* Revealed by kof-account.js only. Hidden by default via the [hidden]
 * attribute so that with JavaScript off the password form is simply visible
 * and there is no toggle offering to reveal something already on screen. */
.kof-signin-toggle {
	margin: 14px 0 0;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 14px;
	color: var(--khb-rose, #B76E79);
	text-decoration: underline;
	cursor: pointer;
}

.kof-signin-toggle:hover {
	color: var(--khb-rose-deep, #8C4A55);
}

.kof-signin-alt {
	margin: 0;
}

/* ===========================================================================
   MY ACCOUNT  (4.11.0)

   Loaded after kof-frontend.css and dependent on it, so the palette, the
   status pill, the action strip and every button come from there. Nothing
   below restates a colour that already has a token.

   Astra ships its own myaccount templates — but KOF_Account replaces
   WooCommerce's content dispatcher outright, so neither Astra's nor
   WooCommerce's order templates ever run. That is why none of this needs
   !important to win.
   ======================================================================== */

/* The shell template renders KHB chrome instead of Astra's, which means
   Astra's container is gone too — so the shell supplies its own. Matched to
   the order form's gutters so moving between the two doesn't shift the page. */
.kof-shell{
	max-width:1120px;margin:0 auto;padding:44px 22px 64px;
	font-family:'Jost',sans-serif;color:var(--khb-ink);
}
.kof-shell h1,.kof-shell h2,.kof-shell h3,.kof-shell h4,.kof-shell h5{
	font-family:'Marcellus',serif;font-weight:400;
}
@media (max-width:760px){ .kof-shell{padding:24px 16px 48px} }

/* The manage-order page brings its own .kof-form-wrap width, so the shell
   must not constrain it a second time. */
.kof-shell .kof-form-wrap{max-width:none;padding:0}

.woocommerce-account .woocommerce{max-width:none;margin:0}

/* ---- shell ---- */
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content{float:none;width:auto}

.woocommerce-account .woocommerce-MyAccount-navigation{
	background:#fff;border:1px solid var(--khb-line);border-radius:12px;padding:7px;margin-bottom:0;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul{list-style:none;margin:0;padding:0}
.woocommerce-account .woocommerce-MyAccount-navigation li{margin:0}
.woocommerce-account .woocommerce-MyAccount-navigation a{
	display:block;padding:10px 12px;border-radius:8px;font-size:14px;
	color:var(--khb-ink);text-decoration:none;
}
.woocommerce-account .woocommerce-MyAccount-navigation a:hover{background:#FFFAF8}
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a{
	background:var(--khb-blush);color:var(--khb-rose-deep);font-weight:600;
}
.woocommerce-account .woocommerce-MyAccount-navigation li--customer-logout a{
	color:var(--khb-ink-soft);margin-top:4px;border-top:1px solid var(--khb-line);border-radius:0;
}

@media (min-width:761px){
	.woocommerce-account .woocommerce-MyAccount-navigation{
		float:left;width:222px;
	}
	.woocommerce-account .woocommerce-MyAccount-content{
		float:right;width:calc(100% - 246px);min-width:0;
	}
	.woocommerce-account .woocommerce::after{content:"";display:table;clear:both}
}

/* Mobile: a horizontally scrollable row, because Astra stacks the native
   <ul> into a tall list that pushes the content below the fold — the
   customer opens their account and sees only navigation. */
@media (max-width:760px){
	.woocommerce-account .woocommerce-MyAccount-navigation{
		padding:2px 0 10px;border:0;background:none;border-radius:0;
		position:sticky;top:var(--kof-header-h,0px);z-index:5;
	}
	.woocommerce-account .woocommerce-MyAccount-navigation ul{
		display:flex;gap:7px;overflow-x:auto;padding:6px 0;
		scrollbar-width:none;-webkit-overflow-scrolling:touch;
	}
	.woocommerce-account .woocommerce-MyAccount-navigation ul::-webkit-scrollbar{display:none}
	.woocommerce-account .woocommerce-MyAccount-navigation li{flex:0 0 auto}
	.woocommerce-account .woocommerce-MyAccount-navigation a{
		padding:7px 14px;border-radius:99px;border:1px solid var(--khb-line);
		background:#fff;font-size:13px;color:var(--khb-ink-soft);white-space:nowrap;
	}
	.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a{
		background:var(--khb-rose-deep);color:#fff;border-color:var(--khb-rose-deep);
	}
	.woocommerce-account .woocommerce-MyAccount-navigation li--customer-logout a{
		margin-top:0;border-top:1px solid var(--khb-line);
	}
}

/* ---- headings ---- */
.kof-acc-eyebrow{font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--khb-ink-soft);margin:0 0 5px}
.kof-acc-title{font-family:'Marcellus',serif;font-weight:400;font-size:25px;margin:0}
.kof-acc-sub{font-size:13.5px;color:var(--khb-ink-soft);margin:6px 0 0}
.kof-acc-sec{font-family:'Marcellus',serif;font-weight:400;font-size:17px;margin:26px 0 11px}
.kof-acc-none{font-size:13.5px;color:var(--khb-ink-soft)}
.kof-acc-more{text-align:center;margin-top:4px}
.kof-acc-more a,.kof-acc-back a{color:var(--khb-rose-deep);font-size:13.5px;text-decoration:none;border-bottom:1px solid var(--khb-line)}
.kof-acc-back{margin:0 0 14px}
.kof-acc-card{background:#fff;border:1px solid var(--khb-line);border-radius:12px;padding:18px;margin-bottom:12px}
.kof-acc-note{font-size:12.5px;color:var(--khb-ink-soft);line-height:1.6;margin:8px 0 0}

/* ---- order cards ---- */
.kof-ocard{display:flex;gap:14px;background:#fff;border:1px solid var(--khb-line);border-radius:12px;padding:14px;margin-bottom:11px}
.kof-ocard-ph{
	width:64px;height:78px;flex:0 0 auto;border-radius:8px;overflow:hidden;
	background:var(--khb-blush);border:1px solid var(--khb-line);
	display:flex;align-items:center;justify-content:center;
}
.kof-ocard-ph img{width:100%;height:100%;object-fit:cover;display:block}
.kof-mono{font-family:'Marcellus',serif;font-size:15px;color:var(--khb-rose);letter-spacing:.06em}
.kof-ocard-bd{flex:1;min-width:0}
.kof-ocard-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;flex-wrap:wrap}
.kof-ocard-num{font-family:'Marcellus',serif;font-size:17px}
.kof-ocard-dt{font-size:11.5px;color:var(--khb-ink-soft)}
.kof-ocard-desc{font-size:12.5px;color:var(--khb-ink-soft);margin:7px 0 0}
.kof-ocard-prog{margin:10px 0 0}
.kof-track{height:5px;border-radius:99px;background:var(--khb-blush);overflow:hidden}
.kof-track span{display:block;height:100%;background:linear-gradient(90deg,var(--khb-rose),var(--khb-rose-deep))}
.kof-ocard-stg{display:flex;justify-content:space-between;gap:12px;margin-top:6px;font-size:11.5px;color:var(--khb-ink-soft);flex-wrap:wrap}
.kof-ocard-stg b{font-weight:500;color:var(--khb-ink)}
.kof-ocard-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:11px;flex-wrap:wrap}
.kof-bal{font-size:13px;font-weight:600}
.kof-bal-due{color:#8a5a12}
.kof-bal-ok{color:#1D6B42}
.kof-bal-refund{color:var(--khb-ink-soft)}
.kof-btn-s{padding:7px 13px;font-size:12.5px}

@media (max-width:520px){
	.kof-ocard{display:block}
	.kof-ocard-ph{width:100%;height:120px;margin-bottom:11px}
	.kof-ocard-foot .kof-btn-primary,.kof-ocard-foot .kof-btn-ghost{width:100%;justify-content:center;text-align:center}
}

/* ---- filter chips ---- */
.kof-chips{display:flex;gap:7px;margin:16px 0 14px;flex-wrap:wrap}
.kof-chip{
	padding:6px 14px;border-radius:99px;border:1px solid var(--khb-line);background:#fff;
	font-size:12.5px;color:var(--khb-ink-soft);text-decoration:none;
}
.kof-chip:hover{border-color:var(--khb-rose)}
.kof-chip-on{background:var(--khb-ink);color:#fff;border-color:var(--khb-ink)}
.kof-chip-n{opacity:.6;margin-left:4px}

.kof-pager{display:flex;gap:6px;justify-content:center;margin-top:16px}
.kof-pager-i{
	min-width:34px;text-align:center;padding:6px 10px;border-radius:7px;
	border:1px solid var(--khb-line);background:#fff;color:var(--khb-ink-soft);
	font-size:13px;text-decoration:none;
}
.kof-pager-on{background:var(--khb-rose-deep);color:#fff;border-color:var(--khb-rose-deep)}

/* ---- empty state: an invitation, not an apology ---- */
.kof-acc-empty{
	text-align:center;background:#fff;border:1px dashed var(--khb-line);
	border-radius:12px;padding:38px 20px;margin-top:18px;
}
.kof-acc-empty-mk{
	width:52px;height:52px;margin:0 auto 12px;border-radius:99px;
	background:var(--khb-blush);color:var(--khb-rose-deep);
	display:flex;align-items:center;justify-content:center;font-size:22px;
}
.kof-acc-empty h3{font-family:'Marcellus',serif;font-weight:400;font-size:18px;margin:0 0 6px}
.kof-acc-empty p{font-size:13px;color:var(--khb-ink-soft);margin:0 0 16px;line-height:1.6}

/* ---- help ---- */
.kof-acc-wa{background:linear-gradient(180deg,#fff,var(--khb-blush));margin-top:16px}
.kof-acc-wa h4{font-family:'Marcellus',serif;font-weight:400;font-size:17px;margin:0}
.kof-acc-wa p{font-size:12.5px;color:var(--khb-ink-soft);margin:5px 0 14px;line-height:1.6}

.kof-faq{border:1px solid var(--khb-line);border-radius:8px;background:var(--khb-paper);overflow:hidden}
.kof-faq-i{border-bottom:1px solid #F6EFEC}
.kof-faq-i:last-child{border-bottom:0}
.kof-faq-i summary{padding:12px 14px;font-size:13.5px;cursor:pointer;list-style:none}
.kof-faq-i summary::-webkit-details-marker{display:none}
.kof-faq-i summary::after{content:"\2304";float:right;color:var(--khb-rose);font-size:11px}
.kof-faq-i[open] summary::after{content:"\2303"}
.kof-faq-i>div{padding:0 14px 13px;font-size:13px;color:var(--khb-ink-soft);line-height:1.65}

/* ---- WooCommerce's own forms, restyled ---- */
.woocommerce-account .woocommerce-EditAccountForm,
.woocommerce-account .woocommerce-address-fields{
	background:#fff;border:1px solid var(--khb-line);border-radius:12px;padding:18px;margin-top:16px;
}
.woocommerce-account .woocommerce-MyAccount-content form .form-row{margin:0 0 12px}
.woocommerce-account .woocommerce-MyAccount-content form label{
	display:block;font-size:12px;color:var(--khb-ink-soft);margin-bottom:5px;
}
.woocommerce-account .woocommerce-MyAccount-content form .input-text,
.woocommerce-account .woocommerce-MyAccount-content form select{
	width:100%;padding:9px 11px;border:1px solid var(--khb-line);border-radius:7px;
	font:400 14px 'Jost',sans-serif;background:#fff;color:var(--khb-ink);
}
.woocommerce-account .woocommerce-MyAccount-content form .input-text:focus,
.woocommerce-account .woocommerce-MyAccount-content form select:focus{
	outline:none;border-color:var(--khb-rose);box-shadow:0 0 0 3px var(--khb-blush);
}
.woocommerce-account .woocommerce-MyAccount-content fieldset{
	border:1px solid var(--khb-line);border-radius:8px;padding:14px;margin:16px 0 0;
}
.woocommerce-account .woocommerce-MyAccount-content legend{
	font-family:'Marcellus',serif;font-size:15px;padding:0 6px;
}

/* ---------------------------------------------------------------------------
   Anchors used as controls — same fault as in kof-frontend.css, see the note
   there. These are account-only, so they live here.
   ------------------------------------------------------------------------ */

a.kof-chip,
a.kof-chip:visited,
a.kof-chip:hover{color:var(--khb-ink-soft);text-decoration:none}
a.kof-chip-on,
a.kof-chip-on:visited,
a.kof-chip-on:hover{color:#fff;background:var(--khb-ink);border-color:var(--khb-ink)}

a.kof-pager-i,a.kof-pager-i:visited,a.kof-pager-i:hover{color:var(--khb-ink-soft);text-decoration:none}
a.kof-pager-on,a.kof-pager-on:visited,a.kof-pager-on:hover{color:#fff;background:var(--khb-rose-deep);border-color:var(--khb-rose-deep)}

.kof-acc-more a,.kof-acc-back a{text-decoration:none}
.kof-acc-more a:hover,.kof-acc-back a:hover{border-bottom-color:var(--khb-rose)}

/* ---- the whole card is the link ---- */
.kof-ocard{position:relative}
.kof-ocard-hit{position:absolute;inset:0;z-index:1;border-radius:12px}
.kof-ocard:hover{border-color:var(--khb-rose);box-shadow:0 2px 10px rgba(140,74,85,.07)}
.kof-ocard-hit:focus-visible{outline:2px solid var(--khb-rose-deep);outline-offset:2px}

/* The real button sits above the overlay so it stays independently
   clickable — both go to the same place today, but they will not always. */
.kof-ocard-foot{position:relative;z-index:2}
.kof-ocard-foot .kof-btn-primary,
.kof-ocard-foot .kof-btn-ghost{pointer-events:auto}

.screen-reader-text{
	position:absolute!important;width:1px;height:1px;overflow:hidden;
	clip:rect(1px,1px,1px,1px);white-space:nowrap;
}

/* ===========================================================================
   MOBILE  (4.13.0)

   Nearly every customer reads these screens on a phone, arriving from a
   WhatsApp link. Everything below is written mobile-out rather than as an
   afterthought bolted onto the desktop rules.
   ======================================================================== */

@media (max-width:760px){
	/* The shell owns the gutters now that Astra's container is gone. */
	.kof-shell{padding:20px 14px 44px}

	.kof-acc-title{font-size:22px}
	.kof-acc-sub{font-size:13px}
	.kof-acc-sec{font-size:16px;margin:20px 0 9px}

	/* Action strip: the button goes full width and below the text. A
	   right-aligned button beside three lines of copy leaves the tap target
	   in the top-right corner, which on a large phone is the hardest place
	   on the screen to reach one-handed. */
	.kof-act{display:block;padding:14px}
	.kof-act .kof-btn-primary{margin-top:12px;width:100%}
	.kof-act-big{font-size:16px}

	/* Order cards. The thumbnail becomes a banner rather than a 64px square
	   that leaves the text column too narrow to hold a status pill. */
	.kof-ocard{display:block;padding:12px}
	.kof-ocard-ph{width:100%;height:150px;margin-bottom:12px}
	.kof-ocard-top{flex-wrap:wrap;gap:8px}
	.kof-ocard-num{font-size:16px}

	/* Now / Next stack. Side by side they collide the moment either label is
	   longer than a word — "Awaiting Payment Confirmation" always is. */
	.kof-ocard-stg{display:block}
	.kof-ocard-stg span{display:block}
	.kof-ocard-stg span+span{margin-top:3px}

	.kof-ocard-foot{display:block}
	.kof-ocard-foot .kof-bal{display:block;margin-bottom:10px}
	.kof-ocard-foot .kof-btn-primary,
	.kof-ocard-foot .kof-btn-ghost{width:100%}

	/* Chips scroll rather than wrap to two rows. */
	.kof-chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
	.kof-chips::-webkit-scrollbar{display:none}
	.kof-chip{flex:0 0 auto}

	.kof-acc-empty{padding:28px 16px}
	.kof-acc-wa .kof-btn-primary{width:100%}

	/* WooCommerce's own forms: its two-column .form-row-first/.form-row-last
	   float pair is unusable at this width. */
	.woocommerce-account .woocommerce-MyAccount-content form .form-row-first,
	.woocommerce-account .woocommerce-MyAccount-content form .form-row-last{
		width:100%;float:none;margin-right:0;
	}
	.woocommerce-account .woocommerce-MyAccount-content form button{width:100%}
	.woocommerce-account .woocommerce-EditAccountForm,
	.woocommerce-account .woocommerce-address-fields{padding:14px}
}

/* A tap target below about 44px is a miss on a phone, so every control in
   the account has a floor — applied at all widths, since a mouse does not
   suffer from a slightly taller button. */
.kof-ocard-foot .kof-btn-primary,
.kof-ocard-foot .kof-btn-ghost,
.kof-chip,
.kof-pager-i,
.woocommerce-account .woocommerce-MyAccount-navigation a{
	/* KOF-4.14.0-TAP-TARGET — was 40px, which undershot the 44px the
	   comment above already called for. Corrected to match the intent. */
	min-height:44px;
	display:inline-flex;
	align-items:center;
	justify-content:center;
}
.woocommerce-account .woocommerce-MyAccount-navigation a{justify-content:flex-start}
