/* Enhancements to the native mobile template. The same HTML is safe to cache at all widths. */
.atzori-quick, .atzori-mobile-kind, .atzori-sheet-title { display: none; }

/* Keep Smart Slider's pause button inside the hero on larger screens as well. */
@media (min-width: 761px) {
	.atzori-header-theme .atzori-promozioni .n2-ss-slider-controls-absolute-right {
		inset: auto 24px 22px auto !important;
	}
	.atzori-header-theme .atzori-promozioni .nextend-autoplay { margin: 0 !important; }
}

@media (max-width: 760px) {
	.atzori-header-theme {
		--mobile-cream: #fff7e8;
		--mobile-ink: #302e2b;
		--mobile-orange: #d77a36;
		--mobile-foot: calc(66px + env(safe-area-inset-bottom, 0px));
	}
	html:has(.atzori-mobile-bar) { scroll-padding-bottom: 84px; }
	.atzori-header-theme:has(.atzori-mobile-bar) .wp-site-blocks { padding-bottom: var(--mobile-foot); }
	.atzori-header-theme .atzori-header-search .wp-block-search__input {
		line-height: 1.3;
		text-overflow: ellipsis;
	}
	.atzori-header-theme .atzori-header-shell:has(.atzori-quick) .atzori-header-categories {
		padding: 6px max(4%,env(safe-area-inset-right)) 6px max(4%,env(safe-area-inset-left));
	}
	.atzori-header-categories:has(.atzori-quick) .mega-menu-wrap { display: none !important; }
	.atzori-quick { display: block; position: relative; color: var(--mobile-ink); }
	.atzori-quick-links {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		overscroll-behavior-inline: contain;
		scrollbar-width: none;
		padding: 4px 2px 8px;
	}
	.atzori-quick-links::-webkit-scrollbar { display: none; }
	.atzori-quick-links > a {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: none;
		box-sizing: border-box;
		min-height: 44px;
		padding: 8px 14px;
		border-radius: 999px;
		background: var(--mobile-cream);
		color: var(--mobile-ink);
		font-size: 12px;
		font-weight: 700;
		line-height: 1.2;
		text-decoration: none;
		white-space: nowrap;
	}
	.atzori-quick-links > a[aria-expanded="true"] { background: var(--mobile-orange); }
	.atzori-regioni:not([hidden]) {
		display: block;
		position: absolute;
		z-index: 2;
		inset: 100% 0 auto;
		box-sizing: border-box;
		max-height: min(52dvh,360px);
		overflow-y: auto;
		overscroll-behavior: contain;
		padding: 16px;
		background: var(--mobile-cream);
		border: 1px solid #e6d9c5;
		border-radius: 16px;
		box-shadow: 0 12px 30px #100b0633;
	}
	.atzori-regioni-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
	.atzori-regioni-links a {
		display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--mobile-ink);
		background: #fbf1e2; border: 1px solid #e6d9c5; border-radius: 18px; font-size: 13px; text-decoration: none;
	}
	.atzori-quick a:focus-visible, .atzori-mobile-bar :is(a,button):focus-visible { outline: 2px solid #a65d24; outline-offset: -2px; }

	/* Keep the saved editor links and the core/navigation overlay. */
	.atzori-header-theme .atzori-mobile-bar {
		--mobile-home-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23302e2b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 10 9-7 9 7v11h-6v-7H9v7H3z'/%3E%3C/svg%3E");
		--mobile-menu-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23302e2b' stroke-width='1.7'%3E%3Crect x='4' y='3' width='16' height='4' rx='1'/%3E%3Crect x='4' y='10' width='16' height='4' rx='1'/%3E%3Crect x='4' y='17' width='16' height='4' rx='1'/%3E%3C/svg%3E");
		--mobile-cart-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23302e2b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h3l3 12h11l3-8H6'/%3E%3Ccircle cx='9' cy='20' r='1'/%3E%3Ccircle cx='18' cy='20' r='1'/%3E%3C/svg%3E");
		--mobile-account-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23302e2b' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21v-2a8 8 0 0 1 16 0v2'/%3E%3C/svg%3E");
		--mobile-offers-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23302e2b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h10l9 9-10 10-9-9zM10 16l6-6'/%3E%3Ccircle cx='8' cy='8' r='1'/%3E%3C/svg%3E");
		position: fixed;
		inset: auto 0 0;
		z-index: 75;
		box-sizing: border-box;
		display: grid;
		grid-template-columns: repeat(5,minmax(0,1fr));
		align-items: end;
		gap: 0;
		height: var(--mobile-foot);
		margin: 0 !important;
		padding: 4px max(4%,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(4%,env(safe-area-inset-left)) !important;
		color: var(--mobile-ink) !important;
		background: var(--mobile-cream) !important;
		border-top: 1px solid #e9dfd0;
		box-shadow: 0 -4px 18px #2819120b;
	}
	.atzori-mobile-bar > :is(.wp-block-buttons,nav), .atzori-mobile-bar > .wp-block-buttons > .wp-block-button { display: block; width: 100%; margin: 0; min-width: 0; }
	.atzori-mobile-bar .wp-block-button__link, .atzori-mobile-bar .wp-block-navigation__responsive-container-open {
		display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px;
		position: relative; box-sizing: border-box; width: 100%; min-height: 48px; margin: 0;
		padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
		background: transparent !important; color: var(--mobile-ink) !important;
		font-family: inherit; font-size: 11px !important; font-weight: 500 !important; line-height: 1.2; text-decoration: none;
	}
	.atzori-mobile-bar .wp-block-button__link::before, .atzori-mobile-bar .wp-block-navigation__responsive-container-open::before {
		content: ''; display: block; width: 23px; height: 23px; background: var(--shortcut-icon) center / 23px no-repeat;
	}
	.atzori-shortcut-home { --shortcut-icon: var(--mobile-home-icon); }
	.atzori-mobile-bar .wp-block-navigation__responsive-container-open { --shortcut-icon: var(--mobile-menu-icon); }
	.atzori-shortcut-account { --shortcut-icon: var(--mobile-account-icon); }
	.atzori-shortcut-offers { --shortcut-icon: var(--mobile-offers-icon); }
	.atzori-mobile-bar .atzori-shortcut-cart { --shortcut-icon: var(--mobile-cart-icon); color: #875018 !important; font-weight: 700 !important; }
	.atzori-mobile-bar .atzori-shortcut-cart::before {
		position: absolute; bottom: 16px; box-sizing: border-box; width: 58px; height: 58px;
		background-color: var(--mobile-orange); background-size: 27px; border: 4px solid var(--mobile-cream); border-radius: 50%;
	}
	.atzori-cart-quantity:not([hidden]) {
		position: absolute; bottom: 52px; left: calc(50% + 8px); display: grid; place-items: center; min-width: 20px; height: 20px;
		padding: 0 3px; box-sizing: border-box; border: 2px solid var(--mobile-cream); border-radius: 12px; background:#302e2b; color:white; font-size:10px;
	}
	.atzori-mobile-bar .wp-block-navigation__responsive-container.is-menu-open {
		display: flex; flex-direction: column; justify-content: flex-end; padding: 0; color: var(--mobile-ink) !important;
		background: #21141699 !important; backdrop-filter: blur(3px);
	}
	.atzori-mobile-bar .wp-block-navigation__responsive-close {
		width: min(100%,560px); box-sizing: border-box; max-width: 100%; max-height: 75dvh; margin: 0 auto;
		padding: 20px max(20px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));
		overflow-y: auto; background: var(--mobile-cream); border-radius: 22px 22px 0 0;
	}
	.atzori-mobile-bar .wp-block-navigation__responsive-dialog { margin: 0 !important; }
	.atzori-mobile-bar .atzori-sheet-title { display: block; margin: 0 0 18px; font: 700 22px/1.4 var(--wp--preset--font-family--dm-sans,sans-serif); }
	.atzori-mobile-bar .wp-block-navigation__responsive-container-close { inset: -6px 0 auto auto; min-width:44px; min-height:44px; color:#784516; font-size:0 !important; }
	.atzori-mobile-bar .wp-block-navigation__responsive-container-close::before { content: '×'; font-size:26px; }
	.atzori-mobile-bar .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding: 0; align-items: stretch; }
	.atzori-mobile-bar .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
		width:100%; display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px !important; align-items:stretch !important;
	}
	.atzori-mobile-bar .wp-block-navigation__responsive-container-content .wp-block-navigation-item { display: block; width:100%; min-width:0; }
	.atzori-mobile-bar .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
		display:grid; place-items:center; box-sizing:border-box; width:100%; min-height:44px; padding:8px !important; border:1px solid #e6d9c5;
		border-radius:12px; color:var(--mobile-ink); background:#fbf1e2; font-size:14px; text-align:center; text-decoration:none;
	}

	/* Smart Slider retains its CMS content, responsive images, gestures and controls. */
	.atzori-header-theme .atzori-promozioni {
		--campaign-nav: calc(var(--atzori-header-height,122px) + var(--atzori-category-height,68px));
		--campaign-photo: clamp(270px,78vw,390px);
		--campaign-copy-top: calc(var(--campaign-nav) + var(--campaign-photo) - 8px);
		background: #0b0805;
	}
	.atzori-header-theme .atzori-promozioni .n2-ss-section-main-content {
		box-sizing: border-box; align-items: flex-start !important; justify-content: flex-start !important;
		padding: var(--campaign-copy-top) max(24px,env(safe-area-inset-right)) 106px max(24px,env(safe-area-inset-left)) !important;
		text-align: left;
	}
	.atzori-header-theme .atzori-promozioni .n2-ss-layer[data-sstype="layer"] { align-self: flex-start !important; width: auto !important; max-width: 100% !important; margin: 0 !important; }
	.atzori-header-theme .atzori-promozioni .n2-ss-slide-background { background: #0b0805 !important; }
	.atzori-header-theme .atzori-promozioni .n2-ss-slide-background-image {
		inset: var(--campaign-nav) 0 auto !important; width: 100% !important; height: var(--campaign-photo) !important;
		mask-image: linear-gradient(#000 82%,transparent);
	}
	.atzori-header-theme .atzori-promozioni .n2-ss-slide-background-image :is(picture,img) { width:100% !important; height:100% !important; }
	.atzori-header-theme .atzori-promozioni .n2-ss-slide-background-image img { object-fit:cover !important; object-position:right center !important; }
	.atzori-header-theme .atzori-promozioni .n2-ss-slide-background-color { background: linear-gradient(180deg,#0003,transparent 30%,transparent 65%,#100b0630) !important; }
	.atzori-header-theme .atzori-promozioni [data-sstype="layer"]:first-child .n2-ss-text {
		font:700 12px/1.5 var(--wp--preset--font-family--dm-sans,sans-serif) !important; letter-spacing:.12em !important; color:#e5bb83 !important; margin-bottom:12px;
	}
	.atzori-header-theme .atzori-promozioni [data-first] [data-sstype="layer"]:first-child .n2-ss-text { text-transform:lowercase !important; }
	.atzori-header-theme .atzori-promozioni [data-first] [data-sstype="layer"]:first-child .n2-ss-text::first-letter { text-transform:uppercase; }
	.atzori-header-theme .atzori-promozioni [data-sstype="layer"]:nth-child(2) .n2-ss-text {
		font-size:clamp(30px,7.8vw,45px) !important; line-height:1.06 !important; letter-spacing:-.035em !important; color:#fff7e8 !important;
	}
	.atzori-header-theme .atzori-promozioni [data-first] [data-sstype="layer"]:nth-child(2) .n2-ss-text {
		font:400 clamp(35px,9.5vw,58px)/1.06 Georgia,serif !important; letter-spacing:-.02em !important;
	}
	.atzori-header-theme .atzori-promozioni [data-sstype="layer"]:nth-child(3) p {
		max-width:27ch; margin:14px 0 22px !important; font-size:18px !important; line-height:1.45 !important; color:#fff7e8 !important;
	}
	.atzori-header-theme .atzori-promozioni .n2-ss-button-container a { min-height:48px; box-sizing:border-box; display:inline-flex; align-items:center; padding:12px 24px !important; }
	.atzori-header-theme .atzori-promozioni .n2-ss-button-container a div { font-size:14px !important; line-height:1.4 !important; }
	.atzori-header-theme .atzori-promozioni .n2-ss-slider-controls-side { position:relative; width:100%; }
	.atzori-header-theme .atzori-promozioni .n2-ss-slider-controls-absolute-right {
		position:absolute !important; inset:auto 0 0 !important; width:100% !important; height:48px; margin:0 !important; pointer-events:none;
	}
	.atzori-header-theme .atzori-promozioni .nextend-autoplay {
		position:absolute !important; inset:auto auto 3px calc(50% + 65px) !important; display:grid !important; place-items:center;
		width:42px !important; height:42px !important; padding:10px !important; box-sizing:border-box; margin:0 !important; transform:none !important; pointer-events:auto;
	}
	.atzori-header-theme .atzori-promozioni :is(.n2-ss-slider-controls-absolute-left-center,.n2-ss-slider-controls-absolute-right-center) {
		inset:auto auto 4px calc(50% - 112px) !important; width:44px !important; height:44px !important; transform:none !important;
	}
	.atzori-header-theme .atzori-promozioni .n2-ss-slider-controls-absolute-right-center { left:calc(50% + 28px) !important; }
	.atzori-header-theme .atzori-promozioni .nextend-arrow { margin:0 !important; min-width:44px; min-height:44px; display:grid; place-items:center; }
	.atzori-header-theme .atzori-promozioni .n2-ss-control-bullet { margin:0 0 18px !important; }

	/* Match the original discovery cards and compact two-column product list. */
	.home .entry-content > .wp-block-group:has(> .atzori-discovery-cards) { padding:16px 4% !important; }
	.home .atzori-discovery-cards { gap:12px !important; }
	.home .atzori-discovery-cards .atzori-promo-card { min-height:0 !important; border-radius:22px !important; gap:14px; padding:24px !important; }
	.home .atzori-discovery-cards .atzori-promo-copy { align-items:flex-start; gap:4px; }
	.home .atzori-discovery-cards .atzori-promo-copy > :is(h2,p) { text-align:left !important; }
	.home .atzori-discovery-cards .wp-block-buttons { justify-content:flex-end; }
	.atzori-header-theme .wp-block-group:has(> .atzori-catalog-collection) { padding-inline:4% !important; }
	.atzori-header-theme .atzori-product-cards.wc-block-product-template__responsive {
		display:grid; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:10px !important;
	}
	.atzori-header-theme .atzori-product-cards > .wc-block-product { margin:0; width:auto !important; min-width:0; }
	.atzori-product-cards .wc-block-product > .wp-block-group > .wp-block-group { display:flex; flex-direction:column; gap:3px; }
	.atzori-product-cards .atzori-mobile-kind { display:block; order:-3; color:#844412; font-size:12px; font-weight:700; }
	.atzori-product-cards .wp-block-post-title { order:-2; margin:0 !important; font-size:clamp(14px,3.7vw,18px) !important; line-height:1.2 !important; overflow-wrap:anywhere; }
	.atzori-product-cards .taxonomy-pa_formato { order:-1; }
	.atzori-product-cards :is(.taxonomy-pa_produttore,.taxonomy-pa_formato) { margin:0 !important; font-size:12px !important; line-height:1.25; }
	.atzori-product-cards .wc-block-components-product-summary { font-size:12px !important; }
	.atzori-product-cards .wp-block-woocommerce-product-button :is(button,a.wp-block-button__link) {
		min-height:44px; width:100%; box-sizing:border-box; background:var(--mobile-orange) !important; color:#24170d !important;
		border-radius:30px !important; padding:8px !important; line-height:1.2; overflow-wrap:anywhere;
	}
	.atzori-header-theme .wp-block-navigation__responsive-container.is-menu-open { z-index:100000; }
	.atzori-header-theme .wc-block-components-drawer__screen-overlay--is-hidden { visibility:hidden; }
}
@media (max-width:350px) {
	.atzori-header-theme .atzori-product-cards.wc-block-product-template__responsive { grid-template-columns: minmax(0,1fr) !important; }
}
