/*
 * UI polish: header actions and search, smoother anchors and focus, and small
 * readability refinements. Loaded after enhancements.css and before global-colors.css,
 * which forces button and link colors with !important, so icon buttons use
 * higher-specificity selectors.
 */
html {
	scroll-behavior: smooth;
	scroll-padding-top: 5.5rem;
	-webkit-text-size-adjust: 100%;
}

body.admin-bar {
	scroll-padding-top: 7rem;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
	text-wrap: balance;
}

p,
li {
	text-wrap: pretty;
}

::selection {
	background: color-mix(in srgb, var(--sc-color-accent) 24%, transparent);
}

img {
	max-width: 100%;
	height: auto;
}

/* Header actions: search, account, cart. */
.sc-header__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: .25rem;
}

.sc-header .sc-header__actions .sc-header__action {
	display: none;
	width: 44px;
	min-width: 44px;
	height: 44px;
	min-height: 44px;
	place-items: center;
	padding: 0;
	border: 0 !important;
	border-radius: var(--sc-radius-control, .625rem);
	background: transparent !important;
	color: var(--sc-color-text) !important;
	box-shadow: none !important;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .16s ease, color .16s ease;
}

.sc-header .sc-header__actions .sc-header__action:hover,
.sc-header .sc-header__actions .sc-header__action:focus-visible,
.sc-header .sc-header__actions .sc-header__action[aria-expanded="true"] {
	background: color-mix(in srgb, var(--sc-color-accent) 9%, var(--sc-color-surface)) !important;
	color: var(--sc-color-accent) !important;
}

.sc-header .sc-header__actions .sc-header__action .sc-icon {
	font-size: 1.05rem;
}

.sc-header__cart .sc-icon {
	transition: transform .16s ease;
}

.sc-header__cart:hover .sc-icon {
	transform: translateY(-1px);
}

/* Header search panel (desktop; phones use the bottom navigation search). */
.sc-header-search {
	position: absolute;
	z-index: 60;
	top: 100%;
	right: 0;
	left: 0;
	padding-block: 1rem;
	border-bottom: 1px solid var(--sc-color-border);
	background: var(--sc-color-surface);
	box-shadow: 0 1rem 2rem rgba(20, 17, 27, .08);
	animation: sc-search-in .18s ease-out;
}

.sc-header-search[hidden] {
	display: none !important;
}

.sc-header-search__form {
	display: flex;
	gap: .5rem;
	max-width: 44rem;
	margin-inline: auto;
}

.sc-header-search__form input[type="search"] {
	flex: 1;
	min-width: 0;
	min-height: 48px;
	padding: .5rem 1rem;
	border: 1px solid var(--sc-color-border);
	border-radius: 999px;
	background: var(--sc-color-surface);
	color: var(--sc-color-text);
	font: inherit;
}

.sc-header-search__form input[type="search"]:focus {
	border-color: var(--sc-color-accent);
	outline: 3px solid color-mix(in srgb, var(--sc-color-accent) 25%, transparent);
	outline-offset: 0;
}

.sc-header-search__form button {
	min-height: 48px;
	padding: .5rem 1.25rem;
	border-radius: 999px;
	font-weight: 700;
}

@keyframes sc-search-in {
	from { opacity: 0; transform: translateY(-.4rem); }
	to { opacity: 1; transform: none; }
}

@media (min-width: 64rem) {
	.sc-header .sc-header__actions .sc-header__action {
		display: grid;
	}
}

@media (max-width: 63.99rem) {
	.sc-header-search {
		display: none !important;
	}
}

/* Primary navigation: a quiet underline marks the current page. */
@media (min-width: 64rem) {
	.sc-primary-nav__panel > ul > li > a {
		position: relative;
	}

	.sc-primary-nav__panel > ul > li.current-menu-item > a,
	.sc-primary-nav__panel > ul > li.current-menu-ancestor > a,
	.sc-primary-nav__panel > ul > li.current_page_item > a {
		color: var(--sc-color-menu-link-hover, var(--sc-color-accent));
	}

	.sc-primary-nav__panel > ul > li.current-menu-item > a::after,
	.sc-primary-nav__panel > ul > li.current-menu-ancestor > a::after,
	.sc-primary-nav__panel > ul > li.current_page_item > a::after {
		position: absolute;
		inset: auto 1rem .45rem;
		height: 2px;
		border-radius: 2px;
		background: currentColor;
		content: "";
	}
}

/* Product loops outside the shop (home, categories, shortcodes): give the section some breathing room. */
.vividdigital-product-loops .sc-content .woocommerce > h2,
.vividdigital-product-loops .sc-content section.related > h2 {
	margin-block: 0 1rem;
	letter-spacing: -.03em;
}

/* Form controls: consistent, comfortable focus ring. */
input:not([type="checkbox"], [type="radio"], [type="range"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--sc-color-accent) 30%, transparent);
	outline-offset: 0;
	border-color: var(--sc-color-accent);
}

@media (max-width: 63.99rem) {
	html {
		scroll-padding-top: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.sc-header-search {
		animation: none;
	}

	.sc-header__cart .sc-icon,
	.sc-header .sc-header__actions .sc-header__action {
		transition: none;
	}
}

/* Header icons share one color; the cart badge keeps its own. */
.sc-header .sc-header__actions .sc-header__cart {
	color: var(--sc-color-text) !important;
}

.sc-header .sc-header__actions .sc-header__cart:hover,
.sc-header .sc-header__actions .sc-header__cart:focus-visible {
	color: var(--sc-color-accent) !important;
}

/* Product cards: "Add to cart" is the primary action, "Quick view" the quiet secondary one. */
.vividdigital-product-loops ul.products li.product a {
	text-decoration: none;
}

.vividdigital-product-loops ul.products li.product button.sc-quick-view {
	border: 1px solid var(--sc-color-border) !important;
	background: transparent !important;
	color: var(--sc-color-text) !important;
	box-shadow: none !important;
}

.vividdigital-product-loops ul.products li.product button.sc-quick-view:hover,
.vividdigital-product-loops ul.products li.product button.sc-quick-view:focus-visible {
	border-color: var(--sc-color-accent) !important;
	background: color-mix(in srgb, var(--sc-color-accent) 7%, var(--sc-color-surface)) !important;
	color: var(--sc-color-accent) !important;
}
