/*
 * Toga brand overrides.
 *
 * theme.json already recolors core blocks (backgrounds, text, headings,
 * links, default buttons) via the base/contrast/accent-1 palette slugs.
 * This file only reaches the parts theme.json can't: WooCommerce's
 * hardcoded block-package colors (add-to-cart, sale badge) and the Dokan
 * vendor dashboard, which is classic PHP/CSS outside the block/theme.json
 * system. Layout and markup are untouched — colors and type only.
 *
 * Color/Dokan-variable tokens (--toga-ink, --dokan-button-*, etc.) now live
 * in tokens.css, loaded before this file — see that file's header comment.
 */

/* -------------------------------------------------------------------- */
/* Header logo — Toga wordmark, sized by height so the wide wordmark      */
/* stays balanced next to 16px nav text. Ink-on-transparent asset, so no  */
/* box shows on the light/Paper header. Sized/replaced here (a stable     */
/* theme asset), never via the DB custom_logo attachment.                 */
/* -------------------------------------------------------------------- */

.toga-site-logo {
	display: inline-flex;
	align-items: center;
	line-height: 0;
	flex: 0 0 auto;
}

/*
 * Two-class specificity (0,2,0) is deliberate: WooCommerce's own
 * `.woocommerce img, .woocommerce-page img { height: auto }`
 * (woocommerce-layout.css, specificity 0,1,1) otherwise wins on My Account,
 * Cart, Checkout and store pages and stretches the wordmark to the full
 * content width. The header logo is always sized by height instead.
 */
.toga-site-logo .toga-site-logo__img {
	display: block;
	width: auto;
	height: 40px;
	max-width: none;
}

@media (max-width: 600px) {
	.toga-site-logo .toga-site-logo__img {
		height: 32px;
	}
}

/* -------------------------------------------------------------------- */
/* Footer — Ink band, full shopping-bag logo in a light card, real links */
/* -------------------------------------------------------------------- */

.toga-footer {
	border-top: 3px solid var(--toga-terracotta);
}

.toga-footer__inner {
	gap: 2rem 3rem;
}

.toga-footer__brand {
	display: inline-flex;
	align-items: center;
	gap: 1rem;
	text-decoration: none;
	color: inherit;
}

.toga-footer__logo-card {
	display: inline-flex;
	background-color: var(--toga-paper);
	border-radius: 8px;
	padding: 0.5rem 0.7rem;
	line-height: 0;
}

/* Two-class specificity, same reason as the header wordmark: beat
   WooCommerce's `.woocommerce img { height: auto }` on store/account pages. */
.toga-footer .toga-footer__logo {
	display: block;
	width: auto;
	height: 64px;
	max-width: none;
}

.toga-footer__tagline {
	font-family: var(--wp--preset--font-family--poppins);
	font-weight: 500;
	font-size: 1.05rem;
	max-width: 14em;
}

.toga-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.75rem;
	font-family: var(--wp--preset--font-family--inter);
}

.toga-footer__links a {
	color: var(--toga-paper);
	text-decoration: none;
}

.toga-footer__links a:hover,
.toga-footer__links a:focus-visible {
	color: var(--toga-terracotta);
	text-decoration: underline;
}

.toga-footer__legal {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid color-mix(in srgb, var(--toga-paper) 20%, transparent);
	gap: 0.5rem 2rem;
	opacity: 0.85;
}

.toga-footer__legal p {
	margin: 0;
}

@media (max-width: 600px) {
	.toga-footer .toga-footer__logo {
		height: 52px;
	}
}

/* -------------------------------------------------------------------- */
/* WooCommerce — Add to Cart (terracotta accent, not the default button ink) */
/* -------------------------------------------------------------------- */

.wc-block-components-product-button__button,
a.add_to_cart_button:not(.toga-product-card__action),
a.ajax_add_to_cart:not(.toga-product-card__action),
.single_add_to_cart_button {
	background-color: var(--toga-terracotta) !important;
	border-color: var(--toga-terracotta) !important;
	color: var(--toga-paper) !important;
	transition: var(--toga-transition);
}

.wc-block-components-product-button__button:hover,
.wc-block-components-product-button__button:focus,
a.add_to_cart_button:not(.toga-product-card__action):hover,
a.ajax_add_to_cart:not(.toga-product-card__action):hover,
.single_add_to_cart_button:hover {
	background-color: var(--toga-terracotta-hover) !important;
	border-color: var(--toga-terracotta-hover) !important;
	color: var(--toga-paper) !important;
}

/* Sale badges */
.wc-block-components-product-sale-badge,
.wp-block-woocommerce-product-sale-badge .wc-block-components-product-sale-badge__text,
span.onsale {
	background-color: var(--toga-terracotta) !important;
	color: var(--toga-paper) !important;
}

/* -------------------------------------------------------------------- */
/* WooCommerce Cart / Checkout blocks — align to palette + type          */
/* -------------------------------------------------------------------- */

.wc-block-cart,
.wc-block-checkout {
	font-family: var(--wp--preset--font-family--inter);
	color: var(--toga-ink);
}

.wc-block-cart .wc-block-components-totals-item__label,
.wc-block-checkout .wc-block-components-totals-item__label,
.wc-block-cart h2,
.wc-block-checkout h2,
.wc-block-components-checkout-order-summary__label {
	font-family: var(--wp--preset--font-family--poppins);
}

.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
.wp-block-woocommerce-proceed-to-checkout-block .wp-block-button__link {
	background-color: var(--toga-ink) !important;
	border-color: var(--toga-ink) !important;
	color: var(--toga-paper) !important;
	transition: var(--toga-transition);
}

.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover,
.wp-block-woocommerce-proceed-to-checkout-block .wp-block-button__link:hover {
	background-color: var(--toga-ink-hover) !important;
	border-color: var(--toga-ink-hover) !important;
}

.wc-block-components-totals-coupon__button,
.wc-block-components-checkout-return-to-cart-button {
	color: var(--toga-terracotta);
}

/* -------------------------------------------------------------------- */
/* Dokan vendor dashboard                                                */
/* Dokan themes its own buttons/sidebar entirely through these CSS       */
/* custom properties (see dokan-lite/assets/css/style.css) — overriding */
/* them here recolors the dashboard without touching Dokan templates.   */
/* Status colors (success/warning/danger/info) are left as Dokan         */
/* defaults so order/withdrawal states stay legible.                    */
/* -------------------------------------------------------------------- */

.dokan-dashboard {
	font-family: var(--wp--preset--font-family--inter);
	color: var(--toga-ink);
}

/*
 * A handful of Dokan rules hardcode #7047EB directly instead of reading
 * the --dokan-* custom properties above (sidebar item hover/active state,
 * the "theme" button badge) — those need literal overrides since no
 * variable exists to redirect.
 */
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li:hover,
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.active,
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:hover {
	background: var(--toga-ink-hover) !important;
}

.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.active ul.navigation-submenu {
	border-bottom-color: var(--toga-ink-hover) !important;
}

.dokan-dashboard .dokan-btn-theme .badge {
	color: var(--toga-ink);
}

.dokan-dashboard h1,
.dokan-dashboard h2,
.dokan-dashboard h3,
.dokan-dashboard h4,
.dokan-dashboard h5,
.dokan-dashboard h6,
.dokan-dashboard .dokan-panel-heading,
.dokan-dashboard .dokan-dash-title {
	font-family: var(--wp--preset--font-family--poppins);
}

/* Scoped to dashboard content/sidebar only, so it doesn't recolor the
   shared header/footer template parts (which also render on this page
   since body carries the .dokan-dashboard class). */
.dokan-dashboard-content a,
.dokan-dash-sidebar .dokan-common-links a {
	color: var(--toga-terracotta);
}

.dokan-dashboard .dokan-btn-theme {
	background-color: var(--toga-ink);
	border-color: var(--toga-ink);
	color: var(--toga-paper);
}

.dokan-dashboard .dokan-btn-theme:hover,
.dokan-dashboard .dokan-btn-theme:focus {
	background-color: var(--toga-ink-hover);
	border-color: var(--toga-ink-hover);
	color: var(--toga-paper);
}
