/**
 * Mobile / tablet overrides only (max-width queries).
 * Desktop (≥1200px header, ≥992px hero columns) is unchanged — see style.css.
 *
 * @package IP_Domofon
 */

/* -------------------------------------------------------------------------- */
/* ≤1199px — планшеты и телефоны (меню-гамбургер, как Bootstrap xl)           */
/* -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
	html {
		overflow-x: clip;
	}

	body {
		padding-top: clamp(4.75rem, 12vw, var(--ipd-header-height));
	}

	.site-header .navbar > .ipd-header-container {
		align-items: flex-start;
	}

	.site-header .navbar-brand {
		flex: 1 1 auto;
		min-width: 0;
		max-width: calc(100% - 3.25rem);
		gap: 0.65rem !important;
	}

	.site-header .site-brand-title {
		white-space: normal;
		overflow-wrap: anywhere;
		font-size: clamp(1rem, 3.2vw, 1.45rem);
		line-height: 1.15;
	}

	.site-header .navbar-brand .site-logo,
	.site-header .navbar-brand img {
		max-height: 56px;
	}

	.site-header .navbar-toggler {
		flex-shrink: 0;
		margin-top: 0.15rem;
		padding: 0.45rem 0.55rem;
	}

	.site-header .ipd-navbar-inner {
		width: 100%;
	}

	.site-header .ipd-header-menu .nav-link {
		padding: 0.55rem 0.65rem !important;
		min-height: 2.75rem;
		display: flex;
		align-items: center;
	}

	.site-header-actions .site-phone {
		white-space: normal;
		text-align: center;
		width: 100%;
		padding: 0.35rem 0;
	}

	.site-header-actions .ipd-lang-switch {
		width: 100%;
		position: relative;
	}

	.site-header-actions .ipd-lang-switch__toggle {
		width: 100%;
		min-height: 2.75rem;
	}

	/* Меню языка — строго под кнопкой, на всю её ширину */
	.site-header-actions .ipd-lang-switch .ipd-lang-switch__menu {
		left: 0 !important;
		right: 0 !important;
		width: 100%;
		min-width: 0;
		margin-top: 0.35rem;
	}

	.hero-ipd {
		padding: 2.75rem 0;
	}

	.hero-ipd-visual {
		max-height: min(280px, 42vh);
		margin-top: 0.5rem;
	}

	.ipd-trust-stat__label,
	.ipd-trust-stat .ipd-trust-stat__label.small {
		font-size: 1rem;
	}

	.ipd-cookie-banner__inner {
		flex-direction: column;
		align-items: stretch;
	}

	.ipd-cookie-banner__actions {
		width: 100%;
		justify-content: stretch;
	}

	.ipd-cookie-banner__actions .btn {
		flex: 1 1 auto;
		min-height: 2.75rem;
	}

	.ipd-app-modal__dialog {
		width: min(92vw, 520px);
		min-width: 0;
	}

	.ipd-contact-modal .ipd-contact-modal__dialog {
		--ipd-contact-modal-v-scale: 1.15;
		max-height: calc(100dvh - 1rem);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}
}

/* -------------------------------------------------------------------------- */
/* ≤767px — телефоны (крупные)                                                  */
/* -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
	.site-main {
		padding-top: 1.25rem !important;
		padding-bottom: 1.25rem !important;
	}

	.hero-ipd {
		padding: 2.25rem 0;
	}

	.hero-ipd .ipd-hero-title {
		font-size: clamp(1.35rem, 5vw, 1.75rem);
	}

	.entry-content ul.lead {
		font-size: 1.1rem;
	}

	.ipd-advantage-item,
	.ipd-audience-card {
		padding: 1rem 1.1rem;
	}

	.ipd-trust-stat {
		padding: 1.15rem 0.85rem;
	}

	.ipd-trust__row--with-ctas .ipd-trust-stat {
		min-height: 0;
	}

	.ipd-support-cta--lg .btn,
	.ipd-page-cta-stack .ipd-portfolio-cta .btn {
		font-size: 1.125rem;
		padding: 0.5rem 1rem;
		width: 100%;
	}

	.ipd-legal-document .policy-table {
		display: block;
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.ipd-legal-document .policy-table td {
		min-width: 9rem;
	}

	.ipd-legal-pdf-frame {
		min-height: 50vh;
	}

	.map-placeholder,
	.contact-map {
		min-height: 240px;
	}

	.site-footer .ipd-support-cta .btn {
		width: 100%;
	}
}

/* -------------------------------------------------------------------------- */
/* ≤575px — узкие телефоны                                                      */
/* -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
	.site-header .navbar-brand .site-logo,
	.site-header .navbar-brand img {
		max-height: 44px;
	}

	.site-header .site-brand-title {
		font-size: 0.95rem;
	}

	.hero-ipd {
		padding: 1.75rem 0;
	}

	.hero-ipd .ipd-hero-cta .d-flex.flex-wrap {
		flex-direction: column;
		align-items: stretch;
	}

	.hero-ipd .ipd-hero-cta .d-flex.flex-wrap > .btn,
	.hero-ipd .ipd-hero-cta .d-flex.flex-wrap > button {
		width: 100%;
		justify-content: center;
		min-height: 2.75rem;
	}

	.ipd-trust-stat__value {
		font-size: clamp(1.1rem, 4.5vw, 1.35rem);
	}

	.ipd-cookie-banner {
		padding: 0.85rem 0 1rem;
		padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
	}

	.ipd-cookie-banner__policy {
		white-space: normal;
		margin-left: 0;
		display: inline;
	}

	.ipd-cookie-banner__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.ipd-cookie-banner__actions .btn {
		width: 100%;
	}

	.ipd-contact-modal .ipd-contact-modal__dialog {
		--ipd-contact-modal-v-scale: 1;
		width: min(96vw, 100%);
		padding: 1.15rem 1rem 1rem;
	}

	.ipd-app-modal {
		padding: 0.5rem;
		padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
	}

	.ipd-app-modal__dialog {
		width: 100%;
		max-width: none;
		padding: 1.35rem 1rem 1.15rem;
	}
}

/* Сенсорные экраны: без «подпрыгивания» карточек при тапе */
@media (hover: none) and (pointer: coarse) {
	.card-ipd:hover,
	.ipd-audience-card:hover {
		transform: none;
	}
}
