/*
 * Mobile Responsive Styles for Casino Belarus
 * Mobile-first approach - base styles for mobile, then scale up
 */

/* ====== MOBILE MENU BUTTON ====== */
.mobile-menu-toggle {
    display: none;
    background: #6a4f3a;
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    cursor: pointer;
    position: fixed;
    border-radius: 3px;
    z-index: 1000;
    top: 15px;
    right: 15px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    margin: 5px auto;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ====== MOBILE MENU OVERLAY ====== */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ====== MOBILE NAVIGATION DRAWER ====== */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    max-height: 100%;
    background: #fff;
    z-index: 1001;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-header {
    background: #6a4f3a;
    color: #fff;
    padding: 15px;
    padding-right: 50px;
    font-size: 18px;
    font-family: "Times New Roman", Times, serif;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-nav-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 5px 10px;
    min-width: 44px;
    min-height: 44px;
}

.mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-bottom: 50px; /* Extra space at bottom for scrolling */
}

.mobile-nav ul li {
    border-bottom: 1px solid #eee;
}

.mobile-nav ul li a {
    display: block;
    padding: 15px 20px;
    color: #6a4f3a;
    font-size: 16px;
    text-decoration: none;
    transition: background 0.2s;
    min-height: auto;
}

.mobile-nav ul li a:hover,
.mobile-nav ul li a:active {
    background: #f5f5f5;
    color: #EF014C;
}

.mobile-nav .nav-section-title {
    background: #f9f9f9;
    padding: 10px 20px;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
}

.mobile-search-form {
    padding: 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.mobile-search-form input[type="text"] {
    width: calc(100% - 50px);
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 3px 0 0 3px;
    font-size: 16px; /* Prevents zoom on iOS */
    float: left;
    -webkit-appearance: none;
}

.mobile-search-form button {
    width: 50px;
    height: 42px;
    padding: 10px;
    background: #6a4f3a;
    color: #fff;
    border: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    float: left;
}

.mobile-search-form::after {
    content: '';
    display: table;
    clear: both;
}

/* Mobile nav content wrapper - scrollable */
.mobile-nav-content {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
}

/* ====== RESPONSIVE BREAKPOINTS ====== */

/* Tablet and smaller (< 1024px) */
@media screen and (max-width: 1024px) {
    .wrapper {
        width: 95% !important;
        max-width: 960px;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    /* ===== HEADER CLEANUP ===== */
    #header {
        height: auto !important;
        min-height: 80px;
        background: url(images/body.png) repeat-x top !important;
        padding-bottom: 10px;
    }
    
    #header .wrapper {
        position: relative;
    }
    
    /* Hide all desktop navigation and decorative elements */
    .first_header_menu,
    .second_header_menu,
    .search,
    .cubes,
    .cards,
    .line,
    .line_second,
    .header_links {
        display: none !important;
    }
    
    /* Keep only logo visible */
    .logo {
        margin: 10px 0 0 0 !important;
        float: left !important;
    }
    
    hgroup {
        display: block;
    }
    
    /* Show mobile menu elements */
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-nav,
    .mobile-menu-overlay {
        display: block;
    }
    
    /* ===== CONTENT AREA ===== */
    #center {
        width: 100% !important;
        float: none !important;
    }
    
    #sidebar {
        width: 100% !important;
        float: none !important;
        margin: 20px 0 !important;
    }
    
    .content {
        margin: 10px 0 20px !important;
    }
    
    .content_top {
        margin: 10px 0 15px !important;
        display: none; /* Hide widgets on main page */
    }
    
    .breadcrumbs {
        width: 100% !important;
        margin: 10px 0 !important;
        font-size: 12px;
        position: static !important;
        z-index: 1;
    }
    
    /* ===== POST GRIDS ===== */
    .widget {
        width: 100% !important;
        height: auto !important;
        margin: 0 0 15px !important;
    }
    
    .post {
        width: calc(50% - 10px) !important;
        margin: 0 5px 15px !important;
        height: auto !important;
        float: left !important;
    }
    
    .post_img {
        width: 100% !important;
        height: auto !important;
    }
    
    .post_img img {
        width: 100%;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
    
    .post_title {
        width: 100% !important;
        height: auto !important;
        min-height: 50px;
        padding: 10px !important;
        box-sizing: border-box;
    }
    
    .post_title a {
        font-size: 13px !important;
        line-height: 1.3 !important;
    }
    
    .tabs_second .post,
    .tabs_fourth .post {
        width: calc(50% - 10px) !important;
        margin: 0 5px 15px !important;
    }
    
    .tabs_second .post .post_img,
    .tabs_fourth .post .post_img {
        width: 100% !important;
    }
    
    .tabs_second .post .post_title,
    .tabs_fourth .post .post_title {
        width: 100% !important;
    }
    
    /* ===== TABS & CAROUSELS ===== */
    .tabs {
        width: 100% !important;
        clear: both;
    }
    
    .tabs_link {
        height: auto !important;
        overflow: visible !important;
        margin-bottom: 15px;
    }
    
    .tabs_link ul {
        width: 100% !important;
        display: flex;
        justify-content: center;
        margin: 0 auto;
    }
    
    .tabs_link ul:before,
    .tabs_link ul:after {
        display: none !important;
    }
    
    .tabs_link ul li {
        display: inline-block;
    }
    
    .tabs_link ul li a {
        font-size: 18px !important;
        padding: 5px 15px !important;
        display: block;
    }
    
    /* Make carousel items clickable and scrollable */
    .tabs_box {
        width: 100% !important;
        overflow: visible !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start;
        margin: 0 -5px !important;
    }
    
    .tabs_box ul,
    .mycarousel {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .tabs_box ul li,
    .mycarousel li {
        flex: 0 0 auto;
        width: calc(50% - 10px) !important;
        margin: 0 5px 15px !important;
    }
    
    .mycarousel li .post {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Ensure links are clickable */
    .post a,
    .post_img a,
    .post_title a {
        pointer-events: auto !important;
        cursor: pointer !important;
        display: block;
    }
    
    .jcarousel-clip {
        width: 100% !important;
        overflow: visible !important;
    }
    
    .jcarousel-prev,
    .jcarousel-next {
        display: none !important;
    }
    
    /* ===== FOOTER ===== */
    footer {
        height: auto !important;
        padding-bottom: 20px;
    }
    
    .footer_logo {
        width: 100%;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .footer_logo p,
    .footer_logo span {
        position: static !important;
        display: block;
        margin-top: 10px;
    }
    
    .footer_img {
        display: none;
    }
    
    .footer_menu {
        width: 48% !important;
        margin: 0 1% 10px !important;
    }
    
    .phone,
    .mail,
    .developer {
        float: none !important;
        clear: both !important;
        text-align: center;
        margin: 10px 0 !important;
    }
    
    .social {
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .social a {
        float: none !important;
        display: inline-block;
        margin: 0 5px;
    }
    
    /* ===== RELATED POSTS ===== */
    .related_box {
        width: 100% !important;
    }
    
    .related {
        width: 48% !important;
        margin: 0 1% 15px !important;
    }
    
    /* ===== GALLERY ===== */
    .gallery {
        width: 100% !important;
        height: auto !important;
        margin: 0 0 20px !important;
    }
    
    /* ===== CONTENT PAGES ===== */
    .content_page .main,
    .content_single .main,
    .content_sitemap .main {
        width: 95% !important;
        padding: 20px 2.5%;
    }
    
    .main img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .alignleft,
    img.alignleft,
    .alignright,
    img.alignright {
        float: none !important;
        display: block;
        margin: 15px auto !important;
    }
    
    /* Address block */
    .adress_block .a_b {
        width: 48% !important;
        margin-bottom: 15px;
    }
    
    /* Features list */
    .features li {
        width: 100% !important;
    }
    
    /* Top block */
    .top {
        width: 100% !important;
        height: auto !important;
        padding: 20px !important;
        background-size: cover !important;
    }
    
    .top p {
        width: 100% !important;
    }
    
    /* Category page list items */
    .content_page .main ul li {
        width: 100% !important;
        padding-right: 0 !important;
    }
    
    /* Comments form */
    #commentform input[type="text"],
    #commentform textarea {
        width: 100% !important;
        box-sizing: border-box;
    }
}

/* Mobile (< 768px) */
@media screen and (max-width: 768px) {
    body {
        background-size: 100% auto !important;
    }
    
    .wrapper {
        width: 100% !important;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    #header {
        min-height: 70px;
        padding-bottom: 10px;
    }
    
    .logo {
        margin: 8px 0 0 5px !important;
        transform: scale(0.9);
        transform-origin: left top;
    }
    
    /* Post cards - 2 columns */
    .post {
        width: calc(50% - 10px) !important;
        margin: 0 5px 15px !important;
    }
    
    .tabs_box ul li,
    .mycarousel li {
        width: calc(50% - 10px) !important;
    }
    
    .tabs_second .post,
    .tabs_fourth .post {
        width: calc(50% - 10px) !important;
    }
    
    /* Footer */
    .footer_menu {
        width: 100% !important;
        margin: 0 0 15px !important;
        text-align: center;
    }
    
    .footer_menu ul li {
        width: 100%;
        text-align: center;
    }
    
    /* Related posts */
    .related {
        width: 100% !important;
        margin: 0 0 15px !important;
    }
    
    .related img {
        width: 100%;
        max-height: none !important;
        min-height: auto !important;
    }
    
    /* Sidebar */
    #sidebar {
        padding: 0 10px;
    }
    
    .sidebar_banner img {
        width: 100%;
        height: auto;
    }
    
    .sb_title p {
        font-size: 20px !important;
    }
    
    .block_sb {
        width: 100%;
    }
    
    .line_sb {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    /* Address block */
    .adress_block .a_b {
        width: 100% !important;
    }
    
    /* Main content */
    .main h1,
    .main h2 {
        font-size: 20px !important;
        line-height: 1.3 !important;
        background: none !important;
    }
    
    .main h1 span,
    .main h2 span {
        background: #fff;
        padding: 0 5px;
    }
    
    .main p {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }
    
    /* Tabs */
    .tabs_link ul li a {
        font-size: 16px !important;
        padding: 5px 12px !important;
    }
    
    /* Pagination */
    .wp-pagenavi {
        padding: 20px 0 0 !important;
    }
    
    .wp-pagenavi .page,
    .wp-pagenavi .current {
        margin: 0 2px !important;
    }
    
    /* Post small */
    .post_small {
        height: auto !important;
        padding: 15px 0;
    }
    
    .post_large {
        height: auto !important;
    }
    
    /* Error 404 */
    .error404 {
        width: 100% !important;
        padding: 0 15px !important;
        box-sizing: border-box;
    }
    
    .error404_img {
        display: none;
    }
    
    .error404 h1 {
        font-size: 24px !important;
        margin-top: 30px !important;
    }
    
    /* Fotorama gallery */
    .fotorama {
        width: 100% !important;
    }
}

/* Small mobile (< 480px) */
@media screen and (max-width: 480px) {
    .wrapper {
        padding: 0 8px;
    }
    
    #header {
        min-height: 60px;
    }
    
    .logo {
        transform: scale(0.75);
        transform-origin: left top;
        margin: 5px 0 0 5px !important;
    }
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
        margin: 4px auto;
    }
    
    /* Post cards - 2 columns still, but smaller gaps */
    .post {
        width: calc(50% - 6px) !important;
        margin: 0 3px 10px !important;
    }
    
    .tabs_box ul li,
    .mycarousel li {
        width: calc(50% - 6px) !important;
        margin: 0 3px 10px !important;
    }
    
    .tabs_second .post,
    .tabs_fourth .post {
        width: calc(50% - 6px) !important;
        margin: 0 3px 10px !important;
    }
    
    .post_title {
        padding: 8px !important;
        min-height: 40px;
    }
    
    .post_title a {
        font-size: 12px !important;
    }
    
    /* Tabs */
    .tabs_link ul li a {
        font-size: 14px !important;
        padding: 5px 10px !important;
    }
    
    /* Footer */
    .footer_logo {
        background-size: contain !important;
    }
    
    .phone {
        font-size: 20px !important;
    }
    
    /* Main content */
    .main h1,
    .main h2 {
        font-size: 18px !important;
    }
    
    .main p {
        font-size: 14px !important;
    }
    
    /* Sidebar posts */
    .post_sb {
        margin-bottom: 12px !important;
    }
    
    .post_sb a {
        font-size: 15px !important;
    }
    
    /* Content */
    .content_page .main,
    .content_single .main,
    .content_sitemap .main {
        padding: 15px 3%;
    }
    
    /* Line item */
    .line_item {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    /* Breadcrumbs */
    .breadcrumbs {
        font-size: 11px;
        margin: 5px 0 10px !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Comment form */
    #commentform p {
        margin-bottom: 10px;
    }
    
    #commentform label {
        display: block;
        margin-bottom: 5px;
    }
}

/* Landscape phones */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .post,
    .tabs_box ul li,
    .mycarousel li {
        width: calc(33.333% - 10px) !important;
    }
    
    .tabs_second .post,
    .tabs_fourth .post {
        width: calc(33.333% - 10px) !important;
    }
}

/* Fix for iOS tap highlighting */
@media screen and (max-width: 1024px) {
    a, button, input, select, textarea {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Image responsiveness global */
img {
    max-width: 100%;
    height: auto;
}

/* Poll widget fix */
@media screen and (max-width: 768px) {
    .wp-polls-ul {
        padding: 0 10px;
    }
    
    .wp-polls-ul li {
        padding: 8px 0;
    }
}

/* Clearfix for floats */
.tabs_box::after,
.mycarousel::after {
    content: '';
    display: table;
    clear: both;
}

/* Ensure all post links are touchable */
@media screen and (max-width: 1024px) {
    .post,
    .post a,
    .post img {
        -webkit-touch-callout: none;
        touch-action: manipulation;
    }
    
    /* Remove any transform that might block clicks */
    .post_img a,
    .post_title a {
        position: relative;
        z-index: 1;
    }
}


