/**
 * Woo Specialist Theme — Core Stylesheet
 *
 * Apple-inspired page shell with full responsive support.
 * Breakpoints: mobile-first, 480px, 768px, 1024px, 1200px.
 *
 * @package Woo_Specialist_Theme
 */

/* ==========================================================================
   0. Token Fallbacks
   ========================================================================== */

/*
 * Only define tokens NOT controlled by the Customizer here.
 * All customizer-controlled values come from the inline
 * <style id="wst-customizer-css"> in <head>.
 */
:root {
	--wst-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	--wst-color-text-muted: #6e6e73;
	--wst-color-bg-alt: #f5f5f7;
	--wst-color-border: #d2d2d7;
}

/* ==========================================================================
   1. Global Reset
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--wst-font-family);
	font-size: var(--wst-font-size-base);
	line-height: 1.6;
	color: var(--wst-color-text);
	background-color: var(--wst-color-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

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

a {
	color: var(--wst-color-accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   2. Container — Responsive Padding
   ========================================================================== */

.wst-container {
	max-width: var(--wst-max-width);
	margin-inline: auto;
	padding-inline: 16px;
	width: 100%;
}

@media (min-width: 480px) {
	.wst-container {
		padding-inline: 24px;
	}
}

@media (min-width: 768px) {
	.wst-container {
		padding-inline: 32px;
	}
}

@media (min-width: 1024px) {
	.wst-container {
		padding-inline: 40px;
	}
}

/* ==========================================================================
   3. Header — Responsive
   ========================================================================== */

.wst-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background-color: var(--wst-header-bg, rgba(255, 255, 255, 0.92));
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	color: var(--wst-header-text, var(--wst-color-text));
	/* Height auto-adjusts: logo height + vertical padding */
	padding-block: var(--wst-header-padding, 16px);
}

.wst-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

@media (min-width: 768px) {
	.wst-header__inner {
		gap: 32px;
	}
}

/* --- Brand / Logo --- */

.wst-header__brand {
	flex-shrink: 0;
}

.wst-header__site-name {
	font-size: 16px;
	font-weight: 600;
	color: var(--wst-header-text, var(--wst-color-text));
	text-decoration: none;
	letter-spacing: -0.01em;
}

@media (min-width: 768px) {
	.wst-header__site-name {
		font-size: 18px;
	}
}

/* Logo sizing — constrained at all breakpoints */
.wst-header__brand .custom-logo-link {
	display: block;
}

.wst-header__brand .custom-logo-link img {
	height: var(--wst-header-logo-height);
	width: auto;
	max-height: var(--wst-header-logo-height);
	object-fit: contain;
	display: block;
}

/* Mobile: slightly smaller logo */
@media (max-width: 767px) {
	.wst-header__brand .custom-logo-link img {
		height: calc(var(--wst-header-logo-height) * 0.85);
		max-height: calc(var(--wst-header-logo-height) * 0.85);
	}
}

/* --- Navigation --- */

.wst-header__nav {
	flex: 1;
	display: none;
}

@media (min-width: 768px) {
	.wst-header__nav {
		display: flex;
		justify-content: center;
	}
}

.wst-nav {
	display: flex;
	align-items: center;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.wst-nav li {
	position: relative;
}

.wst-nav li a {
	display: flex;
	align-items: center;
	padding: 6px 16px;
	font-family: var(--wst-font-family);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--wst-color-text-muted);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: color 200ms ease, border-color 200ms ease;
	white-space: nowrap;
}

@media (min-width: 1024px) {
	.wst-nav li a {
		padding: 8px 20px;
		font-size: 14px;
		letter-spacing: 0.01em;
	}
}

.wst-nav li a:hover {
	color: var(--wst-header-text, var(--wst-color-text));
	text-decoration: none;
}

/* Active page — accent underline */
.wst-nav li.current-menu-item > a,
.wst-nav li.current_page_item > a,
.wst-nav li.current-menu-parent > a,
.wst-nav li.current-menu-ancestor > a {
	color: var(--wst-header-text, var(--wst-color-text));
	font-weight: 500;
	border-bottom-color: var(--wst-color-accent, #0071e3);
}

/* Nav items sit cleanly side-by-side. We previously rendered a 3×3 grey
   dot between items as a visual separator (`.wst-nav li + li::before`),
   but the dots read as visual noise rather than as a deliberate divider —
   removed in 2.18.1. Spacing is now carried by the parent `<ul>`'s `gap`. */

/* Dropdown */
.wst-nav li ul {
	display: none;
	position: absolute;
	/* Anchor flush with the bottom of the parent <li> (top: 100%) so there
	   is NO empty-space gap between parent and child. The 8px visual
	   breathing room is moved into the dropdown's own padding-top below.
	   This way the mouse can travel from parent → dropdown without ever
	   leaving a hoverable element, so :hover doesn't drop mid-traverse. */
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	min-width: 200px;
	background: var(--wst-color-bg, white);
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 12px;
	padding: 8px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
	list-style: none;
	z-index: 100;
}

/* Invisible hover-bridge above the dropdown.
   Extends the hover-active zone up by 8px to bridge what used to be a
   visible gap between the parent menu item and the dropdown. The user
   sees the same 8px visual gap (because the bridge is transparent), but
   their mouse never crosses dead space — :hover stays active the whole
   way through. */
.wst-nav li > ul::before {
	content: '';
	position: absolute;
	top: -8px;
	left: 0;
	right: 0;
	height: 8px;
	/* Transparent, no background. */
}

.wst-nav li:hover > ul,
.wst-nav li:focus-within > ul {
	display: block;
}

/* Remove separator dots inside dropdowns */
.wst-nav li ul li + li::before {
	display: none;
}

.wst-nav li ul li a {
	padding: 10px 14px;
	border-radius: 8px;
	border-bottom: none;
	color: var(--wst-color-text);
	font-size: 14px;
}

.wst-nav li ul li a:hover {
	background-color: var(--wst-color-bg-alt, #f5f5f7);
}

/* --- Header Actions --- */

.wst-header__actions {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

@media (min-width: 768px) {
	.wst-header__actions {
		gap: 8px;
	}
}

.wst-header__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: none;
	border: none;
	border-radius: 50%;
	color: var(--wst-header-text, var(--wst-color-text));
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease;
}

@media (min-width: 768px) {
	.wst-header__icon {
		width: 40px;
		height: 40px;
	}
}

.wst-header__icon:hover {
	background-color: var(--wst-color-bg-alt);
	text-decoration: none;
}

.wst-header__icon svg {
	width: 18px;
	height: 18px;
}

@media (min-width: 768px) {
	.wst-header__icon svg {
		width: 20px;
		height: 20px;
	}
}

.wst-header__cart {
	position: relative;
}

.wst-header__cart-count {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 9px;
	font-weight: 600;
	color: white;
	background-color: var(--wst-color-accent);
	border-radius: 9999px;
	padding: 0 3px;
	line-height: 1;
}

@media (min-width: 768px) {
	.wst-header__cart-count {
		top: 4px;
		right: 2px;
		min-width: 18px;
		height: 18px;
		font-size: 10px;
		padding: 0 4px;
	}
}

/* Account dropdown menu */
.wst-account-dropdown {
	position: relative;
}

.wst-account-dropdown__menu {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 200px;
	background: #fff;
	border: 1px solid var(--wst-color-border, #d2d2d7);
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
	padding: 6px 0;
	z-index: 1050;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 150ms ease, transform 150ms ease;
}

.wst-account-dropdown.is-open .wst-account-dropdown__menu {
	display: block;
	opacity: 1;
	transform: translateY(0);
}

.wst-account-dropdown__item {
	display: block;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 400;
	color: var(--wst-color-text, #1d1d1f);
	text-decoration: none;
	white-space: nowrap;
	transition: background 100ms ease;
}

.wst-account-dropdown__item:hover {
	background: var(--wst-color-bg-alt, #f5f5f7);
	text-decoration: none;
	color: var(--wst-color-text, #1d1d1f);
}

.wst-account-dropdown__item--logout {
	color: var(--wst-color-error, #ff3b30);
}

.wst-account-dropdown__item--logout:hover {
	color: var(--wst-color-error, #ff3b30);
}

.wst-account-dropdown__divider {
	height: 1px;
	background: var(--wst-color-border, #e8e8ed);
	margin: 4px 0;
}

/* Mobile menu toggle — visible below 768px */
.wst-header__menu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: none;
	border: none;
	color: var(--wst-header-text, var(--wst-color-text));
	cursor: pointer;
	border-radius: 50%;
}

.wst-header__menu-toggle:hover {
	background-color: var(--wst-color-bg-alt);
}

@media (min-width: 768px) {
	.wst-header__menu-toggle {
		display: none;
	}
}

/* --- Mobile Nav Drawer --- */

.wst-header__nav.is-open {
	display: flex;
	position: fixed;
	top: calc(var(--wst-header-logo-height) + var(--wst-header-padding, 16px) * 2);
	left: 0;
	right: 0;
	width: 100%;
	height: calc(100vh - var(--wst-header-logo-height) - var(--wst-header-padding, 16px) * 2);
	flex: none;
	background: white;
	z-index: 1001;
	padding: 16px;
	flex-direction: column;
	overflow-y: auto;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (min-width: 480px) {
	.wst-header__nav.is-open {
		padding: 24px;
	}
}

/*
 * Mobile drawer overrides for the primary nav.
 *
 * The base .wst-nav rule is `display: flex; align-items: center` for a
 * desktop horizontal row. In the mobile drawer we flip to a vertical
 * column. Three overrides are critical:
 *
 *   1. align-items: stretch — so every <li> takes full drawer width
 *      (otherwise items shrink to content-width and align center, which
 *      makes top-level items look centered while sub-menu items appear
 *      at the page edge — the visual mismatch reported on the live site).
 *
 *   2. border-bottom on active item is removed — on desktop it's the
 *      "current page" underline indicator and only spans the <a>'s text
 *      width because the <a> is content-sized. With stretched flex items
 *      the <a> goes full-width, so the underline becomes a 100%-wide line
 *      that reads as a horizontal divider. We swap to a left-border
 *      indicator instead.
 *
 *   3. Sub-menu <ul> is shown inline and items get visual indentation
 *      via padding-left so the parent → child relationship is obvious.
 */
.wst-header__nav.is-open .wst-nav {
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	width: 100%;
}

.wst-header__nav.is-open .wst-nav li {
	width: 100%;
}

.wst-header__nav.is-open .wst-nav li a {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	font-size: 16px;
	border-radius: 10px;
	border-bottom: none;
	border-left: 3px solid transparent;
	white-space: normal;
}

.wst-header__nav.is-open .wst-nav li a:hover,
.wst-header__nav.is-open .wst-nav li a:focus-visible {
	background-color: var(--wst-color-bg-alt, #f5f5f7);
}

.wst-header__nav.is-open .wst-nav li.current-menu-item > a,
.wst-header__nav.is-open .wst-nav li.current_page_item > a,
.wst-header__nav.is-open .wst-nav li.current-menu-parent > a,
.wst-header__nav.is-open .wst-nav li.current-menu-ancestor > a {
	border-left-color: var(--wst-color-accent, #0071e3);
	border-bottom: none;
	background-color: var(--wst-color-bg-alt, #f5f5f7);
	color: var(--wst-header-text, var(--wst-color-text));
}

.wst-header__nav.is-open .wst-nav li ul {
	display: block;
	position: static;
	box-shadow: none;
	border: none;
	padding: 0;
	margin: 0;
	min-width: 0;
	transform: none;
	background: transparent;
}

.wst-header__nav.is-open .wst-nav li ul li a {
	padding-left: 32px;
	font-size: 14px;
	color: var(--wst-color-text-muted, #6e6e73);
	border-left: 3px solid transparent;
}

/* Desktop dropdown's transparent hover bridge has no place in the
   static mobile layout — it would shift things around. */
.wst-header__nav.is-open .wst-nav li > ul::before {
	display: none;
}

/* ==========================================================================
   4. Main Content Area — Responsive
   ========================================================================== */

.wst-main {
	flex: 1;
	min-height: 0;
	padding-top: 16px;
	padding-bottom: 32px;
}

@media (min-width: 768px) {
	.wst-main {
		padding-top: 24px;
		padding-bottom: 48px;
	}
}

/* Elementor Canvas page template — no container, no padding; lets Elementor
   sections span full width. Header + footer still render. */
.wst-canvas {
	flex: 1;
	min-height: 0;
	display: block;
	width: 100%;
}

.wst-article__title {
	font-size: clamp(24px, 5vw, var(--wst-font-size-heading));
	font-weight: var(--wst-font-weight-heading);
	line-height: 1.2;
	margin: 0 0 16px;
	letter-spacing: -0.02em;
}

@media (min-width: 768px) {
	.wst-article__title {
		margin-bottom: 24px;
	}
}

.wst-article__content {
	font-size: var(--wst-font-size-base);
	line-height: 1.7;
}

/* ==========================================================================
   5. Footer — Responsive
   ========================================================================== */

.wst-footer {
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	padding: var(--wst-footer-padding) 0 24px;
	background-color: var(--wst-footer-bg, var(--wst-color-bg-alt));
	color: var(--wst-footer-text, var(--wst-color-text-muted));
	margin-top: auto;
}

.wst-footer__grid {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding-bottom: 24px;
}

@media (min-width: 768px) {
	.wst-footer__grid {
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-start;
		gap: 32px;
		padding-bottom: 32px;
	}
}

.wst-footer__site-name {
	font-size: 16px;
	font-weight: 600;
	color: var(--wst-color-text);
}

/* Footer logo sizing */
.wst-footer__brand .custom-logo-link {
	display: block;
}

.wst-footer__brand .custom-logo-link img {
	height: var(--wst-footer-logo-height);
	width: auto;
	max-height: var(--wst-footer-logo-height);
	object-fit: contain;
	display: block;
}

.wst-footer__menu {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 768px) {
	.wst-footer__menu {
		gap: 8px 24px;
	}
}

.wst-footer__menu li a {
	font-size: 13px;
	color: var(--wst-footer-text, var(--wst-color-text-muted));
	text-decoration: none;
}

@media (min-width: 768px) {
	.wst-footer__menu li a {
		font-size: 14px;
	}
}

.wst-footer__menu li a:hover {
	color: var(--wst-color-text);
}

.wst-footer__bottom {
	padding-top: 16px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
	.wst-footer__bottom {
		padding-top: 24px;
	}
}

.wst-footer__copyright {
	font-size: 12px;
	color: var(--wst-footer-text, var(--wst-color-text-muted));
	margin: 0;
}

@media (min-width: 768px) {
	.wst-footer__copyright {
		font-size: 13px;
	}
}

/* ==========================================================================
   6. WooCommerce Content Adjustments
   ========================================================================== */

.wst-main .wst-container {
	width: 100%;
}

/* Breadcrumbs */
.woocommerce-breadcrumb {
	font-size: 12px;
	color: var(--wst-color-text-muted);
	margin-bottom: 12px;
}

@media (min-width: 768px) {
	.woocommerce-breadcrumb {
		font-size: 13px;
		margin-bottom: 16px;
	}
}

.woocommerce-breadcrumb a {
	color: var(--wst-color-text-muted);
}

.woocommerce-breadcrumb a:hover {
	color: var(--wst-color-accent);
}

/* Hide page title on shop — plugin hero replaces it */
.woocommerce-page.post-type-archive-product .wst-main > .wst-container > .woocommerce-products-header {
	display: none;
}

/* Notices */
.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
	border-radius: 8px;
	font-size: 14px;
}

/* ==========================================================================
   7. WP Admin Bar Offset
   ========================================================================== */

.admin-bar .wst-header {
	top: 32px;
}

.admin-bar .wst-header__nav.is-open {
	top: calc(var(--wst-header-logo-height) + var(--wst-header-padding, 16px) * 2 + 32px);
	height: calc(100vh - var(--wst-header-logo-height) - var(--wst-header-padding, 16px) * 2 - 32px);
}

@media (max-width: 782px) {
	.admin-bar .wst-header {
		top: 46px;
	}

	.admin-bar .wst-header__nav.is-open {
		top: calc(var(--wst-header-logo-height) + var(--wst-header-padding, 16px) * 2 + 46px);
		height: calc(100vh - var(--wst-header-logo-height) - var(--wst-header-padding, 16px) * 2 - 46px);
	}
}

/* ==========================================================================
   8. Accessibility
   ========================================================================== */

:focus-visible {
	outline: 2px solid var(--wst-color-accent);
	outline-offset: 2px;
}

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

/* ==========================================================================
   9. Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
