/*
 * Amit Dholiya Mobile Header — Frontend base stylesheet.
 * Structural / layout rules only. Colors, sizes and spacing come from
 * CSS custom properties injected inline by WMHP_Assets::generate_css().
 */

.wmhp-header,
.wmhp-slide-menu,
.wmhp-overlay,
.wmhp-footer-nav {
	box-sizing: border-box;
}
.wmhp-header *,
.wmhp-slide-menu *,
.wmhp-footer-nav * {
	box-sizing: border-box;
}

/* ---------- Header ---------- */
.wmhp-header {
	display: flex;
	align-items: center;
	width: 100%;
	height: var(--wmhp-header-height);
	padding: 0 var(--wmhp-header-padding);
	background-color: var(--wmhp-header-bg);
	color: var(--wmhp-header-fg);
	border-radius: var(--wmhp-header-radius);
	/* Always positioned so the absolutely-positioned search dropdown
	   (and overlay-adjacent elements) reliably anchor under the header
	   instead of the nearest positioned ancestor up the page. The sticky
	   variant below overrides this with position: sticky, which still
	   works as a positioning context for descendants. */
	position: relative;
}
.wmhp-header.wmhp-is-stuck {
	background-color: var(--wmhp-header-sticky-bg);
}
.wmhp-header.wmhp-hide {
	transform: translateY(-100%);
}

/*
 * Header layout uses CSS Grid with three columns: a fixed-width "start"
 * slot, a flexible "brand" slot that truncates instead of overlapping,
 * and a fixed-width "end" slot. This avoids the overlap bugs that
 * absolute-centering caused on narrow screens with long site titles.
 */
.wmhp-header-inner {
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
	align-items: center;
	width: 100%;
	gap: 8px;
}

.wmhp-header-start,
.wmhp-header-end {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.wmhp-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: var(--wmhp-logo-m-left);
	margin-right: var(--wmhp-logo-m-right);
	min-width: 0;
	overflow: hidden;
}

/* Layout variants only change alignment/order — never position, so the
   brand and icon columns can never overlap regardless of text length. */
.wmhp-layout-centered .wmhp-brand,
.wmhp-logo-align-center .wmhp-brand { justify-content: center; }
.wmhp-layout-left-logo .wmhp-brand,
.wmhp-layout-split .wmhp-brand,
.wmhp-logo-align-left .wmhp-brand { justify-content: flex-start; }
.wmhp-layout-right-logo .wmhp-brand,
.wmhp-logo-align-right .wmhp-brand { justify-content: flex-end; }

.wmhp-layout-right-logo .wmhp-header-start { order: 3; }
.wmhp-layout-right-logo .wmhp-brand { order: 2; }
.wmhp-layout-right-logo .wmhp-header-end { order: 1; }

.wmhp-logo-link { display: inline-flex; line-height: 0; flex-shrink: 0; }
.wmhp-logo {
	width: var(--wmhp-logo-width);
	height: var(--wmhp-logo-height);
	object-fit: contain;
}

.wmhp-header-text {
	display: block;
	max-width: 100%;
	font-family: var(--wmhp-header-text-font);
	font-weight: var(--wmhp-header-text-weight);
	font-size: var(--wmhp-header-text-size);
	letter-spacing: var(--wmhp-header-text-spacing);
	line-height: var(--wmhp-header-text-line);
	color: var(--wmhp-header-text-color);
	text-transform: var(--wmhp-header-text-transform);
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wmhp-header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.wmhp-icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	border-radius: 8px;
}
.wmhp-icon-btn:hover { background: rgba(0,0,0,.05); }
.wmhp-icon {
	width: 22px;
	height: 22px;
}
.wmhp-cart-count {
	position: absolute;
	top: 2px;
	right: 2px;
	min-width: 16px;
	height: 16px;
	padding: 0 3px;
	border-radius: 999px;
	background: var(--wmhp-footer-active-icon, #6c5ce7);
	color: #fff;
	font-size: 10px;
	line-height: 16px;
	text-align: center;
}

/* ---------- Hamburger ---------- */
.wmhp-hamburger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wmhp-burger-size);
	height: var(--wmhp-burger-size);
	background-color: var(--wmhp-burger-bg);
	border: var(--wmhp-burger-border-width) solid var(--wmhp-burger-border-color);
	border-radius: var(--wmhp-burger-radius);
	cursor: pointer;
	padding: 0;
	transition: background-color var(--wmhp-anim-speed) var(--wmhp-anim-easing), border-color var(--wmhp-anim-speed) var(--wmhp-anim-easing);
}
.wmhp-hamburger:hover {
	background-color: var(--wmhp-burger-hover-bg);
	color: var(--wmhp-burger-hover-color);
}
.wmhp-hamburger--rounded { border-radius: 999px; }
.wmhp-hamburger--square { border-radius: 0; }

.wmhp-hamburger-box {
	position: relative;
	width: 20px;
	height: 14px;
	display: inline-block;
}
.wmhp-hamburger-line {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	background: var(--wmhp-burger-icon);
	border-radius: 2px;
	transition: transform var(--wmhp-anim-speed) var(--wmhp-anim-easing) var(--wmhp-anim-delay),
		opacity var(--wmhp-anim-speed) var(--wmhp-anim-easing) var(--wmhp-anim-delay),
		top var(--wmhp-anim-speed) var(--wmhp-anim-easing) var(--wmhp-anim-delay),
		width var(--wmhp-anim-speed) var(--wmhp-anim-easing) var(--wmhp-anim-delay);
}
.wmhp-line-1 { top: 0; }
.wmhp-line-2 { top: 6px; }
.wmhp-line-3 { top: 12px; }

.wmhp-hamburger[aria-expanded="true"] .wmhp-line-1 { top: 6px; transform: rotate(45deg); }
.wmhp-hamburger[aria-expanded="true"] .wmhp-line-2 { opacity: 0; }
.wmhp-hamburger[aria-expanded="true"] .wmhp-line-3 { top: 6px; transform: rotate(-45deg); }

.wmhp-anim-arrow[aria-expanded="true"] .wmhp-line-1 { transform: translateX(3px) rotate(-45deg) scaleX(.6); }
.wmhp-anim-arrow[aria-expanded="true"] .wmhp-line-3 { transform: translateX(3px) rotate(45deg) scaleX(.6); }
.wmhp-anim-minus[aria-expanded="true"] .wmhp-line-1,
.wmhp-anim-minus[aria-expanded="true"] .wmhp-line-3 { opacity: 0; }
.wmhp-anim-slider[aria-expanded="true"] .wmhp-line-1 { transform: translateY(6px) rotate(45deg); }
.wmhp-anim-slider[aria-expanded="true"] .wmhp-line-2 { transform: translateX(-10px); opacity: 0; }
.wmhp-anim-slider[aria-expanded="true"] .wmhp-line-3 { transform: translateY(-6px) rotate(-45deg); }
.wmhp-anim-collapse[aria-expanded="true"] .wmhp-line-2 { width: 0; opacity: 0; }
.wmhp-anim-vortex[aria-expanded="true"] .wmhp-hamburger-box { transform: rotate(180deg); }
.wmhp-anim-spring .wmhp-hamburger-line,
.wmhp-anim-elastic .wmhp-hamburger-line {
	transition-timing-function: cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* ---------- Overlay ---------- */
.wmhp-overlay {
	position: fixed;
	inset: 0;
	background: var(--wmhp-overlay-color);
	opacity: 0;
	visibility: hidden;
	z-index: 99997;
	transition: opacity .3s ease, visibility .3s ease;
}
.wmhp-overlay.is-visible {
	opacity: var(--wmhp-overlay-opacity);
	visibility: visible;
}

/* ---------- Slide menu ---------- */
.wmhp-slide-menu {
	position: fixed;
	top: 0;
	bottom: 0;
	width: min(var(--wmhp-menu-width), 92vw);
	background: var(--wmhp-menu-bg);
	color: var(--wmhp-menu-text);
	z-index: 99998;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	transition: transform .35s cubic-bezier(.16,1,.3,1);
	-webkit-overflow-scrolling: touch;
}
.wmhp-slide-right {
	right: 0;
	border-radius: var(--wmhp-menu-radius) 0 0 var(--wmhp-menu-radius);
	transform: translateX(100%);
}
.wmhp-slide-left {
	left: 0;
	border-radius: 0 var(--wmhp-menu-radius) var(--wmhp-menu-radius) 0;
	transform: translateX(-100%);
}
.wmhp-slide-menu.is-open { transform: translateX(0); }

.wmhp-slide-menu-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	border-bottom: 1px solid var(--wmhp-menu-border);
}
.wmhp-slide-menu-title { font-weight: 700; }
.wmhp-menu-close {
	background: none;
	border: 0;
	cursor: pointer;
	color: inherit;
	width: 32px;
	height: 32px;
}
.wmhp-menu-close .wmhp-icon { width: 18px; height: 18px; }

.wmhp-slide-menu-account { padding: 12px 16px; border-bottom: 1px solid var(--wmhp-menu-border); }
.wmhp-account-link { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.wmhp-account-link .wmhp-icon { width: 20px; height: 20px; }

.wmhp-slide-menu-nav { flex: 1; padding: 8px 0; }
ul.wmhp-menu-list { list-style: none; margin: 0; padding: 0; }
.wmhp-menu-item {
	position: relative;
	border-bottom: 1px solid var(--wmhp-menu-border);
}
.wmhp-menu-link {
	display: block;
	padding: 14px 16px;
	color: var(--wmhp-menu-text);
	text-decoration: none;
	font-family: var(--wmhp-menu-font);
	font-size: var(--wmhp-menu-font-size);
	font-weight: var(--wmhp-menu-font-weight);
	letter-spacing: var(--wmhp-menu-letter-spacing);
	line-height: var(--wmhp-menu-line-height);
	text-transform: var(--wmhp-menu-text-case);
}
.wmhp-menu-link:hover,
.wmhp-menu-link:focus-visible { color: var(--wmhp-menu-hover); }
.wmhp-menu-item.is-current > .wmhp-menu-link { color: var(--wmhp-menu-active); font-weight: 700; }

.wmhp-submenu-toggle {
	position: absolute;
	right: 8px;
	top: 6px;
	width: 32px;
	height: 32px;
	background: none;
	border: 0;
	font-size: 18px;
	cursor: pointer;
	color: inherit;
}
.wmhp-submenu-toggle[aria-expanded="true"] span { transform: rotate(45deg); display: inline-block; transition: transform .2s ease; }
ul.wmhp-submenu { list-style: none; margin: 0; padding-left: 16px; background: rgba(0,0,0,.02); }
ul.wmhp-submenu[hidden] { display: none; }

.wmhp-slide-menu-cart {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	border-top: 1px solid var(--wmhp-menu-border);
	color: inherit;
	text-decoration: none;
}
.wmhp-slide-menu-cart .wmhp-icon { width: 20px; height: 20px; }

.wmhp-slide-menu-social {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 16px;
	border-top: 1px solid var(--wmhp-menu-border);
}
.wmhp-social-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(0,0,0,.05);
	color: inherit;
}
.wmhp-social-icon .wmhp-icon { width: 16px; height: 16px; }

/* ---------- Search panel ---------- */
.wmhp-search-panel {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: var(--wmhp-header-bg);
	border-bottom: 1px solid var(--wmhp-header-border);
	padding: 10px;
	z-index: 99996;
}
.wmhp-search-mode-fullscreen {
	position: fixed;
	inset: 0;
	top: 0;
	padding: 24px 16px;
}
/* Only apply the fullscreen flex layout while the panel is actually
   visible — an unconditional `display: flex` here would override the
   native [hidden] attribute (author rules beat the UA default when
   specificity ties), making the fullscreen search box appear on page
   load instead of staying hidden until the search icon is clicked. */
.wmhp-search-mode-fullscreen:not([hidden]) {
	display: flex;
	flex-direction: column;
}
.wmhp-search-form { display: flex; align-items: center; gap: 8px; }
.wmhp-search-input {
	flex: 1;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--wmhp-header-border);
	border-radius: 8px;
	font-size: 15px;
}
.wmhp-search-submit,
.wmhp-search-close {
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: inherit;
}
.wmhp-search-results { margin-top: 10px; max-height: 60vh; overflow-y: auto; }
.wmhp-search-result {
	display: block;
	padding: 10px 6px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid rgba(0,0,0,.06);
}
.wmhp-search-empty { padding: 10px 6px; opacity: .7; font-size: 14px; }

/* Belt-and-suspenders: guarantee the panel is hidden whenever the native
   [hidden] attribute is present, no matter what other search-mode rules
   declare, so a future mode/class addition can't reintroduce this bug. */
.wmhp-search-panel[hidden] { display: none; }

/* ---------- Footer nav ---------- */
.wmhp-footer-nav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	display: none;
	align-items: stretch;
	justify-content: space-around;
	background: var(--wmhp-footer-bg);
	color: var(--wmhp-footer-text);
	z-index: 99995;
	box-shadow: 0 -2px 10px rgba(0,0,0,.06);
	padding-bottom: env(safe-area-inset-bottom, 0);
	transition: transform .3s ease;
}
.wmhp-footer-autohide.wmhp-hide { transform: translateY(100%); }

.wmhp-footer-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 8px 4px;
	text-decoration: none;
	color: var(--wmhp-item-icon-color, var(--wmhp-footer-text));
	font-size: 11px;
}
.wmhp-footer-item .wmhp-footer-icon .wmhp-icon { width: 22px; height: 22px; }
.wmhp-footer-item.is-active {
	color: var(--wmhp-item-active-color, var(--wmhp-footer-active-text));
}
.wmhp-footer-item.is-active .wmhp-footer-icon { color: var(--wmhp-item-active-color, var(--wmhp-footer-active-icon)); }

.wmhp-footer-style-2 .wmhp-footer-item.is-active {
	background: rgba(0,0,0,.06);
	border-radius: 999px;
	margin: 4px 2px;
}
.wmhp-footer-style-3 {
	left: 10px;
	right: 10px;
	bottom: 10px;
	border-radius: 20px;
	box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.wmhp-footer-style-4 .wmhp-footer-label { display: none; }

/* ---------- Body padding so fixed footer doesn't overlap content ---------- */
body.wmhp-has-footer-nav { padding-bottom: 64px; }

/* ---------- Page load transitions ---------- */
body.wmhp-page-fade { animation: wmhp-fade var(--wmhp-page-load-duration) var(--wmhp-page-load-delay) both; }
body.wmhp-page-fade-slide { animation: wmhp-fade-slide var(--wmhp-page-load-duration) var(--wmhp-page-load-delay) both; }
@keyframes wmhp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wmhp-fade-slide { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.wmhp-loader {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	z-index: 999999;
	transition: opacity .3s ease, visibility .3s ease;
}
.wmhp-loader.is-hidden { opacity: 0; visibility: hidden; }
.wmhp-loader-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(0,0,0,.1);
	border-top-color: var(--wmhp-menu-active, #6c5ce7);
	border-radius: 50%;
	animation: wmhp-spin .7s linear infinite;
}
@keyframes wmhp-spin { to { transform: rotate(360deg); } }

/* Screen-reader only text (accessibility) */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Focus visibility for keyboard users */
.wmhp-header a:focus-visible,
.wmhp-header button:focus-visible,
.wmhp-slide-menu a:focus-visible,
.wmhp-slide-menu button:focus-visible,
.wmhp-footer-nav a:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}
