/* ============================================================
   MOBILE RESPONSIVE — serieskodhit.com
   Breakpoints: 768px (tablet), 480px (phone)
   ============================================================ */

/* ---------- Tablet (≤1024px) ---------- */
@media (max-width: 1024px) {
    #wrap { width: 100% !important; overflow-x: hidden; }
    .content-main { width: 78%; }
    .content-right { width: 22%; }
    .movie { width: 33.33%; }
}

/* ---------- Mobile (≤767px) ---------- */
@media (max-width: 767px) {

    /* === Global === */
    html { overflow-x: clip; }          /* ป้องกัน horizontal scroll โดยไม่ตัด momentum scroll */
    body { font-size: 15px; -webkit-overflow-scrolling: touch; }
    #wrap { width: 100% !important; overflow-x: hidden; }

    /* === Global image responsive === */
    img { max-width: 100% !important; height: auto !important; }

    /* === Header === */
    .header {
        display: flex;
        align-items: center;
        padding: 8px;
        background-image: none;
        background-color: #00174f;
    }
    .header-left {
        width: 60px !important;
        flex-shrink: 0;
        padding: 0;
    }
    .header-left > div {
        height: 60px !important;
        display: flex;
        align-items: center;
    }
    .header-left img { max-height: 55px; width: auto; }
    .header-right {
        width: calc(100% - 70px) !important;
        padding: 0 8px;
        text-align: left;
    }
    .header-title {
        float: none;
        font-size: 13px;
        margin: 0;
    }
    .header-title a { color: #fff !important; }
    .header-social { display: none; }

    /* === Navigation — horizontal scroll === */
    .navbar { margin-bottom: 0; min-height: 0; padding: 0; }
    .nav {
        display: flex !important;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        margin: 0 !important;
        padding: 0 !important;
        scrollbar-width: none;
        gap: 2px;
        background: #a5a01b;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav li { float: none !important; flex-shrink: 0; }
    .nav li a {
        font-size: 14px !important;
        padding: 10px 14px !important;
        white-space: nowrap;
    }

    /* === Layout — single column === */
    .content-left  { display: none; }
    .content-main  { width: 100% !important; float: none !important; padding: 4px !important; }
    .content-right { width: 100% !important; float: none !important; padding: 4px !important; }

    /* === Movie Cards Grid — 2 columns === */
    .movie { width: 50% !important; padding: 3px; }
    .movie-box { height: 260px; }
    .movie-box .movie-title { height: 50px; }
    .movie-box .movie-title > a { font-size: 14px; line-height: 1.3; }
    .movie-footer { font-size: 13px; padding: 6px 4px; }
    .movie-corner { width: 60px; font-size: 11px; top: 8px; right: -16px; }

    /* === Box / Section Header === */
    .box-header, .box h3 { font-size: 15px; padding: 8px 10px; }

    /* === Movie Detail Page === */
    .title { width: 100% !important; }
    .movie-header { display: block; }

    .movie-thumbnail {
        width: 110px !important;
        height: 160px !important;
        float: left;
        margin: 6px;
    }
    .movie-thumbnail img {
        border-radius: 4px;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .movie-trailer {
        width: calc(100% - 130px) !important;
        height: 160px !important;
        float: left;
    }
    .movie-trailer iframe {
        border-radius: 0 4px 4px 0;
    }

    /* Play / Sound buttons */
    .filmicerik { padding: 4px 6px; }
    .sound_path, .btn {
        font-size: 13px !important;
        padding: 7px 10px !important;
        margin: 2px !important;
        border-radius: 4px;
    }

    /* === Description === */
    .description { padding: 8px 10px; font-size: 14px; line-height: 1.7; }
    .description h2 { font-size: 16px; }

    /* === Tags === */
    .content-tags { padding: 8px; font-size: 14px; }
    .content-tags a {
        display: inline-block;
        padding: 5px 10px;
        background: #1e3a5f;
        border: 1px solid #6ba2e0;
        border-radius: 20px;
        margin: 3px;
        color: #6ba2e0;
        font-size: 13px;
        line-height: 1.4;
    }
    .content-tags a:hover { background: #6ba2e0; color: #000; text-decoration: none; }

    /* === Sidebar (when shown on mobile) === */
    .sidebar ul li { width: 50% !important; }
    .sidebar h2 { font-size: 16px; }
    .sidebar ul li a { font-size: 14px; padding: 8px 8px 8px 14px; }

    /* === Ads / Notice bar === */
    .notice {
        padding: 6px 4px;
        font-size: 13px;
        text-align: center;
        overflow: hidden;
    }
    .notice img {
        width: 100% !important;
        height: auto !important;
        max-width: 547px;
        display: block;
        margin: 0 auto;
        border-radius: 6px;
    }
    .notice a {
        display: block;
        line-height: 0;
    }
    .btn-ads { width: 95% !important; font-size: 14px; padding: 10px; }

    /* === Actions bar === */
    .actions .facebook-like-button,
    .actions .facebook-share-button,
    .actions .vote { padding: 6px; }

    /* === Facebook Comments === */
    .fb-comments { width: 100% !important; }

    /* === Pagination === */
    .pagination { flex-wrap: wrap; justify-content: center; gap: 4px; }
    .pagination li a,
    .pagination li span { padding: 6px 10px; font-size: 14px; }

    /* === Footer === */
    .footerleft { width: 100% !important; float: none; text-align: center; }
    .footeright { width: 100% !important; float: none; text-align: center; }
    #footer p { text-align: center; font-size: 12px; padding: 6px 0; }

    /* === Breadcrumb === */
    #content .breadcrumb { display: none; }

    /* === Random movie section === */
    .random-movie .movie { width: 50%; }

    /* === Search box === */
    .header-search { max-width: 100%; width: 100%; margin-top: 4px; }
}

/* ---------- Small phones (≤420px) ---------- */
@media (max-width: 420px) {
    .movie { width: 50% !important; }
    .movie-box { height: 220px; }
    .movie-box .movie-title > a { font-size: 13px; }

    .movie-thumbnail {
        width: 90px !important;
        height: 135px !important;
    }
    .movie-trailer {
        width: calc(100% - 106px) !important;
        height: 135px !important;
    }

    .nav li a { font-size: 13px !important; padding: 9px 11px !important; }
    .box-header, .box h3 { font-size: 14px; }
}
