/**
 * Qing Header Widget styles.
 *
 * Layout: 3 equal columns (menu left, logo center, actions right) on desktop.
 * Below the configurable breakpoint the menu collapses into a hamburger
 * that opens an off-canvas panel.
 */

.qing-header {
	width: 100%;
	box-sizing: border-box;
}

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

.qing-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
	margin: 0 auto;
	width: 100%;
}

/* ---- Columns ---------------------------------------------------------- */
.qing-header__left {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	min-width: 0;
}

.qing-header__center {
	display: flex;
	align-items: center;
	justify-content: center;
}

.qing-header__right {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-width: 0;
}

/* ---- Left custom images ---------------------------------------------- */
.qing-header__left-images {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

.qing-header__left-image-link {
	display: inline-flex;
	line-height: 0;
}

.qing-header__left-image {
	display: block;
	height: 32px;
	width: auto;
}

/* ---- Logo ------------------------------------------------------------- */
.qing-header__logo a {
	display: inline-block;
	line-height: 0;
}

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

/* ---- Desktop menu ----------------------------------------------------- */
.qing-header__menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 28px;
}

.qing-header__menu ul ul {
	display: none;
}

.qing-header__menu li {
	position: relative;
	margin: 0;
}

.qing-header__menu a {
	text-decoration: none;
	display: inline-block;
	line-height: 1.4;
	transition: color 0.2s ease;
}

/* Simple dropdown for depth-2 items */
.qing-header__menu li:hover > ul {
	display: block;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 180px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	padding: 8px 0;
	z-index: 50;
}

.qing-header__menu li ul li {
	width: 100%;
}

.qing-header__menu li ul a {
	display: block;
	padding: 8px 16px;
	white-space: nowrap;
}

/* ---- Actions (social + cart) ----------------------------------------- */
.qing-header__actions {
	display: flex;
	align-items: center;
	gap: 20px;
	--qing-icon-size: 20px;
}

.qing-header__social {
	display: flex;
	align-items: center;
	gap: 16px;
}

.qing-header__social-link,
.qing-header__cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: color 0.2s ease, opacity 0.2s ease;
	line-height: 0;
}

.qing-header__social-link i,
.qing-header__social-link svg {
	font-size: var(--qing-icon-size);
	width: var(--qing-icon-size);
	height: var(--qing-icon-size);
}

/* ---- Cart ------------------------------------------------------------- */
.qing-header__cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.qing-header__cart-icon {
	width: var(--qing-icon-size);
	height: var(--qing-icon-size);
	display: block;
}

/* Count shown inline, to the RIGHT of the icon. */
.qing-header__cart-count {
	display: inline-block;
	font-size: 14px;
	line-height: 1;
	font-weight: 600;
	color: inherit;
}

.qing-header__cart-count[data-empty="true"] {
	display: none;
}

/* ---- Hamburger toggle ------------------------------------------------- */
.qing-header__toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	padding: 0;
	margin-right: 4px;
	background: none;
	border: none;
	cursor: pointer;
}

.qing-header__toggle span {
	display: block;
	width: 26px;
	height: 2px;
	background: #fff !important;
	border-radius: 2px;
	transition: transform 0.3s ease, opacity 0.2s ease;
}

/* ---- Mobile off-canvas panel ----------------------------------------- */
.qing-header__mobile-panel {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 82%;
	max-width: 360px;
	background: #fff;
	z-index: 9999;
	padding: 64px 24px 24px;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	overflow-y: auto;
	box-shadow: 2px 0 24px rgba(0, 0, 0, 0.15);
	visibility: hidden;
}

.qing-header__mobile-panel.is-open {
	transform: translateX(0);
	visibility: visible;
}

.qing-header__mobile-close {
	position: absolute;
	top: 12px;
	right: 16px;
	width: 40px;
	height: 40px;
	font-size: 32px;
	line-height: 1;
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
}

.qing-header__mobile-panel ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.qing-header__mobile-panel li {
	margin: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.qing-header__mobile-panel a {
	display: block;
	padding: 14px 4px;
	text-decoration: none;
	font-size: 16px;
}

.qing-header__mobile-panel ul ul a {
	padding-left: 20px;
	font-size: 15px;
	opacity: 0.85;
}

/* ---- Overlay ---------------------------------------------------------- */
.qing-header__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
	z-index: 9998;
}

.qing-header__overlay.is-open {
	opacity: 1;
	visibility: visible;
}

/* ======================================================================
 * Responsive: collapse to mobile.
 * The .qing-header--mobile class is toggled by JS based on the widget's
 * configurable data-breakpoint. A max-width fallback is also provided.
 * ====================================================================== */
.qing-header--mobile .qing-header__menu {
	display: none;
}

.qing-header--mobile .qing-header__toggle {
	display: flex;
}

.qing-header--mobile .qing-header__inner {
	grid-template-columns: auto 1fr auto;
}

.qing-header--mobile .qing-header__center {
	justify-content: center;
}

/* Body lock when panel is open */
body.qing-header-panel-open {
	overflow: hidden;
}

/* Fallback breakpoint for no-JS scenarios */
@media (max-width: 1024px) {
	.no-js .qing-header__menu {
		display: none;
	}
	.no-js .qing-header__toggle {
		display: flex;
	}
}

/* ======================================================================
 * Account (icon + dropdown menu for logged-in users)
 * ====================================================================== */
.qing-header__account {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.qing-header__account-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	line-height: 0;
}

.qing-header__account-svg {
	width: var(--qing-icon-size, 24px);
	height: var(--qing-icon-size, 24px);
	display: block;
	fill: currentColor;
}

.qing-header__account-menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	min-width: 160px;
	background: #111;
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	padding: 6px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	z-index: 9995;
}

.qing-header__account.is-open .qing-header__account-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.qing-header__account-link {
	display: block;
	padding: 10px 16px;
	color: #fff;
	text-decoration: none;
	font-size: 14px;
	white-space: nowrap;
	transition: background 0.2s ease;
}

.qing-header__account-link:hover {
	background: rgba(255, 255, 255, 0.08);
}

/* ======================================================================
 * Mobile: hide desktop left images, show hamburger; panel content
 * ====================================================================== */
.qing-header--mobile .qing-header__left-images {
	display: none;
}

.qing-header--mobile .qing-header__toggle {
	display: flex;
}

/* Hide the header account icon on mobile: login/register lives in the
 * off-canvas sidebar instead. */
.qing-header--mobile .qing-header__account {
	display: none;
}

/* Images inside the off-canvas panel */
.qing-header__mobile-images {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-bottom: 24px;
}

.qing-header__mobile-images .qing-header__left-image {
	height: 40px;
	width: auto;
}

/* Login / register buttons in the sidebar */
.qing-header__mobile-account {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Solid button: white on the dark sidebar. The extra specificity + !important
 * beat the panel link-color control, which also targets panel <a> elements. */
.qing-header__mobile-panel .qing-header__mobile-btn {
	display: block;
	text-align: center;
	padding: 13px 16px;
	background: #fff;
	color: #111 !important;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid #fff;
	transition: opacity 0.2s ease, background 0.2s ease;
}

.qing-header__mobile-panel .qing-header__mobile-btn:hover {
	opacity: 0.85;
}

/* Ghost button: outlined, light text on the dark sidebar. */
.qing-header__mobile-panel .qing-header__mobile-btn--ghost {
	background: transparent;
	color: #fff !important;
	border: 1px solid rgba(255, 255, 255, 0.5);
}

.qing-header__mobile-panel .qing-header__mobile-btn--ghost:hover {
	background: rgba(255, 255, 255, 0.08);
	opacity: 1;
}

/* ======================================================================
 * Login / Register modal (dark theme)
 * ====================================================================== */
.qing-auth {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s;
}

.qing-auth.is-open {
	opacity: 1;
	visibility: visible;
}

.qing-auth__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(2px);
}

.qing-auth__dialog {
	position: relative;
	width: 100%;
	max-width: 400px;
	background: #111;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.12);
	padding: 36px 32px 32px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
	transform: translateY(16px);
	transition: transform 0.25s ease;
}

.qing-auth.is-open .qing-auth__dialog {
	transform: translateY(0);
}

.qing-auth__close {
	position: absolute;
	top: 10px;
	right: 14px;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	line-height: 1;
	background: none;
	border: none;
	color: #aaa;
	cursor: pointer;
	user-select: none;
	transition: color 0.2s ease;
}

.qing-auth__close:hover {
	color: #fff;
}

.qing-auth__tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.qing-auth__tab {
	flex: 1 1 auto;
	display: block;
	text-align: center;
	background: none;
	border: none;
	color: #888;
	font-size: 16px;
	font-weight: 600;
	padding: 10px 4px 14px;
	cursor: pointer;
	position: relative;
	user-select: none;
	transition: color 0.2s ease;
}

.qing-auth__tab:hover {
	color: #ccc;
}

.qing-auth__tab.is-active {
	color: #fff;
}

.qing-auth__tab.is-active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: #fff;
}

.qing-auth__form {
	display: none;
}

.qing-auth__form.is-active {
	display: block;
}

.qing-auth__field {
	margin-bottom: 16px;
}

.qing-auth__field label {
	display: block;
	font-size: 13px;
	color: #bbb;
	margin-bottom: 6px;
}

.qing-auth__field input {
	width: 100%;
	height: 46px;
	padding: 0 14px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.22);
	color: #fff;
	font-size: 15px;
	border-radius: 0;
	box-sizing: border-box;
	transition: border-color 0.2s ease;
}

.qing-auth__field input:focus {
	outline: none;
	border-color: #fff;
}

.qing-auth__remember {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #bbb;
	margin-bottom: 20px;
	cursor: pointer;
}

.qing-auth__remember input {
	width: auto;
	margin: 0;
}

.qing-auth__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 50px;
	background: #fff;
	color: #111;
	border: none;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	user-select: none;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.qing-auth__submit:hover {
	background: #e0e0e0;
}

.qing-auth__submit.is-loading {
	opacity: 0.6;
	cursor: not-allowed;
}

.qing-auth__message {
	margin-top: 14px;
	font-size: 14px;
	min-height: 0;
}

.qing-auth__message.is-error {
	color: #ff6b6b;
}

.qing-auth__message.is-success {
	color: #51cf66;
}

body.qing-auth-open {
	overflow: hidden;
}
