/**
 * Eureka — poprawki responsywności (mobile / tablet).
 * Uzupełnia main.css — globalne, bez nadpisywania layoutu desktop.
 */

/* Brak poziomego przewijania (100vw w backdrop też psuje iOS) */
html {
	overflow-x: clip;
}

@supports not (overflow-x: clip) {
	html {
		overflow-x: hidden;
	}
}

#page.site {
	max-width: 100%;
	overflow-x: clip;
}

.offcanvas-backdrop,
.modal-backdrop {
	width: 100%;
	max-width: 100%;
}

/* Safe area (viewport-fit=cover w header.php) */
.eureka-site-header > .container-eureka {
	padding-left: max(1rem, env(safe-area-inset-left, 0px));
	padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

/* --- Nagłówek: węższe ekrany --- */
@media (max-width: 575.98px) {
	.eureka-site-header > .container-eureka {
		padding-top: 0.5rem;
		padding-bottom: 0.5rem;
	}

	.eureka-site-header [role="toolbar"] {
		gap: 0.25rem !important;
	}

	.eureka-site-header [role="toolbar"] .badge {
		font-size: 0.5rem;
		padding: 0.12em 0.35em;
	}

	.eureka-site-header .eureka-logo--image .eureka-logo__img {
		--eureka-header-logo-height: 2rem;
		max-width: min(100%, 9.5rem);
	}

	#eurekaMobileNav.offcanvas {
		width: min(100%, 20rem);
	}
}

/* --- Typografia nagłówków sekcji --- */
@media (max-width: 991.98px) {
	.site-main .display-6,
	.font-display.display-6 {
		font-size: clamp(1.35rem, 4vw + 0.65rem, 2rem);
		line-height: 1.2;
		word-break: break-word;
	}

	.site-main .display-5 {
		font-size: clamp(1.45rem, 4.5vw + 0.5rem, 2.35rem);
		line-height: 1.15;
	}
}

/* --- Badge / lead --- */
@media (max-width: 575.98px) {
	.badge-pill {
		white-space: normal;
		text-align: center;
		justify-content: center;
		max-width: 100%;
		line-height: 1.35;
	}

	.site-main section .lead.text-secondary {
		font-size: 0.9375rem;
		line-height: 1.55;
	}
}

/* --- CTA: pełna szerokość przycisków --- */
@media (max-width: 575.98px) {
	.eureka-hero-cta,
	.eureka-inner-hero-ctas {
		flex-direction: column;
		align-items: stretch !important;
	}

	.eureka-hero-cta .btn,
	.eureka-inner-hero-ctas .btn,
	.eureka-front-final-cta .eureka-hero-cta .btn {
		width: 100%;
		max-width: 100%;
		justify-content: center;
	}

	.eureka-front-final-cta {
		padding: 1.25rem 1rem !important;
		border-radius: 1.25rem !important;
	}
}

/* --- Hero: chipy i media --- */
@media (max-width: 767.98px) {
	.eureka-hero-phone-chip .small,
	.eureka-hero-bur-chip {
		font-size: 0.8125rem;
	}

	.eureka-hero-bur-chip {
		position: relative;
		left: auto;
		bottom: auto;
		margin-top: 0.75rem;
		max-width: 100%;
	}

	.eureka-hero-media {
		margin-top: 0.5rem;
	}
}

/* --- Modale (kontakt, szukaj, koszyk) --- */
@media (max-width: 575.98px) {
	.modal .modal-dialog.modal-xl,
	.modal .modal-dialog.modal-lg {
		margin: 0.5rem;
		max-width: calc(100% - 1rem);
	}

	#eurekaScheduleModal .modal-header,
	#eurekaScheduleModal .modal-body,
	#eurekaInquiryModal .modal-header,
	#eurekaInquiryModal .modal-body,
	#eurekaInquiryModal .eureka-inquiry-modal__phones-bar {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.eureka-schedule-modal__aside {
		margin-bottom: 0.25rem;
	}

	.eureka-inquiry-modal__phones-grid {
		grid-template-columns: 1fr;
	}

	.eureka-inquiry-modal__phone-card {
		justify-content: flex-start;
	}

	.eureka-inquiry-modal__phone-card-label {
		font-size: 1rem;
	}
}

/* --- Karty / opinie --- */
@media (max-width: 575.98px) {
	.card.rounded-4.p-4,
	.card.rounded-4.p-3.p-md-4 {
		padding: 1.125rem !important;
	}

	section.container-eureka.py-5 .mx-auto[style*="max-width"],
	.eureka-lost-wrap.eureka-content-narrow {
		max-width: 100% !important;
	}
}

/* --- Tabele przewijane --- */
@media (max-width: 767.98px) {
	.eureka-table-scroll {
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
	}
}

/* --- WooCommerce: siatka i ceny --- */
@media (max-width: 575.98px) {
	:is(.eureka-wc, body.woocommerce, body.woocommerce-shop, body.woocommerce-page) ul.products li.product .button,
	:is(.eureka-wc, body.woocommerce) .eureka-loop-product-link + .button,
	:is(.eureka-wc, body.woocommerce) ul.products li.product a.button {
		display: block;
		width: 100%;
		text-align: center;
	}

	:is(.eureka-wc, body.woocommerce) ul.products li.product .price {
		font-size: 0.9375rem;
	}

	.eureka-featured-course-card__title {
		min-height: 0;
		-webkit-line-clamp: 4;
	}

	.eureka-shop-hero .display-5 {
		font-size: clamp(1.35rem, 5vw + 0.5rem, 2rem);
	}

	.eureka-shop-search__group .form-control {
		min-width: 0;
		flex: 1 1 auto;
	}

	.eureka-shop-search__group .input-group-text {
		flex-shrink: 0;
		padding-inline: 0.75rem 0.5rem;
	}

	.eureka-shop-search__group .btn {
		border-radius: 0 9999px 9999px 0 !important;
		width: auto;
		flex-shrink: 0;
		padding-inline: 1rem;
		white-space: nowrap;
	}
}

/* --- Stopka --- */
@media (max-width: 575.98px) {
	.eureka-footer-newsletter__input,
	.eureka-footer-newsletter--cf7 .wpcf7 input[type="email"] {
		width: 100%;
		min-width: 0;
		flex: 1 1 100%;
	}

	.eureka-footer-top .d-flex.gap-2,
	.eureka-footer-top .d-flex.flex-wrap.gap-2 {
		flex-direction: column;
		align-items: stretch;
	}

	.eureka-footer-bottom .d-flex {
		flex-direction: column;
		text-align: center;
		gap: 0.75rem;
	}

	.eureka-footer-bottom .nav {
		justify-content: center;
		flex-wrap: wrap;
	}
}

/* --- Formularze auth / kontakt w kartach --- */
@media (max-width: 575.98px) {
	.eureka-contact-form .eureka-cf7-kontakt .row > [class*="col-md-"],
	.eureka-inquiry-modal__body .eureka-cf7-kontakt .row > .col-md-6,
	.eureka-inquiry-modal__body .eureka-cf7-zapytanie .row > .col-md-6 {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/* --- Checkout / koszyk: akcje --- */
@media (max-width: 575.98px) {
	.eureka-checkout-order .d-flex.gap-2,
	.eureka-checkout-order .d-flex.gap-3,
	.eureka-cart-actions,
	.eureka-cart-collaterals .wc-proceed-to-checkout {
		flex-direction: column;
		align-items: stretch !important;
	}

	.eureka-checkout-order .d-flex.gap-2 .btn,
	.eureka-checkout-order .d-flex.gap-3 .btn,
	.eureka-cart-actions .btn,
	.wc-proceed-to-checkout a.checkout-button {
		width: 100%;
	}
}

/* --- Moje konto: nawigacja --- */
@media (max-width: 991.98px) {
	.woocommerce-account .woocommerce-MyAccount-navigation {
		margin-bottom: 1.25rem;
	}

	.woocommerce-account .woocommerce-MyAccount-navigation ul {
		display: flex;
		flex-wrap: wrap;
		gap: 0.35rem;
		justify-content: center;
	}

	.woocommerce-account .woocommerce-MyAccount-navigation ul li {
		flex: 1 1 auto;
		min-width: 0;
	}

	.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
		font-size: 0.8125rem;
		padding: 0.5rem 0.65rem;
		white-space: normal;
		text-align: center;
		line-height: 1.25;
	}
}
