@media screen and (max-width: 1200px) {
    .center {
        padding: 0;
    }
}

@media screen and (max-width: 1024px) {
    #top_slider .content .text, 
    #top_slider a.prev, 
    #top_slider a.next {
        display: none !important;
    }
    #top_slider .img_wrapper {
        background-image: url(/assets/img/design/bg_top_slider.jpg) !important;
    }
    #top_slider .content {
        padding: 20px 0;
        white-space: normal;
    }
    #top_slider .content .search {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        height: auto;
        margin-top: 20px;
    }

    #top_slider .content .text {
        padding: 20px 0;
    }
    
    #top_slider .nav .logo {
        float: none;
        margin: 0 auto;
        position: relative;
        top: auto;
        left: auto;
    }

    #top_slider .nav .add {
        float: none;
        margin: 20px auto;
        display: block;
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    #top_slider .nav .add a {
        padding-left: 15px;
    }
    #top_slider .nav .add a:after {
        display: none;
    }

    #top_slider .nav ul {
        display: none; /* Hide desktop menu */
    }
    #top_slider .top ul li {
        border-right: none !important;
    }
    .w1, .w3, .w5, .w25, .w75 {
        width: 100% !important;
        float: none !important;
    }
    
    /* Realty Blocks on mobile/tablet */
    .realty_block {
        height: auto !important;
        margin-bottom: 20px;
        overflow: hidden !important;
        display: block !important;
        float: none !important;
        width: 100% !important;
    }
    .realty_block .img {
        width: 100% !important;
        height: 250px !important;
        float: none !important;
    }
    .realty_block .img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .realty_block .text {
        width: 100% !important;
        padding: 15px !important;
        float: none !important;
        height: auto !important;
        display: block !important;
    }
    .realty_block .text p {
        height: auto !important;
        margin-bottom: 10px;
        float: none !important;
        width: 100% !important;
    }
    .realty_block .text h3 {
        height: auto !important;
        float: none !important;
        width: 100% !important;
    }
    .realty_block .text .price,
    .realty_block .text .spec,
    .realty_block .text a,
    .realty_block .date {
        float: none !important;
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        margin: 5px 0 !important;
        position: static !important;
    }
    .realty_block .text .spec {
        margin-top: 10px !important;
    }
    .realty_block .text a {
        margin-top: 15px !important;
        padding: 12px 20px !important;
        border-bottom: none !important;
    }
    .realty_block .date {
        text-align: right !important;
        font-size: 0.8em !important;
    }

    #footer .center {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    #footer .w3 {
        margin-bottom: 30px;
        text-align: center;
        width: 100% !important;
        float: none !important;
    }
    #footer .w3.ts {
        order: -1;
    }
    #footer .info {
        display: inline-block;
        width: auto !important;
        text-align: left;
        margin-bottom: 10px;
        padding-left: 25px;
    }
    #footer .social-networks {
        padding-left: 15px !important; /* Повертаємо паддінг для центрування */
    }
    #footer .ts img {
        margin-bottom: 20px !important;
    }
    #footer .contact_us {
        margin-top: 10px;
    }
    .modal_wrapper .modal_body {
        width: 90% !important;
        height: auto !important;
        max-height: 90%;
        top: 5% !important;
        left: 5% !important;
        right: 5% !important;
        bottom: 5% !important;
    }
    #show .images .prev, #show .images .next {
        display: none !important;
    }
    .realty-slider-wrapper {
        margin-bottom: 20px;
    }
    .realty-slider img {
        height: 200px;
        object-fit: cover;
    }
    .realty-images-list .image-item img {
        width: 100% !important;
        max-width: 100%;
        height: auto !important;
    }
    #show .content .left, #show .content .right {
        width: 100%;
        float: none;
        height: auto !important;
        overflow: visible !important;
    }
    #show .title {
        height: auto !important;
    }
    .realty-slider .slick-dots {
        bottom: -25px;
    }
    #show .images {
        margin-bottom: 30px;
    }
}

@media screen and (max-width: 480px) {
    .realty-slider img {
        height: 150px;
    }
}
@media screen and (max-width: 768px) {
    #top_slider .top ul, #top_slider .top p {
        float: none !important;
        text-align: center !important;
        margin-bottom: 10px;
        width: 100% !important;
    }
    #top_slider .top ul li {
        border-right: none !important;
        margin-right: 0 !important;
        padding: 5px 35px !important;
        background-position: left center;
        display: inline-block !important;
    }
    #top_slider .top p.data {
        padding: 5px 35px !important;
        margin-right: 0 !important;
    }
    
    #show .title .name, #show .title .price, #show .content .info .price {
        width: 100%;
        float: none;
        padding: 0;
        text-align: center;
    }
    #show .content .left, #show .content .right {
        width: 100%;
        float: none;
    }
    
    #add .data .input {
        width: 100% !important;
    }
    #filter .type, #filter .region, #filter .city, #filter .category, 
    #filter .price_from, #filter .price_to, #filter .area_from, #filter .area_to,
    #filter .rooms_from, #filter .rooms_to, #filter .floor_from, #filter .floor_to,
    #filter .advanced {
        width: 100% !important;
        margin-bottom: 10px;
        display: block;
    }
    #filter .f_l {
        float: none !important;
    }
    #show .content .info ul li span {
        float: none !important;
        display: block;
        text-align: center;
    }
    #show .content .info ul li span:nth-child(1) {
        margin-bottom: 5px;
    }
    #show .content .info .phone {
        width: 100%;
        text-align: center;
        background-position: center left 20px;
    }
    
    #paginator ul {
        text-align: center;
        padding: 10px 0;
    }
    #paginator ul li {
        margin: 5px;
    }
    #show .content .info .price, #show .content .info .realty-back-link, #show .content .info .add a {
        text-align: center;
        display: block;
        width: 100%;
    }
    #show .content .info .add a:after {
        display: none;
    }
}

/* Fix for top slider height on small devices */
@media screen and (max-width: 640px) {
    #top_slider {
        min-height: auto !important;
        height: auto !important;
    }
    #top_slider.small {
        min-height: 100px;
    }
}

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    position: absolute;
    top: 25px;
    right: 20px;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 1001;
}
.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #fff;
    margin-bottom: 6px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
}
.menu-toggle span:last-child {
    margin-bottom: 0;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media screen and (max-width: 1024px) {
    .menu-toggle {
        display: block;
    }
    #top_slider .nav ul.mobile-active {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(18, 18, 18, 0.98);
        z-index: 1000;
        margin: 0;
        padding: 20px;
        clear: both;
        list-style: none;
        box-sizing: border-box;
        animation: mobileMenuFade 0.3s ease-out forwards;
    }
    
    @keyframes mobileMenuFade {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    #top_slider .nav ul.mobile-active li {
        display: block;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 15px 0;
        width: 100%;
        max-width: 300px;
        text-align: center;
        margin: 0;
        opacity: 0;
        animation: mobileMenuItemFade 0.4s ease-out forwards;
    }

    @keyframes mobileMenuItemFade {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }

    #top_slider .nav ul.mobile-active li:nth-child(1) { animation-delay: 0.1s; }
    #top_slider .nav ul.mobile-active li:nth-child(2) { animation-delay: 0.15s; }
    #top_slider .nav ul.mobile-active li:nth-child(3) { animation-delay: 0.2s; }
    #top_slider .nav ul.mobile-active li:nth-child(4) { animation-delay: 0.25s; }
    #top_slider .nav ul.mobile-active li:nth-child(5) { animation-delay: 0.3s; }
    #top_slider .nav ul.mobile-active li:nth-child(n+6) { animation-delay: 0.35s; }

    #top_slider .nav ul.mobile-active li:last-child {
        border-bottom: none;
    }
    #top_slider .nav ul.mobile-active li a {
        font-size: 1.4em;
        color: #fff;
        text-decoration: none;
        display: block;
        text-transform: uppercase;
        font-weight: 500;
        letter-spacing: 1px;
        transition: color 0.2s;
    }
    #top_slider .nav ul.mobile-active li a:active {
        color: #64A4DD;
    }
}
