/*
 * The WooCommerce pages (cart, checkout, My account) in the Brand in second
 * design. They keep Kadence's and WooCommerce's styles, which the blocks
 * need, so everything here sits under body.bis-store and works by
 * overriding: Kadence's palette and layout variables point at the brand
 * tokens of home.css (loaded first), then the controls WooCommerce draws
 * itself are restyled. The light mode follows on its own, through the tokens.
 */

/* --- Kadence, pointed at the brand ------------------------------------- */

body.bis-store {
	--global-palette1: var(--bis-ink);
	--global-palette2: var(--bis-accent-hover);
	--global-palette3: var(--bis-ink);
	--global-palette4: var(--bis-ink);
	--global-palette5: var(--bis-muted);
	--global-palette6: var(--bis-subtle);
	--global-palette7: var(--bis-surface);
	--global-palette8: var(--bis-bg);
	--global-palette9: var(--bis-bg);
	--global-palette9rgb: 0, 0, 0;
	--global-palette-highlight: var(--bis-ink);
	--global-palette-highlight-alt: var(--bis-muted);
	--global-palette-highlight-alt2: var(--bis-bg);
	--global-palette-btn-bg: var(--bis-accent);
	--global-palette-btn: var(--bis-accent-ink);
	--global-palette-btn-bg-hover: var(--bis-accent-hover);
	--global-palette-btn-hover: var(--bis-accent-ink);
	--global-palette-btn-sec-bg: var(--bis-ghost);
	--global-palette-btn-sec: var(--bis-ink);
	--global-palette-btn-sec-bg-hover: var(--bis-ghost-hover);
	--global-palette-btn-sec-hover: var(--bis-ink);
	--global-body-font-family: var(--bis-font);
	--global-heading-font-family: var(--bis-font);
	--global-primary-nav-font-family: var(--bis-font);
	--global-content-width: 1080px;
	--global-content-edge-padding: 24px;
	margin: 0;
	color: var(--bis-muted);
	background: var(--bis-bg);
	font-family: var(--bis-font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
:root[data-theme="light"] body.bis-store { --global-palette9rgb: 255, 255, 255; }
html:has(body.bis-store) { background: var(--bis-bg); }

body.bis-store .content-area { margin-top: 0; margin-bottom: 72px; }

/* Kadence widens .alignfull and .alignwide to 100vw, which counts the
   scrollbar and pushes the page sideways: the nav, the footer and the cart
   and checkout blocks keep their container's width. */
body.bis-store :is(.bis-nav, .bis-footer).alignfull { width: auto; max-width: none; margin-left: 0; margin-right: 0; }
body.bis-store .entry-content > :is(.alignwide, .alignfull) { width: auto; max-width: 100%; margin-left: 0; margin-right: 0; }
body.bis-store :is(.content-bg, .site, #inner-wrap, .entry) { background: transparent; box-shadow: none; }
body.bis-store .entry-content-wrap { padding: 0; }

/* The nav and footer patterns expect the block pages' zero resets, which
   Kadence's element rules would otherwise beat. Element-level specificity
   only, so every component rule of home.css still wins. */
:where(body.bis-store :is(.bis-nav, .bis-footer, .bis-co-bar, .bis-co-foot)) :is(h1, h2, h3, h4, p, ul, ol, li, figure, blockquote) { margin: 0; padding: 0; border: 0; }
:where(body.bis-store :is(.bis-nav, .bis-footer)) li { list-style: none; }
:where(body.bis-store :is(.bis-nav, .bis-footer, .bis-co-bar, .bis-co-foot)) a { color: inherit; text-decoration: none; }
:where(body.bis-store :is(.bis-nav, .bis-footer, .bis-co-bar)) :is(svg, img) { display: block; }
:where(body.bis-store :is(.bis-nav, .bis-footer, .bis-co-bar, .bis-co-foot)) { font-family: var(--bis-font); }

/* --- Titles ------------------------------------------------------------ */

body.bis-store .bis-store-title { margin: 56px 0 32px; padding: 0; color: var(--bis-ink); font-family: var(--bis-font); font-size: clamp(32px, 5vw, 46px); font-weight: 500; line-height: 1.1; letter-spacing: -.022em; text-wrap: balance; }
body.bis-store.bis-co .bis-co-title { margin: 48px auto 40px; text-align: center; }
body.bis-store :is(.entry-content, .woocommerce) :is(h2, h3) { color: var(--bis-ink); font-family: var(--bis-font); font-weight: 500; letter-spacing: -.01em; }
body.bis-store .woocommerce h2 { font-size: 22px; line-height: 1.3; }
body.bis-store .woocommerce h3 { font-size: 17px; line-height: 1.35; }

/* --- The checkout's bar and footer -------------------------------------- */

.bis-co-bar { background: var(--bis-bg); border-bottom: 1px solid var(--bis-line); }
.bis-co-bar-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 64px; }
.bis-co-back { display: inline-flex; align-items: center; justify-content: center; justify-self: start; width: 36px; height: 36px; margin-left: -8px; color: var(--bis-muted); border-radius: 999px; transition: color .15s, background-color .15s; }
.bis-co-back:hover { color: var(--bis-ink); background-color: var(--bis-tint); }
.bis-co-back:focus-visible { outline: 2px solid var(--bis-ink); outline-offset: 2px; }
.bis-co-logo { justify-self: center; line-height: 0; }
.bis-co-logo img { width: 94px; height: auto; }
.bis-co-logo:focus-visible { outline: 2px solid var(--bis-ink); outline-offset: 4px; border-radius: 4px; }

.bis-co-foot { background: var(--bis-bg); border-top: 1px solid var(--bis-line); }
.bis-co-foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 24px; padding-top: 24px; padding-bottom: 24px; color: var(--bis-subtle); font-size: 13px; line-height: 1.5; }
.bis-co-foot a { color: var(--bis-muted); transition: color .15s; }
.bis-co-foot a:hover { color: var(--bis-ink); }

/* --- Text, links ------------------------------------------------------- */

body.bis-store :is(.entry-content, .woocommerce, .wc-block-components-main, .wc-block-components-sidebar) { color: var(--bis-muted); font-size: 15px; line-height: 1.55; }
body.bis-store .entry-content a:not(.button, .wc-block-components-button, .wp-block-button__link) { color: var(--bis-ink); text-decoration: underline; text-decoration-color: var(--bis-line-strong); text-underline-offset: 3px; }
body.bis-store .entry-content a:not(.button, .wc-block-components-button, .wp-block-button__link):hover { text-decoration-color: var(--bis-ink); }
body.bis-store :is(strong, b) { color: var(--bis-ink); font-weight: 500; }

/* --- Fields (checkout and cart blocks, account forms) ------------------ */

body.bis-store :is(.wc-block-components-text-input input, .wc-block-components-textarea, .wc-blocks-components-select__select, .woocommerce form .input-text, .woocommerce form select, .woocommerce form textarea) {
	color: var(--bis-ink);
	background-color: var(--bis-surface);
	border: 1px solid var(--bis-line-strong);
	border-radius: 8px;
	box-shadow: none;
	font-family: var(--bis-font);
}
body.bis-store :is(.wc-block-components-text-input input, .wc-block-components-textarea, .wc-blocks-components-select__select, .woocommerce form .input-text, .woocommerce form select, .woocommerce form textarea):focus {
	border-color: var(--bis-ink);
	box-shadow: 0 0 0 1px var(--bis-ink);
	outline: 0;
}
body.bis-store :is(.wc-block-components-text-input input, .woocommerce form .input-text):-webkit-autofill {
	-webkit-text-fill-color: var(--bis-ink);
	-webkit-box-shadow: 0 0 0 1000px var(--bis-surface) inset;
	caret-color: var(--bis-ink);
}
body.bis-store :is(.wc-block-components-text-input label, .wc-blocks-components-select__label, .woocommerce form label) { color: var(--bis-muted); }
body.bis-store :is(.wc-block-components-text-input.is-active label, .wc-block-components-text-input input:focus + label) { color: var(--bis-muted); }
body.bis-store .wc-blocks-components-select__expand { fill: var(--bis-muted); }

body.bis-store .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
	background-color: var(--bis-surface);
	border: 1px solid var(--bis-line-strong);
	border-radius: 4px;
}
body.bis-store .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked { background-color: var(--bis-ink); border-color: var(--bis-ink); }
body.bis-store .wc-block-components-checkbox .wc-block-components-checkbox__mark { fill: var(--bis-bg); }
body.bis-store .wc-block-components-checkbox__label { color: var(--bis-muted); }

/* --- Buttons: the design's primary pill -------------------------------- */

body.bis-store :is(.wc-block-components-button:not(.is-link), .wc-block-cart__submit-button, .woocommerce .button, .woocommerce button.button, .woocommerce a.button, .woocommerce input.button) {
	min-height: 44px;
	padding: 0 22px;
	color: var(--bis-accent-ink);
	background-color: var(--bis-accent);
	border: 0;
	border-radius: 999px;
	box-shadow: none;
	font-family: var(--bis-font);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	transition: background-color .12s;
}
body.bis-store :is(.woocommerce .button, .woocommerce a.button) { display: inline-flex; align-items: center; justify-content: center; }
body.bis-store :is(.wc-block-components-button:not(.is-link), .wc-block-cart__submit-button, .woocommerce .button, .woocommerce button.button, .woocommerce a.button, .woocommerce input.button):is(:hover, :focus) {
	color: var(--bis-accent-ink);
	background-color: var(--bis-accent-hover);
}
body.bis-store :is(.wc-block-components-button:not(.is-link), .wc-block-cart__submit-button, .woocommerce .button):focus-visible { outline: 2px solid var(--bis-ink); outline-offset: 2px; }
body.bis-store .wc-block-components-button:not(.is-link) .wc-block-components-button__text { color: inherit; }
body.bis-store .wc-block-components-button.is-link, body.bis-store .wc-block-components-panel__button { color: var(--bis-ink); }

/* --- Checkout and cart blocks ------------------------------------------ */

body.bis-store :is(.wc-block-components-title, .wc-block-components-checkout-step__title, .wc-block-cart__totals-title, .wc-block-components-checkout-order-summary__title-text) { color: var(--bis-ink); font-family: var(--bis-font); font-size: 17px; font-weight: 500; text-transform: none; letter-spacing: normal; }
body.bis-store :is(.wc-block-components-checkout-step__description, .wc-block-checkout__guest-checkout-notice, .wc-block-components-address-form__address_2-toggle) { color: var(--bis-subtle); font-size: 13px; }
body.bis-store .wc-block-checkout__terms { color: var(--bis-subtle); font-size: 13px; }
body.bis-store .wc-block-checkout__terms a { color: var(--bis-muted); }

/* The order summary: a card, hairlines inside. */
body.bis-store :is(.wp-block-woocommerce-checkout-order-summary-block, .wc-block-cart .wc-block-components-sidebar .wc-block-components-totals-wrapper) { border-color: var(--bis-line); }
body.bis-store .wp-block-woocommerce-checkout-order-summary-block { background-color: var(--bis-bg-alt); border: 1px solid var(--bis-line); border-radius: 12px; }
body.bis-store :is(.wc-block-components-totals-wrapper, .wc-block-components-order-summary, .wc-block-components-panel, .wc-block-cart-items, .wc-block-cart-items td, .wc-block-cart-items th) { border-color: var(--bis-line); }
body.bis-store :is(.wc-block-components-product-name, .wc-block-components-totals-item__value, .wc-block-components-totals-footer-item, .wc-block-components-order-summary-item__total-price, .wc-block-cart-item__total) { color: var(--bis-ink); }
body.bis-store :is(.wc-block-components-totals-item__label, .wc-block-components-product-metadata, .wc-block-components-order-summary-item__individual-prices, .wc-block-cart-items__header) { color: var(--bis-muted); }
body.bis-store .wc-block-components-order-summary-item__quantity { color: var(--bis-accent-ink); background: var(--bis-ink); border-color: var(--bis-bg-alt); box-shadow: none; }

/* No product image yet: WooCommerce's grey placeholder says nothing, leave it out. */
body.bis-store .wc-block-components-order-summary-item__image:has(img[src*="woocommerce-placeholder"]) { display: none; }
body.bis-store .wc-block-cart-item__image img[src*="woocommerce-placeholder"] { visibility: hidden; }

/* The empty cart's product grids would show placeholders and product
   pages that now redirect to Pricing. */
body.bis-store .wp-block-woocommerce-empty-cart-block :is(.wp-block-woocommerce-product-new, .wp-block-woocommerce-product-collection, .wp-block-separator, .wp-block-separator + .wp-block-heading) { display: none; }
body.bis-store .wc-block-cart__empty-cart__title { color: var(--bis-ink); font-family: var(--bis-font); font-weight: 500; }
body.bis-store .wc-block-cart__empty-cart__title.with-empty-cart-icon::before { background-color: var(--bis-subtle); }

/* --- Notices ----------------------------------------------------------- */

body.bis-store :is(.wc-block-components-notice-banner, .woocommerce-message, .woocommerce-info, .woocommerce-error, .woocommerce-notice) {
	color: var(--bis-ink);
	background-color: var(--bis-surface);
	border: 1px solid var(--bis-line-strong);
	border-radius: 12px;
	box-shadow: none;
}
body.bis-store .wc-block-components-notice-banner > svg { fill: var(--bis-ink); background-color: transparent; }
body.bis-store .woocommerce-notice { margin: 0 0 24px; padding: 14px 18px; }
body.bis-store :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before { color: var(--bis-ink); }

/* --- My account -------------------------------------------------------- */

body.bis-store .woocommerce-MyAccount-navigation ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--bis-line); }
body.bis-store .woocommerce-MyAccount-navigation li { margin: 0; padding: 0; border-bottom: 1px solid var(--bis-line); }
body.bis-store .woocommerce-MyAccount-navigation li a { display: block; padding: 12px 0; color: var(--bis-muted); background: transparent; font-size: 15px; text-decoration: none; transition: color .15s; }
body.bis-store .woocommerce-MyAccount-navigation li:is(.is-active, :hover) a { color: var(--bis-ink); background: transparent; }
body.bis-store .woocommerce-MyAccount-navigation li.is-active a { font-weight: 500; }
body.bis-store :is(.woocommerce-form-login, .woocommerce-form-register, .woocommerce-ResetPassword, .woocommerce-EditAccountForm, .woocommerce-address-fields) {
	padding: 24px;
	background-color: var(--bis-bg-alt);
	border: 1px solid var(--bis-line);
	border-radius: 12px;
}
body.bis-store .woocommerce form .form-row { margin-bottom: 16px; }
body.bis-store .woocommerce form .required { color: var(--bis-muted); }
body.bis-store .woocommerce-form-login__rememberme, body.bis-store .woocommerce-LostPassword a { color: var(--bis-muted); font-size: 13px; }

/* --- Tables: orders, downloads, licenses, the confirmation -------------- */

body.bis-store :is(.woocommerce table.shop_table, .woocommerce table.my_account_orders, .woocommerce-table, .woocommerce-orders-table, .woocommerce-MyAccount-downloads) {
	width: 100%;
	border: 1px solid var(--bis-line);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 12px;
	background: transparent;
	overflow: hidden;
}
body.bis-store .woocommerce table :is(th, td) { padding: 14px 16px; color: var(--bis-muted); background: transparent; border-color: var(--bis-line); border-width: 1px 0 0; text-align: left; vertical-align: middle; }
body.bis-store .woocommerce table thead :is(th, td), body.bis-store .woocommerce table tr:first-child > :is(th, td) { border-top: 0; }
body.bis-store .woocommerce table th { color: var(--bis-ink); font-weight: 500; }
body.bis-store .woocommerce table tfoot :is(th, td) { color: var(--bis-ink); }
body.bis-store .woocommerce ul.woocommerce-order-overview { display: flex; flex-wrap: wrap; gap: 16px 32px; margin: 0 0 32px; padding: 20px 24px; list-style: none; border: 1px solid var(--bis-line); border-radius: 12px; }
body.bis-store .woocommerce ul.woocommerce-order-overview::before, body.bis-store .woocommerce ul.woocommerce-order-overview::after { display: none; } /* WooCommerce's clearfix would be a flex item */
body.bis-store .woocommerce ul.woocommerce-order-overview li { margin: 0; padding: 0; color: var(--bis-muted); font-size: 12px; text-transform: none; border: 0; }
body.bis-store .woocommerce ul.woocommerce-order-overview li strong { display: block; margin-top: 4px; color: var(--bis-ink); font-size: 15px; }
body.bis-store .woocommerce .woocommerce-customer-details address { padding: 16px 20px; color: var(--bis-muted); border: 1px solid var(--bis-line); border-radius: 12px; font-style: normal; }
