/* Moy Kover template additions: replaces behaviour/markup of former J3-only extensions
   (DJ-MediaTools slider, DJ-MegaMenu mobile mode, cookie notice, callback popup, TweenMax flip cards). */

/* ---------- slider: port of the DJ-MediaTools "slideshow" layout, same settings as the old module ----------
   slider_type=left, transition=Expo.easeInOut, duration=1000ms, delay=7000ms, desc_effect=up.
   Markup + base geometry come from slideshow.css; behaviour is in moykover.js (adds .mk-js on init). */
.dj-slideshow { --mk-ease: cubic-bezier(.87, 0, .13, 1); /* ~ Fx.Transitions.Expo.easeInOut */ }
.dj-slideshow:not(.mk-js) .dj-slide:not(:first-child), .dj-slideshow:not(.mk-js) .dj-slide-desc:not(:nth-child(2)) { display: none; }          /* no-JS: show the first slide only */
.dj-slideshow.mk-js .dj-slides { opacity: 0; transition: opacity .5s ease; }       /* whole slider fades in on load */
.dj-slideshow.mk-js.mk-ready .dj-slides { opacity: 1; }
/* slides: parked off-screen right, glide in/out horizontally */
.dj-slideshow.mk-js .dj-slide { transform: translateX(100%); will-change: transform; }
.dj-slideshow.mk-js.mk-anim .dj-slide { transition: transform 1s var(--mk-ease); }
.dj-slideshow.mk-js .dj-slide.mk-pos-center { transform: translateX(0); }
.dj-slideshow.mk-js .dj-slide.mk-pos-left { transform: translateX(-100%); }
.dj-slideshow.mk-js .dj-slide.mk-pos-right { transform: translateX(100%); }
.dj-slideshow.mk-js .dj-slide.mk-notrans { transition: none !important; }
/* caption bars are siblings of the slides (as in the original), so they move straight up/down and never travel sideways with a slide.
   Each leaves upwards (0.5s); the next one drops in from above after 0.5s */
/* !important: the module's own CSS positions the caption with an #id selector (bottom: 0) */
.dj-slideshow.mk-js .dj-slide-desc { z-index: 3; bottom: 100% !important; }
.dj-slideshow.mk-js.mk-anim .dj-slide-desc { transition: bottom .5s var(--mk-ease); }
.dj-slideshow.mk-js .dj-slide-desc.mk-current { bottom: 0 !important; }
.dj-slideshow.mk-js.mk-anim .dj-slide-desc.mk-current { transition: bottom .5s var(--mk-ease) .5s; }
/* caption text vertically centred in its bar: the title was inline-block (its line box leaves a descender gap below the text) and the
   empty description still added its 8px top margin - both only below the text. Block title + no empty description = padding is the only space.
   !important: the template CSS sets display on #jm-allpage #jm-page .dj-slide-title */
.dj-slideshow .dj-slide-title { display: block !important; }
.dj-slideshow .dj-slide-description:empty { display: none; }
/* keep the bar as tall as before (the phantom 8px below the text becomes 4px more padding above and below) */
#jm-allpage #jm-page #dj-slideshow18m280 .dj-slide-desc-text { padding-top: 34px; padding-bottom: 34px; }
/* arrows, numbered buttons, play/pause (appear on hover like the original) */
.dj-slideshow .dj-loader { display: none; }
.dj-slideshow .dj-navigation .dj-prev, .dj-slideshow .dj-navigation .dj-next, .dj-slideshow .dj-navigation .dj-play, .dj-slideshow .dj-navigation .dj-pause, .dj-slideshow .dj-load-button { cursor: pointer; }
.dj-slideshow .showOnMouseOver { opacity: 0; transition: opacity .2s ease; }
.dj-slideshow.mk-hover .showOnMouseOver { opacity: .5; }
.dj-slideshow.mk-hover .showOnMouseOver:hover { opacity: 1; }
@media (max-width: 1190px) {
	.dj-slideshow .dj-slideshow-in { width: 100% !important; max-width: 1170px; height: auto !important; aspect-ratio: 1170 / 448; }
	.dj-slideshow .dj-slide img.dj-image { width: 100% !important; height: 100% !important; object-fit: cover; }
}
@media (prefers-reduced-motion: reduce) {
	.dj-slideshow.mk-js.mk-anim .dj-slide, .dj-slideshow.mk-js.mk-anim .dj-slide-desc, .dj-slideshow.mk-js.mk-anim .dj-slide-desc.mk-current { transition-duration: .01s !important; transition-delay: 0s !important; }
}

/* ---------- flip cards ("Как мы работаем"): replaces TweenMax ---------- */
.js-benefits-flip { transition: transform .7s cubic-bezier(.34, 1.56, .64, 1); }
@media (min-width: 768px) {
	.js-benefits-item:hover .js-benefits-flip { transform: perspective(1000px) rotateY(180deg); }
}
.js-benefits-item.benefits-item_active .js-benefits-flip { transform: perspective(1000px) rotateY(180deg); }

/* ---------- phone/tablet menu: floating button + left slide-in drawer (<= 919px; replaces the DJ-MegaMenu off-canvas) ---------- */
/* desktop (>= 920px): the drawer parts are invisible and their wrappers vanish from the layout, so the desktop menu is exactly as before */
.mk-menu-toggle { display: none; }
.mk-drawer, .mk-drawer-nav { display: contents; }
.mk-drawer-head, .mk-drawer-foot, .mk-backdrop, .mk-sub-toggle { display: none; }
.dj-megamenu li.dj-up:focus-within div.dj-subwrap { left: 0; right: auto; top: 100%; visibility: visible; z-index: 300; }
.dj-megamenu li.dj-up:focus-within div.dj-subwrap div.dj-subwrap-in { background: #303030; }
@media (max-width: 919px) {
	/* the floating button: stays fixed top-left while the page scrolls (the desktop header is fixed, the old phone header scrolled away) */
	.mk-menu-toggle { display: block; position: fixed; top: 10px; left: 12px; z-index: 1102; width: 48px; height: 48px; padding: 0; background: rgba(255, 255, 255, .97); border: 1px solid rgba(0, 0, 0, .07); border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .22); cursor: pointer; -webkit-tap-highlight-color: transparent; }
	.mk-menu-toggle span { position: absolute; left: 12px; width: 24px; height: 3px; margin: 0; background: #2b3a45; border-radius: 2px; transition: top .25s, transform .25s, opacity .2s, background-color .2s; }
	.mk-menu-toggle span:nth-child(1) { top: 15px; }
	.mk-menu-toggle span:nth-child(2) { top: 22px; }
	.mk-menu-toggle span:nth-child(3) { top: 29px; }
	.mk-menu-open .mk-menu-toggle span:nth-child(1) { top: 22px; transform: rotate(45deg); background: #01a7e3; }
	.mk-menu-open .mk-menu-toggle span:nth-child(2) { opacity: 0; }
	.mk-menu-open .mk-menu-toggle span:nth-child(3) { top: 22px; transform: rotate(-45deg); background: #01a7e3; }
	#jm-bar-in { position: relative; min-height: 64px; }
	#jm-bar-right { float: none; width: auto; }
	#jm-bar-right #jm-djmenu { position: static; }
	.dj-megamenu-wrapper { position: static; }
	.mk-menu-open .mk-cookie { display: none; }            /* the cookie notice would sit on top of the drawer footer */
	/* third-party floating widgets (amoCRM chat button z-index 100021, Marquiz quiz pill) would sit on top of the drawer footer; hidden only while it is open */
	.mk-menu-open .amo-button-holder, .mk-menu-open .marquiz__container { visibility: hidden !important; }
	body.mk-menu-open { overflow: hidden; }                /* no page scrolling behind the open menu */

	/* dimmed page behind the drawer */
	.mk-backdrop { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1090; background: rgba(15, 25, 35, .5); opacity: 0; visibility: hidden; transition: opacity .28s ease, visibility 0s linear .28s; }
	.dj-megamenu-wrapper.mk-open .mk-backdrop { opacity: 1; visibility: visible; transition: opacity .28s ease, visibility 0s; }

	/* the drawer: header (logo, next to the X button) / scrollable list / fixed footer (price quiz + phones) */
	.mk-drawer { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 1100; width: 70vw; min-width: 240px; max-width: 286px; box-sizing: border-box; background: #fff; box-shadow: 8px 0 28px rgba(0, 0, 0, .28); transform: translateX(-105%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s; }
	.dj-megamenu-wrapper.mk-open .mk-drawer { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
	.mk-drawer-head { display: flex; align-items: center; flex: none; height: 68px; box-sizing: border-box; padding: 0 16px 0 70px; border-bottom: 1px solid #eef1f3; }
	.mk-drawer-logo { display: block; line-height: 0; }
	.mk-drawer-logo img { display: block; width: auto; height: 34px; }
	.mk-drawer-nav { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
	.dj-megamenu-wrapper .mk-drawer-nav ul.dj-megamenu { display: block; position: static; float: none; width: auto; margin: 0; padding: 6px 0; background: transparent; box-shadow: none; }
	.dj-megamenu li.dj-up { position: relative; float: none; display: block; margin: 0; border: 0; border-bottom: 1px solid #eef1f3; background: none; }
	.dj-megamenu li.dj-up:before, .dj-megamenu li.dj-up:after { display: none; }
	.dj-megamenu li.dj-up > a.dj-up_a { display: flex; align-items: center; box-sizing: border-box; height: auto; min-height: 56px; margin: 0; padding: 0 60px 0 22px; border: 0; border-left: 4px solid transparent; background: none; color: #2b3a45; font-size: 15px; font-weight: 700; letter-spacing: .03em; line-height: 1.2; text-align: left; text-transform: uppercase; }
	.dj-megamenu li.dj-up.active > a.dj-up_a, .dj-megamenu li.dj-up.current > a.dj-up_a { color: #01a7e3; background: #f1faff; border-left-color: #01a7e3; }
	.dj-megamenu .dj-drop { display: block; padding: 0; }
	.dj-megamenu .dj-drop .arrow { display: none; }

	/* "Услуги": collapsed by default, the chevron button expands it (JS opens it when the current page is inside it) */
	.mk-sub-toggle { display: block; position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
	.mk-sub-toggle::before { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -7px 0 0 -5px; border-right: 2.5px solid #5d6b76; border-bottom: 2.5px solid #5d6b76; transform: rotate(45deg); transition: transform .25s, margin .25s; }
	.mk-sub-open > .mk-sub-toggle::before { margin-top: -2px; transform: rotate(-135deg); }
	.dj-megamenu li.dj-up div.dj-subwrap, .dj-megamenu li.dj-up:hover div.dj-subwrap, .dj-megamenu li.dj-up:focus-within div.dj-subwrap { position: static; left: auto; right: auto; top: auto; display: block; width: auto; max-height: 0; overflow: hidden; visibility: hidden !important; transition: max-height .3s ease, visibility 0s linear .3s; }
	.dj-megamenu li.dj-up.mk-sub-open div.dj-subwrap, .dj-megamenu li.dj-up.mk-sub-open:hover div.dj-subwrap, .dj-megamenu li.dj-up.mk-sub-open:focus-within div.dj-subwrap { max-height: 640px; visibility: visible !important; transition: max-height .3s ease, visibility 0s; }
	.dj-megamenu li.dj-up div.dj-subwrap div.dj-subwrap-in, .dj-megamenu li.dj-up:hover div.dj-subwrap div.dj-subwrap-in { width: auto !important; padding: 4px 0; background: #f6f9fb; box-shadow: none; border: 0; }
	.dj-megamenu .dj-subcol { width: auto !important; float: none; }
	.dj-megamenu .dj-submenu { margin: 0; padding: 0; list-style: none; }
	.dj-megamenu .dj-submenu > li { float: none; border: 0; background: none; }
	.dj-megamenu .dj-submenu > li > a { display: flex; align-items: center; box-sizing: border-box; min-height: 46px; margin: 0; padding: 0 20px 0 38px; border: 0; background: none; color: #3a4852; font-size: 15px; line-height: 1.25; text-align: left; }
	.dj-megamenu .dj-submenu > li.current > a, .dj-megamenu .dj-submenu > li.active > a { color: #01a7e3; font-weight: 700; }

	/* focus ring only for keyboard users (a tap that opens the menu must not leave a dotted box on the first item) */
	.mk-drawer a:focus:not(:focus-visible), .mk-menu-toggle:focus:not(:focus-visible), .mk-sub-toggle:focus:not(:focus-visible) { outline: none; }
	.mk-drawer a:focus-visible, .mk-menu-toggle:focus-visible, .mk-sub-toggle:focus-visible { outline: 2px solid #01a7e3; outline-offset: -2px; }
	/* footer: price quiz, tap-to-call, hours + address */
	.mk-drawer-foot { display: block; flex: none; padding: 14px 16px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); background: #f4f8fa; border-top: 1px solid #e6edf1; }
	.mk-cta { display: block; box-sizing: border-box; min-height: 48px; padding: 0 18px; border-radius: 24px; background: #01a7e3; box-shadow: 0 4px 12px rgba(1, 167, 227, .35); color: #fff; font-size: 16px; line-height: 48px; text-align: center; text-decoration: none; }
	.mk-call { display: flex; align-items: center; box-sizing: border-box; min-height: 44px; margin-top: 8px; padding: 0 14px 0 44px; border: 1px solid #cfe3ee; border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2301a7e3' d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.6 21 3 13.4 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1z'/%3E%3C/svg%3E") no-repeat 14px 50% / 20px 20px; color: #1f2d38; font-size: 15px; font-weight: 700; text-decoration: none; }
	.mk-drawer-info { margin: 10px 0 0; color: #667985; font-size: 12.5px; line-height: 1.45; }
}
@media (max-width: 919px) and (max-height: 620px) { .mk-drawer-info { display: none; } }
@media (max-width: 919px) and (prefers-reduced-motion: reduce) { .mk-drawer, .mk-backdrop, .mk-menu-toggle span, .mk-sub-toggle::before, .dj-megamenu li.dj-up div.dj-subwrap { transition-duration: .01s !important; } }

/* ---------- cookie notice (replaces mod_st_cookie) ---------- */
.mk-cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999; background: rgba(0, 0, 0, .8); color: #fff; padding: 14px 20px; }
.mk-cookie[hidden] { display: none; }
.mk-cookie-in { max-width: 1170px; margin: 0 auto; display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.mk-cookie p { margin: 0; font-size: 12px; line-height: 1.4; color: #fff; }
.mk-cookie-ok { flex: none; background: #01a7e3; color: #fff; border: 0; border-radius: 20px; padding: 8px 20px; font-weight: 700; cursor: pointer; }
.mk-cookie-ok:hover { background: #3b7bac; }
@media (max-width: 600px) { .mk-cookie-in { flex-direction: column; align-items: stretch; text-align: center; } }

/* ---------- callback popup (reuses wjcallback.css modal look) ---------- */
#wjcallback-modal[hidden] { display: none; }
#wjcallback-modal .mk-phones { margin: 10px 0 0; font-size: 20px; font-weight: 700; line-height: 1.7; text-align: center; }
#wjcallback-modal .mk-phones a { color: inherit; text-decoration: none; display: block; }
#wjcallback-modal .modal-footer { text-align: center; }

/* ---------- Joomla 6 renders the article title as <h1>; the old CSS styled it as <h2> ---------- */
.item-page > .page-header > h1 {
	font-family: ProximaNova, sans-serif;
	font-size: 31.5px;
	font-weight: bold;
	line-height: 1.2;
	color: rgb(51, 51, 51);
	display: block;
	margin: 0 0 20px;
	text-decoration: none;
}

/* Wedal 2.2.0 uses type="tel" for the phone field; the old CSS only covered type="text" */
#wjcallback-modal .form-validate input[type="tel"] { line-height: 1em; }

/* Dropdown: the submenu column is floated (.dj-subcol{float:left}); the old DJ-MegaMenu JS gave the dark .dj-subwrap-in its height.
   Without that JS the box collapsed to height 0 and the dropdown looked transparent - make it contain its float. */
.dj-megamenu .dj-subwrap-in { display: flow-root; }
.dj-megamenu .dj-subwrap-in::after { content: ""; display: block; clear: both; }

/* Self-hosted videos (replace the former YouTube iframes): each player takes the proportions of its own video (no letterboxing),
   centred, 480px tall (the clips are 360p, so about 1.33x), and shrinks to the container width on small screens.
   Each <video> carries its own ratio in --ar (width/height). */
.mk-video { display: block; margin: 0 auto 20px; width: min(100%, calc(480px * var(--ar, 1.7778))); height: auto; aspect-ratio: var(--ar, 1.7778); background: #000; border: 0; }

/* Contact page: the visible heading is the page's H1 (was an H2) - keep its original look (31.5px, left, 20px below) instead of the centred 38.5px article H1 */
.contact .page-header > h1 { font-family: ProximaNova, sans-serif; font-size: 31.5px; line-height: 37.8px; font-weight: 700; color: #333; margin: 0 0 20px; text-align: left; }

/* "Услуги" overview page: the five service badges (originally one 320px column on the left) as a 3 + 2 grid, second row centred,
   as wide as the price table below (80%); 2 columns on tablets, 1 on phones. Order unchanged: main cleaning services first, add-ons second. */
.services-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; width: 80%; max-width: none; margin: 0 auto 28px; }
.services-container li { flex: 0 1 calc((100% - 32px) / 3); min-width: 0; }
.services-container a { display: flex; align-items: center; height: 100%; box-sizing: border-box; margin: 0; padding: 10px 16px; line-height: 1.3; transition: background-color .15s, box-shadow .15s, transform .15s; }
.services-container a::before { float: none; flex: 0 0 40px; margin: 0 14px 0 0; }
.services-container a:hover { box-shadow: 0 4px 10px rgba(1, 167, 227, .35); transform: translateY(-2px); }
@media (max-width: 919px) { .services-container { width: 90%; } .services-container li { flex-basis: calc((100% - 16px) / 2); } }
@media (max-width: 559px) { .services-container { width: 100%; } .services-container li { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { .services-container a { transition: none; } .services-container a:hover { transform: none; } }

/* ================= Phone-friendliness (<= 767px); desktop is untouched ================= */
/* footer phone / e-mail are links now: keep the old (plain text) look */
.footer-nav-list a.tap-to-call, .footer-nav-list a.footer-mail { color: inherit; text-decoration: none; }
@media (max-width: 767px) {
	/* readable body text: 16px instead of 14px */
	#jm-main p, #jm-main li, #jm-main dd, #jm-main dt, .item-page p, .item-page li { font-size: 16px; line-height: 1.5; }
	.table-custom td, .table-custom th { font-size: 15px; }
	/* "Как мы работаем" cards: 2 per row as SHORT RECTANGLES (icon left, title right, ~76px tall; was 165px squares) so all 8 fit on one screen;
	   flip on tap still works; on the back the whole face is the link (same as desktop), text centred */
	.benefits__list { justify-content: space-between; padding: 8px 0 0; }
	.benefits-item { width: calc(50% - 5px); height: 76px; margin-bottom: 10px; }
	.benefits-item__side { flex-direction: row; justify-content: flex-start; padding: 0 8px; text-align: left; }
	.benefits-item__icon { flex: 0 0 30px; width: 30px; height: 30px; margin: 0 7px 0 0; }
	.benefits-item__title { font-size: 12.5px; line-height: 1.2; padding: 0; text-align: left; min-width: 0; overflow-wrap: break-word; }
	.benefits-item__side_back { justify-content: center; padding: 0 8px; text-align: center; font-size: 12.5px; line-height: 1.25; overflow-wrap: break-word; }
	.benefits-item__link { top: 0; bottom: auto; height: 100%; padding: 0; }
	.benefits-item__link img { display: none; }
	/* "Преимущества": 2 per row instead of 6 stacked (the 60px icons stay half-way out of the top edge) */
	.advantage-container { margin-top: 24px; }
	.advantage-block { box-sizing: border-box; width: calc(50% - 8px); margin: 34px 4px 4px; padding: 38px 6px 10px; }
	.advantage-block h3 { font-size: 16px; line-height: 1.25; }
	.advantage-block p { font-size: 14px; margin-top: 6px; }
	/* tap targets >= 44px (Google/Apple guidance) without changing the look */
	.footer-nav-list a:not(.vk-white):not(.instagram-white):not(.footer-logo) { display: inline-block; padding: 13px 8px; }
	a.footer-logo { display: inline-block; line-height: 0; }
	.jm-icons a { position: relative; }
	.jm-icons a::after { content: ""; position: absolute; top: -7px; right: -7px; bottom: -7px; left: -7px; }
	.contact a.contact-telephone, .contact a.contact-mobile, .contact .contact-emailto a { display: inline-block; padding: 12px 0; }
	/* cookie notice: compact, 44px button */
	.mk-cookie { padding: 10px 14px; }
	.mk-cookie p { font-size: 13px; line-height: 1.35; }
	.mk-cookie-ok { min-height: 44px; padding: 10px 20px; }
	/* callback popup: 16px fields (iOS Safari zooms the page on focus below 16px), 44px close button */
	.modal-content .form-control { font-size: 16px; }
	.modal-content .close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; line-height: 44px; text-align: center; }
}
@media (max-width: 559px) { .table-custom { width: 100%; } }   /* price table: full width instead of 80% */

/* Phone slider (<= 599px): taller picture (16:10 instead of the very wide 1170:448, so ~217px instead of ~133px at 348px width) and a slimmer
   caption bar (~28px instead of ~50px). Same id-based selectors as slideshow.css so these win; object-fit: cover (above) crops the sides. */
@media (max-width: 599px) {
	#dj-slideshow18m280 .dj-slideshow-in { aspect-ratio: 16 / 10; }
	#dj-slideshow18m280 .dj-slide img.dj-image[src*="chistka_kovrov.1"] { object-position: 78% center; }   /* keep the rabbit in frame */
	#dj-slideshow18m280 .dj-slide-desc-text { padding: 8px 12px !important; }   /* !important: template_responsive.26.css forces 10px at <=480px */
	#dj-slideshow18m280 .dj-slide-title { font-size: 13px !important; line-height: 1.2; margin-bottom: 0; }
	#dj-slideshow18m280 .dj-slide-description { display: none; }
}
@media (min-width: 480px) and (max-width: 599px) { #dj-slideshow18m280 .dj-slideshow-in { aspect-ratio: 2 / 1; } }   /* big phones: a little less tall */
