/**
 * RX Direct — responsive layout
 *
 * 1. Large desktop — min-width 1440px
 * 2. Desktop       — max-width 1439px
 * 3. Laptop        — max-width 1199px
 * 4. Tablet        — max-width 1023px (iPad / iPad mini, portrait & landscape)
 * 5. Mobile        — max-width 767px (portrait & landscape)
 * 6. Small device  — max-width 480px (portrait & landscape)
 */

/* --- 1. Large desktop (1440px+) --- */
@media (min-width: 1440px) {
	:root {
		--maxw: 1240px;
	}

	.wrap {
		padding-left: 32px;
		padding-right: 32px;
	}

	section.block {
		padding: 100px 0;
	}

	.hero .wrap {
		padding-top: 80px;
		padding-bottom: 90px;
	}
}

/* --- 2. Desktop (1200px–1439px) --- */
@media (max-width: 1439px) {
	.nav {
		gap: 20px;
	}

	nav.main > ul > li > a,
	nav.main > ul > li > button {
		padding: 10px 12px;
		font-size: 0.92rem;
	}

	.mega-inner {
		gap: 32px;
		padding: 30px 20px 34px;
	}

	.foot-grid {
		gap: 32px;
	}
}

/* --- 3. Laptop (1024px–1199px) --- */
@media (max-width: 1199px) {
	.nav {
		gap: 14px;
		height: 72px;
	}

	.logo {
		font-size: 1.55rem;
	}

	.header-actions {
		gap: 10px;
	}

	.icon-btn {
		width: 40px;
		height: 40px;
	}

	nav.main > ul > li > a,
	nav.main > ul > li > button {
		padding: 8px 10px;
		font-size: 0.88rem;
	}

	.mega-cols {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px 18px;
	}

	header.site nav.main .panel-menu .row {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.foot-grid {
		grid-template-columns: 1.2fr 1fr 1fr;
		gap: 28px;
	}

	.foot-grid > div:last-child {
		grid-column: 1 / -1;
	}

	.trust-item {
		padding: 6px 14px;
	}

	.trust-item .tt {
		font-size: 0.88rem;
	}

	.rev-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* --- 4. Tablet (768px–1023px) — iPad / iPad mini --- */
@media (max-width: 1023px) {
	.wrap {
		padding-left: 20px;
		padding-right: 20px;
	}

	section.block {
		padding: 72px 0;
	}

	.sec-head {
		margin-bottom: 40px;
	}

	.hero .wrap {
		grid-template-columns: 1fr;
		padding-top: 48px;
		padding-bottom: 64px;
		gap: 36px;
		text-align: center;
	}

	.hero p.lead {
		margin-left: auto;
		margin-right: auto;
	}

	.hero-cta,
	.hero-trust {
		justify-content: center;
	}

	.hero-visual {
		min-height: 320px;
		max-width: 460px;
		margin: 0 auto;
		width: 100%;
		overflow: hidden;
	}

	.hv-card.one {
		left: 0;
		top: 24px;
	}

	.hv-card.two {
		right: 0;
		bottom: 32px;
	}

	.hv-card.three {
		left: 24px;
		bottom: 0;
	}

	.about .wrap {
		grid-template-columns: 1fr;
		gap: 48px;
	}

	.about-visual {
		max-width: 560px;
		margin: 0 auto;
		width: 100%;
		padding-bottom: 0;
	}

	.about-badge {
		position: absolute;
		right: 12px;
		bottom: -18px;
		margin: 0;
		max-width: calc(100% - 24px);
	}

	.cond-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 18px;
	}

	.rev-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}

	.steps {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.mega-inner {
		grid-template-columns: 1fr;
	}

	.mega-promo {
		display: none;
	}

	.trust-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
		padding: 22px 10px;
	}

	.trust-item + .trust-item {
		border-left: 0;
	}

	.foot-grid {
		grid-template-columns: 1fr 1fr;
		gap: 32px 24px;
	}

	footer.site .foot-grid > div {
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	footer.site .foot-about {
		margin-left: auto;
		margin-right: auto;
		max-width: 340px;
	}

	footer.site .foot-social {
		justify-content: center;
		width: 100%;
	}

	footer.site .foot-grid ul {
		width: fit-content;
		justify-items: center;
	}

	footer.site .foot-legal p {
		max-width: 380px;
	}

	footer.site .foot-bottom {
		justify-content: center;
		text-align: center;
	}

	.cta-inner {
		padding: 52px 36px;
	}

	.news h2 {
		font-size: 1.85rem;
	}
}

/* Tablet landscape — tighter vertical spacing */
@media (max-width: 1023px) and (orientation: landscape) {
	.hero .wrap {
		padding-top: 36px;
		padding-bottom: 48px;
	}

	.hero-visual {
		min-height: 280px;
	}

	section.block {
		padding: 56px 0;
	}

	.trust-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 8px;
		padding: 18px 6px;
	}

	.trust-item {
		flex-direction: column;
		text-align: center;
		padding: 8px 10px;
		gap: 8px;
	}

	.trust-item .ti {
		margin: 0 auto;
	}
}

/* Mobile header + compact layout (tablet portrait and below) */
@media (max-width: 820px) {
	nav.main,
	.search,
	.mobile-hide {
		display: none !important;
	}

	.hamburger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.mobile-drawer .hamburger {
		display: inline-flex;
	}

	.mobile-only {
		display: block;
	}

	header.site > .wrap.nav {
		padding-top: 12px;
		padding-bottom: 12px;
		padding-left: max(20px, env(safe-area-inset-left));
		padding-right: max(16px, env(safe-area-inset-right));
	}

	header.site .nav {
		height: auto;
		min-height: 64px;
		gap: 12px;
		justify-content: space-between;
		flex-wrap: nowrap;
	}

	header.site .logo {
		font-size: 1.5rem;
		flex: 0 1 auto;
		min-width: 0;
		margin-left: 2px;
	}

	header.site .logo .logo-img {
		max-height: 36px;
	}

	header.site .header-actions {
		margin-left: auto;
		flex: 0 0 auto;
		gap: 6px;
	}

	header.site .icon-btn,
	header.site .hamburger {
		width: 38px;
		height: 38px;
	}

	header.site nav.main .panel-menu {
		display: none;
	}

	header.site .icon-btn svg {
		width: 20px;
		height: 20px;
	}

	header.site.search-open .search-panel {
		max-height: min(480px, 70vh);
	}

	.search-row {
		gap: 8px;
		width: 100%;
		max-width: 100%;
	}

	.search-row-icon {
		display: none;
	}

	.search-close {
		flex: 0 0 40px;
		width: 40px;
		height: 40px;
	}

	.rxd-search-field input[type="search"],
	.rxd-fibosearch input[type="search"].dgwt-wcas-search-input {
		font-size: 16px !important;
		padding-right: 68px !important;
	}

	.rxd-search-clear,
	.rxd-fibosearch .dgwt-wcas-inner-actions {
		right: 44px;
	}

	.rxd-search-submit,
	.rxd-fibosearch button.dgwt-wcas-search-submit {
		flex-basis: 44px;
		width: 44px !important;
		height: 40px !important;
		min-height: 40px !important;
	}

	.search-panel .dgwt-wcas-suggestions-wrapp,
	.rxd-fibosearch .dgwt-wcas-suggestions-wrapp {
		max-height: min(280px, 42vh);
	}

	.topbar .wrap {
		align-items: center;
		padding-top: 10px;
		padding-bottom: 10px;
		min-height: 0;
	}

	.topbar-left-message {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
		word-break: break-word;
		line-height: 1.4;
		padding: 2px 0;
	}

	.topbar-left-message p {
		display: inline;
		gap: 0;
	}

	.topbar-left-message p i.fa,
	.topbar-left-message > i.fa {
		display: inline-block;
		margin-right: 6px;
		vertical-align: top;
		margin-top: 2px;
	}

	.topbar .right {
		gap: 12px;
		flex-shrink: 0;
		align-self: center;
	}

	.topbar .topbar-label {
		position: absolute !important;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.topbar .topbar-link {
		gap: 0;
		min-width: 32px;
		min-height: 32px;
		justify-content: center;
	}

	.topbar--hide-mobile {
		display: none !important;
	}

	section.block {
		padding: 64px 0;
	}
}

/* --- 5. Mobile (481px–767px) --- */
@media (max-width: 767px) {
	.wrap {
		padding-left: 18px;
		padding-right: 18px;
	}

	.cond-grid,
	.rev-grid,
	.trust-grid,
	.foot-grid {
		grid-template-columns: 1fr;
	}

	.trust-item {
		flex-direction: row;
		text-align: left;
		justify-content: flex-start;
		padding: 10px 16px;
	}

	.trust-item + .trust-item {
		border-top: 1px solid rgba(255, 255, 255, 0.18);
	}

	.hero h1 {
		font-size: clamp(1.95rem, 8vw, 2.35rem);
	}

	.hero p.lead {
		font-size: 1rem;
	}

	.hero-visual {
		min-height: 300px;
	}

	.hv-card.one {
		left: 0;
		top: 24px;
	}

	.hv-card.two {
		right: 0;
		bottom: 32px;
	}

	.hv-card.three {
		left: 24px;
		bottom: 0;
	}

	.about-badge {
		position: relative;
		right: auto;
		bottom: auto;
		margin: 20px auto 0;
		max-width: 320px;
	}

	.about-visual {
		padding-bottom: 0;
	}

	.about-actions {
		justify-content: center;
	}

	.sec-head h2 {
		font-size: clamp(1.75rem, 7vw, 2.1rem);
	}

	.cta-inner {
		padding: 44px 24px;
	}

	.cta-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.cta-actions .btn {
		width: 100%;
	}

	.news-form {
		flex-direction: column;
		flex-wrap: wrap;
	}

	.rxd-newsletter-form .newsletter-form,
	.rxd-newsletter-form .newsletter-form .row,
	.rxd-newsletter-form .wpcf7-form:not(:has(.newsletter-form)),
	.rxd-newsletter-form .wpforms-form .wpforms-field-container,
	.rxd-newsletter-form .gform_wrapper form {
		grid-template-columns: 1fr;
	}

	.rxd-newsletter-form .newsletter-form [class*="col-"] {
		width: 100% !important;
	}

	.news-form,
	.rxd-newsletter-form form,
	.rxd-newsletter-form .wpcf7-form:not(:has(.newsletter-form)),
	.rxd-newsletter-form .wpforms-form .wpforms-field-container,
	.rxd-newsletter-form .gform_wrapper form {
		display: grid;
		align-items: stretch;
	}

	.news-form input,
	.rxd-newsletter-form input[type="text"],
	.rxd-newsletter-form input[type="email"],
	.rxd-newsletter-form input[type="tel"],
	.rxd-newsletter-form input[type="url"],
	.rxd-newsletter-form select,
	.rxd-newsletter-form .wpcf7-form-control:not(.wpcf7-submit):not(.wpcf7-textarea),
	.rxd-newsletter-form .wpforms-field input[type="text"],
	.rxd-newsletter-form .wpforms-field input[type="email"],
	.rxd-newsletter-form .wpforms-field select {
		min-width: 0;
		width: 100%;
	}

	.news-form .btn,
	.rxd-newsletter-form button,
	.rxd-newsletter-form input[type="submit"],
	.rxd-newsletter-form .wpcf7-submit,
	.rxd-newsletter-form .wpforms-submit,
	.rxd-newsletter-form .gform_button,
	.rxd-newsletter-form .gform-button {
		width: 100%;
	}

	footer.site .foot-bottom {
		flex-direction: column;
		align-items: center;
		gap: 20px;
	}

	.gphc-badge {
		text-align: left;
	}
}

/* Mobile landscape */
@media (max-width: 767px) and (orientation: landscape) {
	.hero .wrap {
		padding-top: 28px;
		padding-bottom: 40px;
	}

	.hero-visual {
		min-height: 240px;
		max-height: 52vh;
	}

	section.block {
		padding: 48px 0;
	}

	.trust-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.trust-item {
		border-top: 0;
	}

	.trust-item + .trust-item {
		border-top: 0;
	}
}

/* --- 6. Small device (up to 480px) --- */
@media (max-width: 480px) {
	.wrap {
		padding-left: max(16px, env(safe-area-inset-left));
		padding-right: max(16px, env(safe-area-inset-right));
	}

	section.block {
		padding: 48px 0;
	}

	.hero .wrap {
		padding-top: 36px;
		padding-bottom: 48px;
	}

	.hero h1 {
		font-size: 1.9rem;
	}

	.hero-visual {
		min-height: 260px;
	}

	.hv-card {
		padding: 10px 12px;
		gap: 8px;
		max-width: calc(100% - 12px);
	}

	.hv-card .cv {
		font-size: 0.84rem;
	}

	.btn {
		padding: 12px 20px;
		font-size: 0.9rem;
	}

	header.site > .wrap.nav {
		padding-left: max(18px, env(safe-area-inset-left));
		padding-right: max(14px, env(safe-area-inset-right));
	}

	header.site .logo {
		font-size: 1.3rem;
		margin-left: 2px;
	}

	header.site .header-actions {
		gap: 4px;
	}

	header.site .icon-btn,
	header.site .hamburger {
		width: 36px;
		height: 36px;
	}

	.topbar .wrap {
		padding-top: 12px;
		padding-bottom: 12px;
		gap: 10px;
	}

	.topbar-left-message {
		font-size: 12px;
		line-height: 1.45;
	}

	.step,
	.cond-card,
	.rev-card {
		padding: 22px 18px;
	}

	.faq-q {
		padding: 16px 18px;
		font-size: 0.95rem;
	}

	.faq-a-inner {
		padding: 0 18px 18px;
	}

	footer.site {
		padding: 48px 0 24px;
	}

	.drawer {
		width: min(360px, 86vw);
		padding: 20px max(20px, env(safe-area-inset-right)) 20px 20px;
	}

	.cta-band {
		padding-bottom: 48px;
	}
}

/* Small device landscape */
@media (max-width: 480px) and (orientation: landscape) {
	.hero .wrap {
		padding-top: 24px;
		padding-bottom: 32px;
	}

	.hero-visual {
		min-height: 200px;
	}

	section.block {
		padding: 40px 0;
	}

	.trust-grid {
		grid-template-columns: repeat(2, 1fr);
		padding: 16px 8px;
	}
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 1023px) {
	body.rx-direct-refreshed {
		overflow-x: hidden;
	}

	body.rx-direct-refreshed header.site,
	body.rx-direct-refreshed main,
	body.rx-direct-refreshed footer.site,
	body.rx-direct-refreshed .wrap {
		max-width: 100%;
	}

	body.rx-direct-refreshed .cta-inner,
	body.rx-direct-refreshed .trust-grid,
	body.rx-direct-refreshed .news-form,
	body.rx-direct-refreshed .rxd-newsletter-form {
		max-width: 100%;
	}

	body.rx-direct-refreshed .mobile-drawer .panel-menu .container,
	body.rx-direct-refreshed .mobile-drawer .panel-menu .row {
		margin-left: 0;
		margin-right: 0;
		padding-left: 0;
		padding-right: 0;
		max-width: 100%;
	}
}

/* Home section mobile visibility toggles */
@media (max-width: 767px) {
	.rxd-hide-mobile {
		display: none !important;
	}
}

/* WordPress integration overrides */
@media (max-width: 820px) {
	body.rx-direct-refreshed .topbar .wrap {
		min-height: 0;
		padding-top: 10px;
		padding-bottom: 10px;
	}
}

@media (max-width: 480px) {
	body.rx-direct-refreshed .topbar .wrap {
		padding-top: 12px;
		padding-bottom: 12px;
	}
}
