/* Scoped to headers whose native launcher was inserted successfully. */
[data-pq-qb-integrated] .pq-qb-header-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
}

[data-pq-qb-integrated] .pq-qb-header-row > .col-auto {
	min-width: 0;
	max-width: 100%;
	width: auto;
	order: initial;
}

[data-pq-qb-integrated] .pq-qb-header-row > .pq-qb-header-action-column {
	display: block !important;
}

[data-pq-qb-integrated] .pq-qb-header-action-column .header-button {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

[data-pq-qb-integrated] .pq-frutin-header-quickbuy {
	display: inline-flex;
	min-width: 0;
}

[data-pq-qb-integrated] .pq-qb-header-action-column .pq-frutin-header-quickbuy .pq-qb-launcher.th-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 0;
	min-height: 44px;
	max-width: 100%;
	padding: 12px 18px;
	margin: 0;
	border: 1px solid #268843;
	border-radius: 30px;
	background: #268843;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 800;
	line-height: 1.2;
	white-space: normal;
	overflow-wrap: anywhere;
	text-decoration: none;
}

[data-pq-qb-integrated] .pq-frutin-header-quickbuy .pq-qb-launcher::before,
[data-pq-qb-integrated] .pq-frutin-header-quickbuy .pq-qb-launcher::after {
	display: none;
}

[data-pq-qb-integrated] .pq-frutin-header-quickbuy .pq-qb-launcher:hover {
	background: #166534;
	border-color: #166534;
	color: #fff;
}

[data-pq-qb-integrated] .pq-frutin-header-quickbuy .pq-qb-launcher:focus-visible,
.th-mobile-menu .pq-qb-menu-entry > a:focus-visible {
	outline: 3px solid #f7bb18;
	outline-offset: 3px;
}

[data-pq-qb-integrated] .pq-qb-launcher .fa-cart-shopping {
	flex: 0 0 auto;
	font-size: 20px;
}

/* Owner-configured leaf link; preserve WordPress's menu structure and URL. */
.main-menu li.pq-qb-menu-entry {
	display: none !important;
}

.th-mobile-menu .pq-qb-menu-entry > a {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin-block: 12px;
	padding: 12px;
	border-radius: 24px;
	background: #268843;
	color: #fff;
	font-weight: 800;
	text-align: center;
}

.th-mobile-menu .pq-qb-menu-entry > a::before {
	content: none;
}

@media (min-width: 992px) {
	.th-mobile-menu li.pq-qb-menu-entry {
		display: none;
	}
	[data-pq-qb-integrated] .pq-qb-header-navigation-column {
		justify-self: center;
	}
	/* Keep the desktop action compact: no full-width green slab. */
	[data-pq-qb-integrated] .pq-qb-header-row > .pq-qb-header-action-column {
		width: max-content;
		justify-self: end;
		background: transparent;
	}
	[data-pq-qb-integrated] .pq-qb-header-action-column .header-button {
		width: max-content;
		background: transparent;
	}
	[data-pq-qb-integrated] .pq-frutin-header-quickbuy {
		flex: 0 0 auto;
		width: max-content;
	}
	[data-pq-qb-integrated] .pq-qb-header-action-column .pq-frutin-header-quickbuy .pq-qb-launcher.th-btn {
		flex: 0 0 auto;
		width: max-content !important;
		min-width: 0;
		max-width: none;
		min-height: 48px;
		padding: 12px 20px;
		white-space: nowrap;
		background: #f7bb18;
		border-color: #f7bb18;
		color: #183827;
	}
	[data-pq-qb-integrated] .pq-frutin-header-quickbuy .pq-qb-launcher:hover {
		background: #ffd257;
		border-color: #ffd257;
		color: #183827;
	}
}

@media (min-width: 992px) and (max-width: 1199.98px) {
	[data-pq-qb-integrated] .main-menu > ul {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		column-gap: 16px;
	}
	[data-pq-qb-integrated] .main-menu > ul > li {
		margin-inline: 0;
	}
}

@media (max-width: 991.98px) {
	[data-pq-qb-integrated] .pq-qb-header-row {
		--bs-gutter-x: 0;
		/* Two true mobile columns: logo + actions; no unused 44px phantom track. */
		grid-template-columns: auto minmax(0, 1fr);
		gap: 8px;
		width: 100%;
		margin-inline: 0;
	}
	[data-pq-qb-integrated] .pq-qb-header-row > .col-auto {
		padding-inline: 0;
	}
	[data-pq-qb-integrated] .pq-qb-header-logo-column {
		grid-column: 1;
		grid-row: 1;
	}
	/* Hamburger is inside .header-button, NOT in the separate navigation column. */
	[data-pq-qb-integrated] .pq-qb-header-row > .pq-qb-header-navigation-column {
		display: none;
	}
	[data-pq-qb-integrated] .pq-qb-header-action-column {
		grid-column: 2;
		grid-row: 1;
		justify-self: stretch;
		width: 100%;
	}
	[data-pq-qb-integrated] .pq-qb-header-action-column .header-button {
		width: 100%;
		justify-content: flex-end;
		gap: 8px;
	}
	/* Free space is distributed on both sides of the compact CTA. */
	[data-pq-qb-integrated] .pq-frutin-header-quickbuy {
		flex: 0 1 auto;
		margin-inline: auto;
	}
	[data-pq-qb-integrated] .pq-qb-header-action-column .pq-frutin-header-quickbuy .pq-qb-launcher.th-btn {
		display: inline-flex;
		width: max-content;
		max-width: 100%;
		box-sizing: border-box;
		flex-wrap: nowrap;
		justify-content: center;
		align-items: center;
		gap: 7px;
		min-height: 48px;
		padding: 10px 12px;
		font-size: 0.8125rem;
		white-space: nowrap;
	}
	[data-pq-qb-integrated] .pq-qb-launcher .fa-cart-shopping {
		font-size: 18px;
	}
	/* Icon and text stay centered as ONE unit. */
	[data-pq-qb-integrated] .pq-frutin-header-label {
		flex: 0 1 auto;
		min-width: 0;
		text-align: center;
	}
	/* Restore a real circular Frutin hamburger (no inherited rectangular sizing). */
	[data-pq-qb-integrated] .pq-qb-header-action-column .th-menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 48px;
		width: 48px;
		height: 48px;
		min-width: 48px;
		max-width: 48px;
		min-height: 48px;
		max-height: 48px;
		padding: 0;
		margin: 0;
		border-radius: 50%;
		aspect-ratio: 1;
	}
	[data-pq-qb-integrated] .header-button > .searchBoxToggler {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	/* Only the menu currently handing off to Quick Buy. Completion remains observed. */
	.th-menu-wrapper[data-pq-qb-closing],
	.th-menu-wrapper[data-pq-qb-closing] > .th-menu-area {
		transition-duration: 0s;
	}
}

@media (max-width: 359.98px) {
	[data-pq-qb-integrated="1"] .menu-area > .container {
		padding-inline: 12px;
	}
	[data-pq-qb-integrated="4"] .menu-area {
		margin-inline: 6px;
		padding-inline: 4px;
	}
	[data-pq-qb-integrated] .pq-qb-header-row {
		gap: 6px;
	}
	[data-pq-qb-integrated] .pq-qb-header-action-column .header-button {
		gap: 6px;
	}
	[data-pq-qb-integrated] .pq-qb-header-action-column .pq-frutin-header-quickbuy .pq-qb-launcher.th-btn {
		padding-inline: 8px;
		gap: 5px;
		font-size: 0.75rem;
	}
	[data-pq-qb-integrated] .pq-qb-launcher .fa-cart-shopping {
		font-size: 16px;
	}
}

/* D-ACCESS staging: Frutin header-layout1 places its mobile navigation
   in the navigation column, unlike the homepage layout4. Restore that
   native column without altering the working layout4 header. */
@media (max-width: 991.98px) {
    [data-pq-qb-integrated="1"] .pq-qb-header-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px;
    }

    [data-pq-qb-integrated="1"] .pq-qb-header-row > .pq-qb-header-logo-column {
        grid-column: 1;
        grid-row: 1;
    }

    [data-pq-qb-integrated="1"] .pq-qb-header-row > .pq-qb-header-action-column {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        justify-self: stretch;
    }

    [data-pq-qb-integrated="1"] .pq-qb-header-action-column .header-button {
        justify-content: center;
    }

    [data-pq-qb-integrated="1"] .pq-qb-header-row > .pq-qb-header-navigation-column {
        display: flex;
        grid-column: 3;
        grid-row: 1;
        align-items: center;
        justify-content: flex-end;
        justify-self: end;
        width: auto;
    }

    [data-pq-qb-integrated="1"] .pq-qb-header-navigation-column .th-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        min-width: 48px;
        max-width: 48px;
        min-height: 48px;
        max-height: 48px;
        padding: 0;
        margin: 0;
        border-radius: 50%;
        aspect-ratio: 1;
    }
}


/* P3 follow-up: only a confirmed positive count occupies button space. */
[data-pq-qb-integrated] .pq-qb-header-count-slot {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

[data-pq-qb-integrated] .pq-qb-header-count-slot[hidden] {
	display: none;
}

[data-pq-qb-integrated] .pq-qb-header-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	width: 20px;
	height: 20px;
	padding: 0;
	box-sizing: border-box;
	border-radius: 10px;
	background: #fff;
	color: #183827;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

[data-pq-qb-integrated] .pq-qb-header-count[hidden] {
	display: none;
}

[data-pq-qb-integrated] .pq-qb-header-count-description {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* P34 UI: center visible content; hidden counts have no grid track. */
[data-pq-qb-integrated] .pq-qb-header-action-column .pq-frutin-header-quickbuy .pq-qb-launcher.th-btn {
	display: inline-grid;
	grid-auto-flow: column;
	grid-auto-columns: max-content;
	place-content: center;
	place-items: center;
	box-sizing: border-box;
	text-align: center;
}

[data-pq-qb-integrated] .pq-qb-launcher > .fa-cart-shopping,
[data-pq-qb-integrated] .pq-qb-launcher > .pq-frutin-header-label {
	margin: 0;
	padding: 0;
}

[data-pq-qb-integrated] .pq-qb-launcher > .fa-cart-shopping {
	line-height: 1;
}
