/**
 * FullDip deterministic commerce header.
 * Used only on single-product and shop/archive contexts.
 */

.ssf-commerce-header {
	position: relative;
	z-index: 100;
	width: 100%;
	background: #fff;
	border-bottom: 1px solid #ececec;
}

.ssf-commerce-header__inner {
	display: grid;
	grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
	align-items: center;
	gap: 32px;
	width: min(1220px, calc(100% - 40px));
	min-height: 72px;
	margin-inline: auto;
}

.ssf-commerce-header__brand,
.ssf-commerce-header__brand .custom-logo-link {
	display: inline-flex;
	align-items: center;
	width: fit-content;
}

.ssf-commerce-header__brand img,
.ssf-commerce-header__brand .custom-logo {
	display: block;
	width: auto;
	max-width: 150px;
	max-height: 58px;
	object-fit: contain;
}

.ssf-commerce-header__nav {
	justify-self: center;
	min-width: 0;
}

.ssf-commerce-header__menu,
.ssf-commerce-header__menu ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ssf-commerce-header__menu {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(20px, 2.4vw, 34px);
}

.ssf-commerce-header__menu > li {
	position: relative;
	margin: 0;
}

.ssf-commerce-header__menu a {
	display: inline-flex;
	align-items: center;
	min-height: 72px;
	padding: 0;
	color: #111;
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.ssf-commerce-header__menu a:hover,
.ssf-commerce-header__menu a:focus-visible {
	color: #c83224;
}

.ssf-commerce-header__menu .sub-menu {
	position: absolute;
	top: calc(100% - 8px);
	left: -16px;
	display: none;
	min-width: 190px;
	padding: 10px 16px;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, .1);
}

.ssf-commerce-header__menu li:hover > .sub-menu,
.ssf-commerce-header__menu li:focus-within > .sub-menu {
	display: block;
}

.ssf-commerce-header__menu .sub-menu a {
	min-height: 38px;
	font-size: 11px;
}

.ssf-commerce-header__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 15px;
}

.ssf-commerce-header__action,
.ssf-commerce-search > summary {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 40px;
	padding: 0;
	color: #111;
	cursor: pointer;
	list-style: none;
}

.ssf-commerce-search > summary::-webkit-details-marker,
.ssf-commerce-mobile-menu > summary::-webkit-details-marker {
	display: none;
}

.ssf-commerce-header__action svg,
.ssf-commerce-search svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ssf-commerce-header__cart-count {
	position: absolute;
	top: 2px;
	right: -8px;
	display: grid;
	place-items: center;
	min-width: 17px;
	height: 17px;
	padding-inline: 4px;
	border-radius: 999px;
	background: #e10600;
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
}

.ssf-commerce-search {
	position: relative;
}

.ssf-commerce-search__panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: min(480px, calc(100vw - 32px));
	padding: 12px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}

.ssf-commerce-search__panel form {
	margin: 0;
}

.ssf-commerce-search__panel label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 700;
}

.ssf-commerce-search__field {
	display: flex;
	gap: 8px;
}

.ssf-commerce-search__field input[type="search"] {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 7px;
	font-size: 16px;
}

.ssf-commerce-search__field button {
	min-height: 44px;
	padding: 8px 14px;
	border: 0;
	border-radius: 7px;
	background: #c83224;
	color: #fff;
	cursor: pointer;
}

.ssf-commerce-search__status {
	margin: 10px 2px 4px;
	color: #555;
	font-size: 13px;
}

.ssf-commerce-search__results {
	max-height: min(400px, 55vh);
	overflow-y: auto;
}

.ssf-commerce-search__result {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 68px;
	padding: 8px;
	border-radius: 7px;
	color: #171717;
	text-decoration: none;
}

.ssf-commerce-search__result:hover,
.ssf-commerce-search__result:focus-visible {
	background: #f6f6f6;
	outline: 2px solid #c83224;
}

.ssf-commerce-search__result img {
	width: 52px;
	height: 52px;
	object-fit: contain;
}

.ssf-commerce-search__result-body {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.ssf-commerce-search__result-body strong,
.ssf-commerce-search__result-body small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ssf-commerce-search__result-body small {
	color: #555;
}

/* Kadence's search drawer is used on the homepage and other content pages. */
#search-drawer .drawer-overlay {
	background: rgba(10, 13, 17, .72);
}

#search-drawer .drawer-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	box-sizing: border-box;
	width: 100%;
	max-height: 100vh;
	padding: clamp(90px, 16vh, 180px) 20px 32px;
	overflow-y: auto;
}

#search-drawer .drawer-content::before {
	content: 'Cerca nel catalogo';
	width: min(100%, 760px);
	margin-bottom: 18px;
	color: #fff;
	font-size: clamp(22px, 3vw, 30px);
	font-weight: 800;
	line-height: 1.2;
}

#search-drawer form.search-form {
	box-sizing: border-box;
	width: min(100%, 760px);
	max-width: 760px;
	margin: 0;
	padding: 8px 12px;
	border: 0;
	border-radius: 12px 12px 0 0;
	background: #fff;
	box-shadow: 0 16px 40px rgba(0, 0, 0, .2);
}

#search-drawer form.search-form input[name='s'] {
	min-height: 52px;
	border: 0;
	background: #fff;
	color: #171717;
	font-size: 19px;
	box-shadow: none;
}

#search-drawer form.search-form input[name='s']::placeholder {
	color: #727272;
}

#search-drawer form.search-form ~ .ssf-commerce-search__status,
#search-drawer form.search-form ~ .ssf-commerce-search__results {
	box-sizing: border-box;
	width: min(100%, 760px);
	margin-inline: auto;
	background: #fff;
}

#search-drawer form.search-form ~ .ssf-commerce-search__status {
	margin: 0;
	padding: 10px 22px;
	border-top: 1px solid #eee;
	color: #555;
}

#search-drawer form.search-form ~ .ssf-commerce-search__results {
	max-height: min(400px, 50vh);
	padding: 0 12px 10px;
	border-radius: 0 0 12px 12px;
}

#search-drawer .ssf-commerce-search__result {
	color: #171717;
}

@media (max-width: 600px) {
	#search-drawer .drawer-content {
		padding: 86px 14px 24px;
	}

	#search-drawer form.search-form input[name='s'] {
		font-size: 16px;
	}
}

.ssf-commerce-mobile-menu {
	display: none;
	position: relative;
}

.ssf-commerce-mobile-menu > summary {
	display: grid;
	gap: 4px;
	width: 28px;
	padding: 6px 3px;
	cursor: pointer;
	list-style: none;
}

.ssf-commerce-mobile-menu > summary span {
	display: block;
	width: 22px;
	height: 2px;
	background: #111;
	border-radius: 2px;
}

.ssf-commerce-mobile-menu__panel {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	width: min(300px, calc(100vw - 32px));
	padding: 12px 18px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}

.ssf-commerce-mobile-menu__list,
.ssf-commerce-mobile-menu__list ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ssf-commerce-mobile-menu__list a {
	display: block;
	padding: 11px 0;
	color: #111;
	font-size: 13px;
	font-weight: 800;
	text-decoration: none;
	text-transform: uppercase;
}

.ssf-commerce-mobile-menu__list .sub-menu {
	padding-left: 14px;
}

body.ssf-commerce-shell .ssf-product-breadcrumb-section {
	margin-top: 0;
}

@media (max-width: 900px) {
	.ssf-commerce-search__panel {
		position: fixed;
		top: 64px;
		right: 14px;
		left: 14px;
		width: auto;
	}

	.ssf-commerce-header__inner {
		grid-template-columns: auto 1fr;
		gap: 18px;
		width: min(100% - 28px, 1220px);
		min-height: 64px;
	}

	.ssf-commerce-header__brand img,
	.ssf-commerce-header__brand .custom-logo {
		max-width: 128px;
		max-height: 50px;
	}

	.ssf-commerce-header__nav {
		display: none;
	}

	.ssf-commerce-header__actions {
		justify-self: end;
	}

	.ssf-commerce-mobile-menu {
		display: block;
	}
}

@media (max-width: 520px) {
	.ssf-commerce-search__panel {
		top: 58px;
	}

	.ssf-commerce-header__inner {
		min-height: 58px;
	}

	.ssf-commerce-header__brand img,
	.ssf-commerce-header__brand .custom-logo {
		max-width: 108px;
	}

	.ssf-commerce-header__actions {
		gap: 10px;
	}
}


/* Cart-only visual scale: keep shared shop and product headers unchanged. */
body.ssf-commerce-shell.woocommerce-cart .ssf-commerce-header__actions {
	gap: 16px;
}

body.ssf-commerce-shell.woocommerce-cart .ssf-commerce-header__action,
body.ssf-commerce-shell.woocommerce-cart .ssf-commerce-search > summary {
	width: 32px;
	height: 44px;
}

body.ssf-commerce-shell.woocommerce-cart .ssf-commerce-header__action svg,
body.ssf-commerce-shell.woocommerce-cart .ssf-commerce-search svg {
	width: 25px;
	height: 25px;
}

body.ssf-commerce-shell.woocommerce-cart .ssf-commerce-header__cart-count {
	top: 1px;
	right: -7px;
	min-width: 18px;
	height: 18px;
	font-size: 11px;
}
