/* ============================================================
   GRANDBET88 — Responsive Overrides
   Berdasarkan CSS asli grandbet88sumut.com
   Breakpoints:
     xs  : < 576px   (HP portrait)
     sm  : 576–767px (HP landscape)
     md  : 768–991px (tablet)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; }

/* ══════════════════════════════════════════════════════════════
   MOBILE (< 768px) — HP Portrait & Landscape
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {

    /* ── Topbar ──────────────────────────────────────────────── */
    .topbar-container {
        height: 50px !important;
        min-height: 50px !important;
        padding: 8px 0 !important;
    }
    .topbar-container .container { padding: 0 8px !important; }
    .topbar-left-container  { gap: 4px !important; }
    .topbar-right-container { gap: 4px !important; }
    .language-name { display: none !important; }
    .download-apk-btn span { display: none !important; }

    /* Login / Daftar buttons */
    .login-panel-item .login-button {
        background: linear-gradient(rgb(106,106,106) 0%, rgb(70,70,70) 100%) !important;
        color: #fff !important;
        font-size: 12px !important;
        padding: 3px 10px !important;
        border-radius: 15px !important;
        white-space: nowrap !important;
        min-height: 30px !important;
    }
    .login-panel-item .register-button {
        background: linear-gradient(rgb(253,166,1) 0%, rgb(204,113,0) 100%) !important;
        color: #fff !important;
        font-size: 12px !important;
        padding: 3px 10px !important;
        border-radius: 15px !important;
        white-space: nowrap !important;
        min-height: 30px !important;
    }

    /* User info (logged in) */
    .user-info { gap: 4px !important; flex-wrap: nowrap !important; }
    .user-info-item { gap: 2px !important; }
    .user-info-icon { width: 22px !important; height: 22px !important; }
    .balance a { font-size: 11px !important; }
    .lp-label { font-size: 9px !important; padding: 0 2px !important; }
    .loyalty_point { font-size: 10px !important; }
    #redemption_store_link { display: none !important; }
    .vendor-balances-container { right: 0 !important; left: auto !important; }

    /* ── Site Header — logo full width seperti asli ──────────── */
    .site-header { padding: 0 !important; }
    .site-header .container { padding: 0 !important; max-width: 100% !important; }
    .site-header .row {
        flex-direction: column !important;
        align-items: stretch !important;
        margin: 0 !important;
    }
    /* Logo column — full width */
    .site-header .col-sm-3,
    .site-header .col-md-3 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    .logo {
        display: block !important;
        width: 100% !important;
        padding-top: calc((100% * 68/300) + 12px) !important;
    }
    .logo img {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: auto !important;
        max-width: 90% !important;
        height: auto !important;
    }
    /* Nav column — full width di bawah logo */
    .site-header .col-sm-9,
    .site-header .col-md-9 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    /* ── Top Menu ────────────────────────────────────────────── */
    .menu-slide {
        overflow: hidden !important;
        height: 111px !important;
    }
    .top-menu {
        overflow-x: auto !important;
        overflow-y: visible !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 0 !important;
        height: 111px !important;
    }
    .top-menu::-webkit-scrollbar { display: none !important; }
    .top-menu > li {
        flex: 1 0 9.09091% !important;
        min-width: 36px !important;
    }
    .top-menu > li > a {
        display: block !important;
        padding: 10px 0 5px !important;
        font-size: 10px !important;
        text-align: center !important;
        height: 111px !important;
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.2 !important;
    }
    .top-menu > li > a img {
        width: 30px !important;
        height: 30px !important;
        display: block !important;
        margin: 0 auto 6px !important;
    }
    /* Force icon via CSS variable */
    .top-menu > li > a i[data-icon] {
        display: inline-block !important;
        width: 30px !important;
        height: 30px !important;
        background-image: var(--image-src) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    .top-menu > li[data-active="true"] > a i[data-icon] {
        background-image: var(--active-image-src) !important;
    }
    /* Trigger arrows */
    .left_trigger, .right_trigger {
        display: flex !important;
        align-items: center !important;
        padding: 0 4px !important;
        font-size: 16px !important;
        cursor: pointer !important;
        z-index: 2 !important;
        color: #fff !important;
        background: rgba(0,0,0,0.5) !important;
        height: 111px !important;
    }
    /* Game list dropdown */
    .top-menu > li .game-list {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        background: #1a1a1a !important;
        padding: 8px !important;
        gap: 6px !important;
        border-radius: 12px 12px 0 0 !important;
        border-top: 2px solid #c0392b !important;
    }
    .top-menu > li .game-list li { width: calc(25% - 6px) !important; min-width: 60px !important; }

    /* ── Banner ──────────────────────────────────────────────── */
    .swiper-wrapper, .banner-container,
    [class*="banner"] .swiper { width: 100% !important; }
    [class*="swiper-slide"] img,
    [class*="banner"] img { width: 100% !important; height: auto !important; }

    /* ── Game Grid — 4 kolom seperti asli ───────────────────── */
    .game-items-container,
    .provider-games-container,
    [class*="games-grid"],
    [class*="game-grid"] {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px !important;
    }

    /* ── Main Content ────────────────────────────────────────── */
    .site-content-container { padding: 0 !important; }
    .standard-main-container { padding: 0 8px !important; }
    .container { padding-left: 8px !important; padding-right: 8px !important; }

    /* ── Account pages ───────────────────────────────────────── */
    .player-account-section { display: flex !important; flex-direction: column !important; gap: 0 !important; }
    .standard-side-menu {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        padding: 8px 8px 0 !important;
        gap: 0 !important;
        border-right: none !important;
        border-bottom: 2px solid #2a0000 !important;
        background: #120000 !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .standard-side-menu::-webkit-scrollbar { display: none !important; }
    .standard-side-menu .nav-item,
    .standard-side-menu li,
    .standard-side-menu a {
        flex-shrink: 0 !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        border-radius: 4px 4px 0 0 !important;
        white-space: nowrap !important;
    }
    .standard-main-content { width: 100% !important; max-width: 100% !important; padding: 12px 8px !important; }
    .profile-container { flex-direction: column !important; }
    .top-tab-container { overflow-x: auto !important; flex-wrap: nowrap !important; scrollbar-width: none !important; }
    .top-tab-container::-webkit-scrollbar { display: none !important; }

    /* ── Footer ──────────────────────────────────────────────── */
    footer .container { padding: 0 8px !important; }
    footer .row > [class*="col-"] {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 16px !important;
    }
    [class*="provider-logos"] img,
    [class*="payment-logos"] img,
    [class*="license-logos"] img {
        max-height: 28px !important;
        width: auto !important;
    }

    /* ── Modal ───────────────────────────────────────────────── */
    .modal-dialog { margin: 8px !important; max-width: calc(100vw - 16px) !important; }
    .modal-content { border-radius: 8px !important; }
    .login-modal .modal-body,
    .register-modal .modal-body { padding: 12px !important; }
    .standard-sub-section { padding: 8px !important; }
    .phone-input-group { width: 100% !important; }
    .copy-input-button-field { flex: 1 !important; }

    /* ── Tables ──────────────────────────────────────────────── */
    .table-responsive, table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
    }

    /* ── Deposit form ────────────────────────────────────────── */
    .deposit-amount-range { flex-wrap: wrap !important; gap: 6px !important; }

    /* ── Typography ──────────────────────────────────────────── */
    h1 { font-size: 1.4rem !important; }
    h2 { font-size: 1.2rem !important; }
    h3 { font-size: 1.1rem !important; }
    .row { margin-left: 0 !important; margin-right: 0 !important; }
    [class*="col-"] { padding-left: 4px !important; padding-right: 4px !important; }

    /* ── Bottom Nav ──────────────────────────────────────────── */
    body { padding-bottom: 56px !important; }
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 56px !important;
        background: #120000 !important;
        border-top: 1px solid #3d0000 !important;
        z-index: 1000 !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 0 4px !important;
    }
    .mobile-bottom-nav a {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        color: #aaa !important;
        font-size: 9px !important;
        text-decoration: none !important;
        gap: 2px !important;
        flex: 1 !important;
        padding: 4px 0 !important;
    }
    .mobile-bottom-nav a:hover,
    .mobile-bottom-nav a.active { color: #e74c3c !important; }
    .mobile-bottom-nav a i { font-size: 18px !important; line-height: 1 !important; }
    .mobile-bottom-nav a span { line-height: 1 !important; }

    /* ── Touch targets ───────────────────────────────────────── */
    a, button, [role="button"],
    input[type="submit"], input[type="button"] { min-height: 36px !important; }
    .game-item:hover .game-overlay,
    .game-card:hover .overlay { opacity: 1 !important; }
}

/* ══════════════════════════════════════════════════════════════
   TABLET (768px – 991px)
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 991.98px) {

    /* Bottom nav hidden di tablet */
    .mobile-bottom-nav { display: none !important; }
    body { padding-bottom: 0 !important; }

    /* Topbar */
    .topbar-container .container { padding: 0 8px !important; }
    .language-name { display: none !important; }

    /* Site header */
    .site-header .container { padding: 0 8px !important; }
    .site-header .row { flex-wrap: nowrap !important; align-items: center !important; }
    .site-header .col-sm-3, .site-header .col-md-3 {
        width: 120px !important;
        flex: 0 0 120px !important;
        max-width: 120px !important;
    }
    .site-header .col-sm-9, .site-header .col-md-9 {
        width: calc(100% - 120px) !important;
        flex: 1 !important;
        max-width: calc(100% - 120px) !important;
    }

    /* Top menu */
    .top-menu {
        overflow-x: auto !important;
        scrollbar-width: none !important;
        gap: 0 !important;
    }
    .top-menu::-webkit-scrollbar { display: none !important; }
    .top-menu > li > a {
        padding: 8px 10px !important;
        font-size: 11px !important;
        flex-direction: column !important;
    }
    .top-menu > li > a img { width: 24px !important; height: 24px !important; }

    /* Game grid — 4 kolom */
    .game-items-container,
    .provider-games-container,
    [class*="games-grid"],
    [class*="game-grid"] {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    /* Content */
    .site-content-container { padding: 0 !important; }
    .container { padding-left: 8px !important; padding-right: 8px !important; }

    /* Account */
    .profile-container { flex-direction: column !important; }
    .standard-main-content { width: 100% !important; max-width: 100% !important; padding: 12px 8px !important; }
    .standard-side-menu {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        border-right: none !important;
        border-bottom: 2px solid #2a0000 !important;
    }
    .standard-side-menu::-webkit-scrollbar { display: none !important; }

    /* Game list dropdown */
    .top-menu > li .game-list {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        background: #1a1a1a !important;
        padding: 8px !important;
        gap: 6px !important;
        border-radius: 12px 12px 0 0 !important;
        border-top: 2px solid #c0392b !important;
    }
    .top-menu > li .game-list li { width: calc(25% - 6px) !important; }

    /* Footer */
    footer .row > [class*="col-"] {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 16px !important;
    }
    .top-tab-container { overflow-x: auto !important; scrollbar-width: none !important; }
    .top-tab-container::-webkit-scrollbar { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   DESKTOP (≥ 992px) — sembunyikan mobile-only elements
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 992px) {
    .mobile-bottom-nav { display: none !important; }
    body { padding-bottom: 0 !important; }
}

/* ══════════════════════════════════════════════════════════════
   SLOTS PROVIDER — filter bar responsive
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    [class*="provider-filter"],
    [class*="search-bar"] { flex-wrap: wrap !important; gap: 8px !important; }
    [class*="provider-filter"] input,
    [class*="search-bar"] input { width: 100% !important; }
}
