/**
 * TS Printify — solo telefono/tablet stretto (desktop invariato da 769px).
 */
@media (max-width: 768px) {
	body.mishirto-has-printify-mobile #pp-popup-overlay {
		align-items: stretch !important;
		justify-content: stretch !important;
		padding: 0 !important;
		overflow: hidden !important;
	}

	body.mishirto-has-printify-mobile #pp-popup-wrapper {
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		min-height: 100dvh;
		display: flex;
		flex-direction: column;
	}

	body.mishirto-has-printify-mobile #pp-popup-container {
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		border-radius: 0 !important;
		max-height: 100dvh !important;
		height: 100dvh !important;
		padding: 0 !important;
		box-shadow: none !important;
	}

	body.mishirto-has-printify-mobile #pp-popup-inner-scroll {
		flex: 1 1 auto;
		min-height: 0;
		overflow-x: hidden !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		padding: 12px 12px calc(120px + env(safe-area-inset-bottom, 0px)) !important;
	}

	body.mishirto-has-printify-mobile #pp-popup-container .pp-plugin-top-banner {
		border-radius: 0 !important;
		flex-wrap: wrap;
		padding: 8px 12px !important;
	}

	body.mishirto-has-printify-mobile #pp-popup-container .pp-step-titles {
		position: sticky;
		top: 0;
		z-index: 12;
		background: #fff;
		padding: 8px 0 10px !important;
		margin: 0 0 10px !important;
		box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
	}

	body.mishirto-has-printify-mobile #pp-popup-container .pp-step-title-item {
		min-height: 36px;
		padding: 8px 12px !important;
		font-size: 13px !important;
	}

	/* Riepilogo laterale: nascosto, sostituito dalla barra sticky mobile. */
	body.mishirto-has-printify-mobile.pp-mobile-configurator-active #pp-step-unico .pp-summary-card,
	body.mishirto-has-printify-mobile.pp-mobile-configurator-active #pp-step3-upload-phase .pp-recap-column,
	body.mishirto-has-printify-mobile.pp-mobile-configurator-active #pp-step4-wrap .pp-recap-panel,
	body.mishirto-has-printify-mobile.pp-mobile-configurator-active .pp-step3-mobile-sticky {
		display: none !important;
	}

	/* Barra sticky unificata (iniettata dal child theme). */
	body.mishirto-has-printify-mobile #pp-mobile-configurator-sticky {
		display: none;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 10001;
		background: rgba(255, 255, 255, 0.98);
		border-top: 1px solid #cfe2ab;
		box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
		backdrop-filter: blur(8px);
	}

	body.mishirto-has-printify-mobile.pp-mobile-configurator-active #pp-mobile-configurator-sticky.is-visible {
		display: block;
	}

	body.mishirto-has-printify-mobile .pp-mobile-sticky-row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		font-size: 13px;
		color: #3e531d;
	}

	body.mishirto-has-printify-mobile .pp-mobile-sticky-total strong {
		font-size: 18px;
		font-weight: 900;
		color: #245d11;
	}

	body.mishirto-has-printify-mobile .pp-mobile-recap-open {
		display: block;
		width: 100%;
		margin-top: 6px;
		padding: 4px 0;
		border: 0;
		background: transparent;
		color: #97b04e;
		font-size: 13px;
		font-weight: 600;
		text-decoration: underline;
		cursor: pointer;
		text-align: left;
	}

	body.mishirto-has-printify-mobile .pp-mobile-sticky-buttons {
		display: flex;
		gap: 10px;
		margin-top: 10px;
		padding-top: 10px;
		border-top: 1px solid #e3ebd4;
	}

	body.mishirto-has-printify-mobile .pp-mobile-sticky-buttons .pp-cta-btn {
		flex: 1 1 0;
		min-height: 46px !important;
		font-size: 14px !important;
		font-weight: 700 !important;
	}

	/* Sheet riepilogo mobile. */
	body.mishirto-has-printify-mobile #pp-mobile-recap-sheet {
		display: none;
		position: fixed;
		inset: 0;
		z-index: 10002;
	}

	body.mishirto-has-printify-mobile #pp-mobile-recap-sheet.is-open {
		display: block;
	}

	body.mishirto-has-printify-mobile #pp-mobile-recap-sheet .pp-mobile-recap-backdrop {
		position: absolute;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		border: 0;
		padding: 0;
	}

	body.mishirto-has-printify-mobile #pp-mobile-recap-sheet .pp-mobile-recap-panel {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		max-height: 78vh;
		overflow: auto;
		background: #fff;
		border-radius: 16px 16px 0 0;
		padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
		box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
	}

	body.mishirto-has-printify-mobile #pp-mobile-recap-sheet .pp-mobile-recap-close {
		float: right;
		border: 0;
		background: #f3f6ec;
		color: #3e531d;
		border-radius: 8px;
		padding: 6px 10px;
		font-weight: 700;
		cursor: pointer;
	}

	/* Tabella taglie: scroll orizzontale + prima colonna fissa. */
	body.mishirto-has-printify-mobile #pp-step-unico .pp-qty-table-wrap {
		max-height: none !important;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
		border: 1px solid #e3ebd4;
		border-radius: 10px;
	}

	body.mishirto-has-printify-mobile #pp-step-unico .pp-qty-table {
		min-width: 520px;
	}

	body.mishirto-has-printify-mobile #pp-step-unico .pp-qty-table thead th:first-child,
	body.mishirto-has-printify-mobile #pp-step-unico .pp-qty-table tbody td:first-child {
		position: sticky;
		left: 0;
		z-index: 2;
		background: #fff;
		box-shadow: 2px 0 0 rgba(0, 0, 0, 0.04);
		min-width: 148px !important;
		width: 148px !important;
	}

	body.mishirto-has-printify-mobile #pp-step-unico .pp-qty-table thead th:first-child {
		background: #f4f8ec;
		z-index: 3;
	}

	body.mishirto-has-printify-mobile #pp-step-unico .pp-qty-table .pp-color-variant-thumb {
		width: 52px !important;
		height: 52px !important;
	}

	body.mishirto-has-printify-mobile #pp-step-unico .pp-qty-table input[type="number"],
	body.mishirto-has-printify-mobile #pp-step-unico .pp-qty-table input[type="text"] {
		min-height: 40px;
		font-size: 16px !important;
	}

	/* Step 3: card opzioni più compatte e touch-friendly. */
	body.mishirto-has-printify-mobile #pp-step3 .pp-step3-option-switch {
		grid-template-columns: 1fr !important;
		gap: 10px !important;
	}

	body.mishirto-has-printify-mobile #pp-step3 .pp-step3-option-btn {
		min-height: 72px !important;
	}

	body.mishirto-has-printify-mobile #pp-step-midocean-positions-wrap .pp-mo-unified-card {
		min-width: 160px;
		width: 72vw;
		max-width: 280px;
	}

	/* Modali full-screen friendly. */
	body.mishirto-has-printify-mobile #pp-variant-preview-popup,
	body.mishirto-has-printify-mobile #pp-graphic-crop-modal,
	body.mishirto-has-printify-mobile #pp-product-specs-modal,
	body.mishirto-has-printify-mobile #pp-stock-variant-modal {
		padding: 8px !important;
		align-items: flex-end !important;
	}

	body.mishirto-has-printify-mobile #pp-product-specs-modal > div,
	body.mishirto-has-printify-mobile #pp-variant-preview-popup .pp-variant-preview-popup-inner,
	body.mishirto-has-printify-mobile #pp-stock-variant-modal > div {
		max-height: 92dvh !important;
		border-radius: 14px 14px 0 0 !important;
	}

	body.mishirto-has-printify-mobile #pp-product-specs-modal [style*="grid-template-columns"] {
		grid-template-columns: 1fr !important;
	}

	/* Pagina prodotto: tier box più leggibile su telefono. */
	body.mishirto-has-printify-mobile.single-product .pp-tier-cards {
		grid-template-columns: 1fr !important;
	}

	body.mishirto-has-printify-mobile.single-product .pp-tier-cta-row {
		grid-template-columns: 1fr !important;
	}

	body.mishirto-has-printify-mobile.single-product .pp-open-popup-btn,
	body.mishirto-has-printify-mobile.single-product .pp-loop-cta-btn {
		min-height: 48px;
		font-size: 16px;
	}
}
