/* ==========================================================
   TEREHUN MOBILE FIXES V1
   Desktop >= 1081px intentionally untouched.
   ========================================================== */


/* ----------------------------------------------------------
   1. MOBILE MENU
   Keep the opened header attached to the viewport.
   ---------------------------------------------------------- */

@media (max-width:1080px){

    .site-header.open{
        position:fixed !important;
        top:0 !important;
        right:0 !important;
        bottom:auto !important;
        left:0 !important;
        width:100% !important;
        z-index:99980 !important;
        background:#102d23 !important;
    }

    .site-header.open .header-nav-wrap{
        display:block !important;
        width:100% !important;
        max-height:calc(100dvh - 82px) !important;
        overflow-x:hidden !important;
        overflow-y:auto !important;
        overscroll-behavior:contain;
        -webkit-overflow-scrolling:touch;
        background:#102d23 !important;
    }

    .site-header.open .main-nav{
        height:auto !important;
        max-height:none !important;
    }

}


/* ----------------------------------------------------------
   2. HOME / "ЧЕМ НАПОЛНИТЬ ДЕНЬ"
   One useful card + preview of next card.
   ---------------------------------------------------------- */

@media (max-width:760px){

    .th-home-v2__experience-grid{
        display:grid !important;
        grid-template-columns:none !important;
        grid-auto-flow:column !important;
        grid-auto-columns:min(82vw,340px) !important;
        gap:14px !important;

        width:auto !important;
        max-width:none !important;

        margin-left:-14px !important;
        margin-right:-14px !important;
        padding:0 14px 16px !important;

        overflow-x:auto !important;
        overflow-y:hidden !important;

        scroll-snap-type:x mandatory;
        scroll-padding-left:14px;

        -webkit-overflow-scrolling:touch;
        scrollbar-width:none;
    }

    .th-home-v2__experience-grid::-webkit-scrollbar{
        display:none;
    }

    .th-home-v2__experience-card{
        width:auto !important;
        min-width:0 !important;
        max-width:none !important;
        scroll-snap-align:start;
        scroll-snap-stop:normal;
    }

    .th-home-v2__experience-card
    .th-home-v2__media{
        width:100% !important;
    }

    .th-home-v2__experience-card
    .th-home-v2__card-copy{
        min-width:0 !important;
    }

    .th-home-v2__experience-card h3,
    .th-home-v2__experience-card p{
        overflow-wrap:normal !important;
        word-break:normal !important;
    }

}


/* ----------------------------------------------------------
   3. TARIFF TABLE
   Desktop = original table.
   Mobile = one card per period.
   ---------------------------------------------------------- */

@media (max-width:680px){

    .table-wrap{
        overflow:visible !important;
        border:0 !important;
        border-radius:0 !important;
        background:transparent !important;
    }

    table.rates{
        display:block !important;
        width:100% !important;
        min-width:0 !important;
        border-collapse:separate !important;
    }

    .rates tbody{
        display:grid !important;
        width:100% !important;
        gap:12px !important;
    }

    .rates tr{
        display:grid !important;
        grid-template-columns:
            minmax(0,1fr)
            minmax(0,1fr) !important;

        width:100% !important;
        overflow:hidden !important;

        border:1px solid #deded8 !important;
        border-radius:12px !important;
        background:#fff !important;
    }

    .rates tr:first-child{
        display:none !important;
    }

    .rates td{
        display:block !important;
        min-width:0 !important;

        padding:16px 14px !important;

        border:0 !important;

        font-size:15px !important;
        line-height:1.45 !important;
    }

    .rates td:first-child{
        grid-column:1 / -1 !important;

        padding:14px !important;

        border-bottom:
            1px solid #e6e5df !important;

        background:#f2efe8 !important;

        font-size:17px !important;
    }

    .rates td:nth-child(2){
        border-right:
            1px solid #e6e5df !important;
    }

    .rates td:nth-child(2)::before,
    .rates td:nth-child(3)::before{
        display:block;

        margin-bottom:8px;

        color:#173f32;

        font-size:11px;
        line-height:1.3;
        font-weight:750;

        text-transform:uppercase;
        letter-spacing:.045em;
    }

    .rates td:nth-child(2)::before{
        content:"Малый дом · 2–4 человека";
    }

    .rates td:nth-child(3)::before{
        content:"Большой дом · 4–8 человек";
    }

    .rates td strong{
        font-size:17px !important;
    }

}


/* ----------------------------------------------------------
   4. WORKSHOPS
   Force arrow to normal text glyph, never emoji.
   ---------------------------------------------------------- */

.mw-body .mw-index-arrow{
    font-family:
        Arial,
        "Helvetica Neue",
        sans-serif !important;

    font-variant-emoji:text;
    color:#173f32 !important;
}


/* ----------------------------------------------------------
   5. CONTACT PAGE
   Prevent long address/e-mail/GPS from expanding columns.
   ---------------------------------------------------------- */

@media (max-width:760px){

    body.terehun-polish-contact{
        overflow-x:hidden !important;
    }

    .terehun-polish-contact main,
    .terehun-polish-contact main .shell,
    .terehun-polish-contact main .grid,
    .terehun-polish-contact main .panel,
    .terehun-polish-contact main
        .terehun-contact-facts,
    .terehun-polish-contact main
        .map-card{
        min-width:0 !important;
        max-width:100% !important;
    }

    .terehun-polish-contact main
    .contact-overview-polish .grid,
    .terehun-polish-contact main
    .contact-transit-polish .grid{
        grid-template-columns:
            minmax(0,1fr) !important;
    }

    .terehun-polish-contact main
    .terehun-contact-facts > p,
    .terehun-polish-contact main
    .terehun-contact-facts a,
    .terehun-polish-contact main
    .terehun-contact-facts span{
        max-width:100% !important;

        overflow-wrap:anywhere !important;
        word-break:normal !important;
    }

    .terehun-polish-contact main
    .map-card iframe{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
    }

}


/* ----------------------------------------------------------
   6. NEW YEAR COMPACT MOBILE BANNER
   Full modal is disabled by JS patch below.
   ---------------------------------------------------------- */

@media (max-width:720px){

    .th-ny-v10-side{
        left:12px !important;
        right:12px !important;

        bottom:
            calc(
                10px
                + env(safe-area-inset-bottom)
            ) !important;

        width:auto !important;
        max-width:none !important;

        border-radius:18px !important;
    }

    .th-ny-v10-side__thumb{
        min-height:100px !important;
    }

}


/* ----------------------------------------------------------
   iPhone / narrow viewport refinement
   ---------------------------------------------------------- */

@media (max-width:680px){

    .site-header.open .header-nav-wrap{
        max-height:
            calc(100dvh - 74px) !important;
    }

}


/* BEGIN TEREHUN MOBILE MICRO FIX V1.1 */

@media (max-width:680px){

    /* ==============================================
       1. CONTACTS IN MOBILE MENU
       ============================================== */

    .site-header.open
    .main-nav > .nav-map-wrap{
        width:100% !important;
        min-width:0 !important;

        margin:0 !important;

        justify-self:stretch !important;
        align-self:stretch !important;

        text-align:left !important;
    }

    .site-header.open
    .main-nav > .nav-map-wrap > a{
        display:block !important;

        width:100% !important;

        margin:0 !important;
        padding-left:0 !important;
        padding-right:0 !important;

        text-align:left !important;
    }


    /* ==============================================
       2. NEW YEAR COMPACT BANNER CLOSE BUTTON
       ============================================== */

    .th-ny-v10-side{
        position:fixed !important;
    }

    .th-ny-v10-side
    button[aria-label*="Закры"]{
        position:absolute !important;

        top:10px !important;
        right:10px !important;
        left:auto !important;
        bottom:auto !important;

        width:42px !important;
        height:42px !important;

        margin:0 !important;
        padding:0 !important;

        display:grid !important;
        place-items:center !important;

        transform:none !important;

        border-radius:50% !important;

        line-height:1 !important;

        z-index:20 !important;
    }

}

/* END TEREHUN MOBILE MICRO FIX V1.1 */
