/*
 * Cmsmart Stores: front-end pieces of the recommended plugins, styled with the store tokens.
 * Scoped to each plugin's own classes; colours come from the palette (theme.json) so every store picks up its own
 * primary colour. A child overrides tokens, not this file. Plugins that are not installed cost nothing here.
 */

:root {
	--cs-plg-accent: var(--wp--preset--color--primary-dark, var(--wp--preset--color--primary, #0e7fa3));
	--cs-plg-accent-hover: var(--wp--preset--color--contrast, #222);
	--cs-plg-on-accent: var(--wp--preset--color--base, #fff);
	--cs-plg-text: var(--wp--preset--color--contrast, #222);
	--cs-plg-muted: var(--wp--preset--color--muted, #666);
	--cs-plg-border: var(--wp--preset--color--border, #e0e0e0);
	--cs-plg-surface: var(--wp--preset--color--tertiary, #f8f9f9);
	--cs-plg-radius: var(--cs-radius-field, 2px);
}

/* ---------- header slots: search, language, currency ---------- */
.cs-header-search {
	flex: 0 0 auto;
	min-width: 0;
}

.cs-header-switchers {
	display: flex;
	align-items: center;
	gap: var(--cs-space-2, 8px);
	flex: 0 0 auto;
}

.cs-switcher select,
.cs-switcher .woocommerce-currency-switcher {
	min-height: 36px;
	height: 36px;
	padding: 0 24px 0 10px;
	font-size: 0.875rem;
	color: var(--cs-plg-text);
	background-color: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--cs-plg-border);
	border-radius: var(--cs-plg-radius);
	width: auto;
	max-width: 100%;
}

.cs-switcher form {
	margin: 0;
}

.cs-switcher--language .trp-shortcode-switcher__wrapper {
	--bg: var(--wp--preset--color--base, #fff);
	--bg-hover: var(--cs-plg-surface);
	--text: var(--cs-plg-text);
	--text-hover: var(--cs-plg-text);
	--border: 1px solid var(--cs-plg-border);
	--border-color: var(--cs-plg-border);
	--border-radius: var(--cs-plg-radius);
	--font-size: 14px;
	--switcher-padding: 4px 8px;
}

.cs-switcher--language .trp-shortcode-switcher {
	padding: 4px 0;
}

.cs-switcher--language .trp-language-item-name {
	max-width: 7em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cs-header-switchers--strip {
	display: none;
}

@media (max-width: 781px) {
	.cs-header-switchers--tools {
		display: none;
	}

	.cs-header-switchers--strip {
		display: flex;
		justify-content: flex-end;
		padding: 4px var(--cs-gutter, 16px);
		background: var(--cs-plg-surface);
		border-bottom: 1px solid var(--cs-plg-border);
	}
}

/* FiboSearch */
.dgwt-wcas-search-wrapp {
	max-width: 100%;
	color: var(--cs-plg-text);
}

.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
	min-height: 40px;
	height: 40px;
	font-size: 1rem;
	color: var(--cs-plg-text);
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--cs-field-border, #8a8a8a);
	border-radius: var(--cs-plg-radius);
	box-shadow: none;
}

.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:focus {
	border-color: var(--cs-plg-accent);
	box-shadow: 0 0 0 2px var(--cs-ring-gap, #fff), 0 0 0 4px var(--cs-ring, var(--cs-plg-accent));
	outline: 0;
}

.dgwt-wcas-search-wrapp .dgwt-wcas-ico-magnifier,
.dgwt-wcas-search-wrapp .dgwt-wcas-ico-magnifier-handler {
	fill: var(--cs-plg-accent);
}

.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit {
	background: var(--cs-plg-accent);
	color: var(--cs-plg-on-accent);
	border-radius: 0 var(--cs-plg-radius) var(--cs-plg-radius) 0;
}

.dgwt-wcas-suggestions-wrapp,
.dgwt-wcas-details-wrapp {
	border: 1px solid var(--cs-plg-border);
	box-shadow: var(--cs-shadow-2, 0 8px 24px rgba(0, 0, 0, 0.16));
	color: var(--cs-plg-text);
	font-family: inherit;
}

.dgwt-wcas-suggestion.dgwt-wcas-suggestion-selected,
.dgwt-wcas-suggestion:hover {
	background: var(--cs-plg-surface);
}

.dgwt-wcas-suggestion .dgwt-wcas-st {
	color: var(--cs-plg-text);
}

.dgwt-wcas-suggestion .dgwt-wcas-sp,
.dgwt-wcas-suggestion .dgwt-wcas-sp .woocommerce-Price-amount {
	color: var(--cs-plg-accent);
	font-weight: 600;
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-search-input {
	font-size: 16px;
}

/* ---------- product cards: wishlist, compare, quick view as one icon row ---------- */
li.product .woosc-btn,
li.product .woosq-btn,
li.product .tinvwl-loop-button-wrapper,
.wc-block-product .woosc-btn,
.wc-block-product .woosq-btn,
.wc-block-product .tinvwl-loop-button-wrapper {
	display: inline-flex;
	vertical-align: top;
	margin: var(--cs-space-2, 8px) 3px 0;
}

li.product .tinvwl-loop-button-wrapper,
.wc-block-product .tinvwl-loop-button-wrapper {
	padding: 0;
}

li.product .woosc-btn-text,
li.product .woosq-btn-text,
.wc-block-product .woosc-btn-text,
.wc-block-product .woosq-btn-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* compare + quick view buttons (cards and product page) */
.woosc-btn,
.woosq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: var(--cs-target, 44px);
	min-height: var(--cs-target, 44px);
	padding: 0 var(--cs-space-3, 12px);
	font: inherit;
	font-size: 0.875rem;
	line-height: 1.2;
	color: var(--cs-plg-text);
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--cs-plg-border);
	border-radius: var(--cs-plg-radius);
	text-decoration: none;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.woosc-btn:hover,
.woosq-btn:hover,
.woosc-btn.woosc-added {
	color: var(--cs-plg-on-accent);
	background: var(--cs-plg-accent);
	border-color: var(--cs-plg-accent);
}

.woosc-btn:focus-visible,
.woosq-btn:focus-visible,
.tinvwl_add_to_wishlist_button:focus-visible {
	outline: 2px solid var(--cs-ring, var(--cs-plg-accent));
	outline-offset: 2px;
}

/* wishlist */
.tinv-wraper .tinvwl_add_to_wishlist_button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: var(--cs-target, 44px);
	color: var(--cs-plg-text);
	font-size: 0.875rem;
	text-decoration: none;
}

.tinvwl-loop-button-wrapper .tinvwl_add_to_wishlist_button {
	justify-content: center;
	min-width: var(--cs-target, 44px);
	padding: 0 var(--cs-space-3, 12px);
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--cs-plg-border);
	border-radius: var(--cs-plg-radius);
}

.tinv-wraper .tinvwl_add_to_wishlist_button::before {
	color: var(--cs-plg-accent);
}

.tinvwl-loop-button-wrapper .tinvwl_add_to_wishlist_button:hover,
.tinv-wraper .tinvwl_add_to_wishlist_button.tinvwl-product-in-list {
	border-color: var(--cs-plg-accent);
}

.tinvwl-loop-button-wrapper .tinvwl_add_to_wishlist_button:hover::before,
.tinv-wraper .tinvwl_add_to_wishlist_button.tinvwl-product-in-list::before {
	color: var(--cs-plg-accent);
}

body.single-product .tinv-wraper,
body.single-product .woosc-btn,
body.single-product .woosq-btn {
	margin-top: var(--cs-space-3, 12px);
	margin-right: var(--cs-space-2, 8px);
}

/* wishlist page and table */
.tinvwl_added_to_wishlist.tinv-modal .tinv-modal-inner {
	border-radius: var(--cs-plg-radius);
}

.tinv-wishlist table.tinvwl-table-manage-list .product-action .button,
.tinv-wishlist .tinvwl-to-right .button,
.tinv-wishlist .tinvwl_added_to_wishlist .button,
.tinv-wishlist .tinvwl-btn-onclick {
	color: var(--cs-plg-on-accent);
	background: var(--cs-plg-accent);
	border-color: var(--cs-plg-accent);
	border-radius: var(--cs-plg-radius);
}

/* compare bar and table, quick view popup */
.woosc-bar,
.woosc-popup,
.woosq-popup {
	font-family: inherit;
	color: var(--cs-plg-text);
}

.woosc-bar .woosc-bar-btn,
.woosc-bar .woosc-bar-search,
.woosc-popup .woosc-popup-close,
.woosq-popup .woosq-popup-close {
	border-radius: var(--cs-plg-radius);
}

.woosc-bar .woosc-bar-btn {
	background: var(--cs-plg-accent);
	color: var(--cs-plg-on-accent);
	border-color: var(--cs-plg-accent);
}

.woosc-popup-content .woosc_table th {
	background: var(--cs-plg-surface);
}

.woosc-popup .price,
.woosq-popup .price {
	color: var(--cs-plg-accent);
	font-weight: 600;
}

.woosq-popup .single_add_to_cart_button,
.woosq-popup .single_add_to_cart_button.button {
	background: var(--cs-plg-accent);
	color: var(--cs-plg-on-accent);
	border-radius: var(--cs-plg-radius);
}

.woosq-popup .woosq-view-details,
.woosq-popup .woosq-view-details a,
.woosq-popup a {
	color: var(--cs-plg-accent);
}

/* ---------- swatches (global product attributes) ---------- */
/* The plugin's own selectors are long; :not(#cs) lifts ours above them without !important. */
.variations_form .tawcvs-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: var(--cs-space-2, 8px);
	align-items: center;
}

.variations_form .tawcvs-swatches .swatch-item-wrapper:not(#cs) {
	margin: 0;
	padding: 0;
}

.variations_form .tawcvs-swatches .swatch:not(#cs) {
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	min-width: 36px;
	margin: 0;
	padding: 0;
	line-height: 1;
	color: var(--cs-plg-text);
	background-color: var(--wp--preset--color--base, #fff);
	border: 2px solid var(--cs-plg-border);
	border-radius: var(--cs-plg-radius);
	box-shadow: none;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.variations_form .tawcvs-swatches .swatch.swatch-color:not(#cs) {
	text-indent: -9999em;
}

.variations_form .tawcvs-swatches .swatch.swatch-shape-circle:not(#cs) {
	border-radius: 50%;
}

.variations_form .tawcvs-swatches .swatch.swatch-label:not(#cs) {
	width: auto;
	height: auto;
	min-width: var(--cs-target, 44px);
	min-height: var(--cs-target, 44px);
	padding: 0 var(--cs-space-3, 12px);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--cs-plg-radius);
	font-size: 0.9375rem;
}

.variations_form .tawcvs-swatches .swatch:not(#cs)::before,
.variations_form .tawcvs-swatches .swatch:not(#cs)::after {
	display: none !important;
}

.variations_form .tawcvs-swatches .swatch:not(#cs):hover {
	border-color: var(--cs-plg-accent);
}

.variations_form .tawcvs-swatches .swatch.selected:not(#cs) {
	border-color: var(--cs-plg-accent);
	box-shadow: 0 0 0 2px var(--cs-ring-gap, #fff), 0 0 0 4px var(--cs-plg-accent);
}

.variations_form .tawcvs-swatches .swatch.swatch-label.selected:not(#cs) {
	color: var(--cs-plg-on-accent);
	background-color: var(--cs-plg-accent);
	box-shadow: none;
}

.variations_form .tawcvs-swatches .swatch.swatch-disabled:not(#cs),
.variations_form .tawcvs-swatches .swatch.disabled:not(#cs) {
	opacity: 0.4;
	cursor: not-allowed;
}

.variations_form .tawcvs-swatches .swatch .swatch__tooltip {
	font-size: 0.8125rem;
}

/* ---------- cookie consent (CookieYes) ---------- */
/* The banner sets its colours as inline style attributes, so !important is needed here (and only here). */
.cky-consent-container .cky-consent-bar {
	border-radius: var(--cs-plg-radius);
	border-color: var(--cs-plg-border) !important;
	font-family: inherit;
	box-shadow: var(--cs-shadow-2, 0 8px 24px rgba(0, 0, 0, 0.16));
}

.cky-consent-container .cky-title,
.cky-modal .cky-preference-title {
	color: var(--cs-plg-text) !important;
}

.cky-consent-container .cky-btn,
.cky-modal .cky-btn {
	min-height: var(--cs-target, 44px);
	border-radius: var(--cs-plg-radius);
	font-family: inherit;
	font-weight: 600;
}

.cky-consent-container .cky-btn-accept,
.cky-consent-container .cky-btn-reject,
.cky-modal .cky-btn-accept,
.cky-modal .cky-btn-preferences,
.cky-modal .cky-btn-reject {
	color: var(--cs-plg-on-accent) !important;
	background-color: var(--cs-plg-accent) !important;
	border-color: var(--cs-plg-accent) !important;
}

.cky-consent-container .cky-btn-customize {
	color: var(--cs-plg-accent) !important;
	background-color: transparent !important;
	border-color: var(--cs-plg-accent) !important;
}

.cky-consent-container .cky-btn:hover,
.cky-modal .cky-btn:hover {
	opacity: 1;
	color: var(--cs-plg-on-accent) !important;
	background-color: var(--cs-plg-accent-hover) !important;
	border-color: var(--cs-plg-accent-hover) !important;
}

.cky-btn-revisit-wrapper {
	background-color: var(--cs-plg-accent) !important;
}

.cky-switch input[type="checkbox"]:checked {
	background-color: var(--cs-plg-accent) !important;
}

@media (max-width: 781px) {
	.cky-consent-container .cky-consent-bar {
		margin: 0 8px 8px;
		width: auto;
	}
}

/* ---------- Fluid Checkout ---------- */
body.woocommerce-checkout {
	--fluidcheckout--button--primary--background-color: var(--cs-plg-accent);
	--fluidcheckout--button--primary--border-color: var(--cs-plg-accent);
	--fluidcheckout--button--primary--text-color: var(--cs-plg-on-accent);
	--fluidcheckout--button--primary--background-color--hover: var(--cs-plg-accent-hover);
	--fluidcheckout--button--primary--border-color--hover: var(--cs-plg-accent-hover);
	--fluidcheckout--button--primary--text-color--hover: var(--cs-plg-on-accent);
	--fluidcheckout--button--secondary--text-color: var(--cs-plg-accent);
	--fluidcheckout--button--secondary--border-color: var(--cs-plg-accent);
	--fluidcheckout--button--border-radius: var(--cs-plg-radius);
	--fluidcheckout--button--height: var(--cs-target, 44px);
	--fluidcheckout--field--border-radius: var(--cs-plg-radius);
	--fluidcheckout--field--border-color: var(--cs-field-border, #8a8a8a);
	--fluidcheckout--field--height: var(--cs-target, 44px);
	--fluidcheckout--section--border-radius: var(--cs-plg-radius);
	--fluidcheckout--option-box--radio-color--checked: var(--cs-plg-accent);
	--fluidcheckout--option-box--border-radius: var(--cs-plg-radius);
	--fluidcheckout--color--success: var(--wp--preset--color--primary-dark, #1a7f37);
}

/* The theme's notices block sits above the checkout; Fluid Checkout floats every notices wrapper into its column. */
body.woocommerce-checkout .wc-block-store-notices .woocommerce-notices-wrapper {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.woocommerce-checkout .wp-block-post-content {
	display: block;
}

body.woocommerce-checkout .fc-progress-bar__step.is-current,
body.woocommerce-checkout .fc-progress-bar__step.is-complete {
	background-color: var(--cs-plg-accent);
}

body.woocommerce-checkout .fc-step__substep-save,
body.woocommerce-checkout .fc-step__next-step,
body.woocommerce-checkout #place_order {
	font-size: var(--cs-fs-body, 1rem);
	font-weight: 600;
}

/* ---------- newsletter form (MailPoet) ---------- */
.mailpoet_form .mailpoet_text,
.mailpoet_form .mailpoet_textarea,
.mailpoet_form .mailpoet_select {
	min-height: var(--cs-target, 44px);
	border: 1px solid var(--cs-field-border, #8a8a8a);
	border-radius: var(--cs-plg-radius);
	font: inherit;
}

.mailpoet_form .mailpoet_submit {
	min-height: var(--cs-target, 44px);
	color: var(--cs-plg-on-accent);
	background: var(--cs-plg-accent);
	border: 0;
	border-radius: var(--cs-plg-radius);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
