/* ══════════════════════════════════════════════════════════
   Nutraceutic — coque mobile / tablette (style application)
   ══════════════════════════════════════════════════════════ */

:root {
	--nut-header-h: 3.75rem;
	--nut-tabbar-h: 4.25rem;
	--nut-safe-top: env(safe-area-inset-top, 0px);
	--nut-safe-bottom: env(safe-area-inset-bottom, 0px);
	--nut-safe-left: env(safe-area-inset-left, 0px);
	--nut-safe-right: env(safe-area-inset-right, 0px);
	--nut-touch-min: 2.75rem;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	overflow-x: clip;
	max-width: 100%;
}

body {
	-webkit-tap-highlight-color: rgba(57, 181, 74, 0.15);
	overflow-x: clip;
	max-width: 100%;
	width: 100%;
}

.wp-site-blocks {
	max-width: 100%;
	overflow-x: clip;
}

/* ── Barre d’onglets ── */

.nut-tabbar {
	display: none;
}

@media (max-width: 1023px) {
	body.has-nut-tabbar {
		padding-bottom: calc(var(--nut-tabbar-h) + var(--nut-safe-bottom));
	}

	/* Gutenberg alignfull : 100vw déborde souvent → scroll horizontal */
	.alignfull {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		box-sizing: border-box;
	}

	.nut-site-header,
	.nut-footer,
	.nut-shop-banner,
	.nut-page-banner {
		max-width: 100%;
		overflow-x: clip;
	}

	.nut-tabbar {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 180;
		padding-bottom: var(--nut-safe-bottom);
		background: rgba(255, 255, 255, 0.96);
		backdrop-filter: blur(20px) saturate(1.2);
		border-top: 1px solid var(--nut-border, #e4e6f0);
		box-shadow: 0 -4px 24px rgba(5, 10, 94, 0.08);
	}

	body.nut-dark .nut-tabbar {
		background: rgba(3, 7, 64, 0.97);
		border-top-color: rgba(255, 255, 255, 0.1);
		box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.35);
	}

	.nut-tabbar__list {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		list-style: none;
		margin: 0;
		padding: 0.35rem 0.25rem 0.25rem;
		max-width: 640px;
		margin-inline: auto;
	}

	.nut-tabbar__item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 0.2rem;
		min-height: var(--nut-tabbar-h);
		padding: 0.35rem 0.25rem;
		font-family: 'Quicksand', sans-serif;
		font-size: 0.62rem;
		font-weight: 700;
		letter-spacing: 0.02em;
		text-decoration: none;
		color: var(--nut-text-muted, #5a5a6e);
		border-radius: 0.75rem;
		transition: color 0.2s, background 0.2s;
		-webkit-tap-highlight-color: transparent;
		touch-action: manipulation;
	}

	.nut-tabbar__item.is-active {
		color: var(--nut-green, #39b54a);
		background: rgba(57, 181, 74, 0.1);
	}

	body.nut-dark .nut-tabbar__item {
		color: rgba(255, 255, 255, 0.55);
	}

	body.nut-dark .nut-tabbar__item.is-active {
		color: #4ade80;
		background: rgba(57, 181, 74, 0.14);
	}

	.nut-tabbar__icon {
		width: 1.35rem;
		height: 1.35rem;
		flex-shrink: 0;
	}

	.nut-tabbar__label {
		line-height: 1.1;
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* Footer : espace au-dessus de la barre */
	.nut-footer__inner {
		padding-bottom: calc(1.25rem + var(--nut-tabbar-h) + var(--nut-safe-bottom)) !important;
	}

	/* Chatbot / FAB plugin */
	.nut-chatbot {
		right: max(0.75rem, env(safe-area-inset-right, 0px));
		max-width: calc(100vw - 1.5rem);
	}

	.nut-chatbot__panel {
		width: min(380px, calc(100vw - 2.5rem)) !important;
	}

	.nut-chatbot-fab,
	.nut-chat-fab {
		bottom: calc(var(--nut-tabbar-h) + var(--nut-safe-bottom) + 0.75rem) !important;
	}
}

/* ── Cibles tactiles globales ── */

@media (max-width: 1023px) {
	.nut-btn,
	.nut-shop-card__btn,
	.nut-contact__form button[type="submit"],
	.woocommerce button.button,
	.woocommerce a.button {
		min-height: var(--nut-touch-min);
		touch-action: manipulation;
	}

	.nut-dark-toggle,
	.nut-nav-toggle {
		min-width: var(--nut-touch-min);
		min-height: var(--nut-touch-min);
		touch-action: manipulation;
	}

	.nut-blog__pagination .page-numbers,
	.nut-blog__pagination a {
		min-width: var(--nut-touch-min);
		min-height: var(--nut-touch-min);
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	input[type="text"],
	input[type="email"],
	input[type="tel"],
	input[type="number"],
	input[type="search"],
	input[type="password"],
	select,
	textarea {
		font-size: 16px;
	}
}

/* ── Contenu intérieur ── */

@media (max-width: 767px) {
	.nut-inner-page__content {
		padding-left: max(1rem, var(--nut-safe-left));
		padding-right: max(1rem, var(--nut-safe-right));
	}

	.nut-shop-page__body,
	.nut-wc-page__body {
		padding-left: max(1rem, var(--nut-safe-left));
		padding-right: max(1rem, var(--nut-safe-right));
	}
}

/* ── Scroll fluide iOS ── */

@media (max-width: 1023px) {
	.nut-nav__list,
	.nut-inner-page__body,
	.nut-shop-page__wrap {
		-webkit-overflow-scrolling: touch;
	}
}

body.nut-nav-open {
	overflow: hidden;
	position: fixed;
	width: 100%;
}
