/* ============================================================
   Home (Classic) — หน้าแรกเวอร์ชั่นเก่า (อิงจาก aio/content/hot-game)
   ใช้เฉพาะหน้า home_page_classic.php
   ทุก rule scope ใต้ .theme1-home-classic เพื่อไม่กระทบหน้าอื่น
   และให้ specificity สูงกว่าเพื่อทับ CSS หลักของ theme_1
   ============================================================ */

/* ---------- container ---------- */
.theme1-home-classic .x-category-provider {
    min-height: 500px;
    height: auto;
}

.theme1-home-classic .x-category-provider .-games-list-container {
    padding: 0 1rem 2rem;
}

@media (max-width: 991.98px) {
    .theme1-home-classic .x-category-provider .-games-list-container {
        padding-bottom: 1rem;
    }
}

@media (max-width: 767.98px) {
    .theme1-home-classic .x-category-provider .-games-list-container {
        padding-right: 0;
        padding-left: 0;
    }
}

.theme1-home-classic .x-category-provider .-games-list-container .nav-menu {
    overflow: hidden;
}

/* ---------- ตัววิ่ง (marquee) + ระยะห่างด้านบน ---------- */
.theme1-home-classic .theme1-classic-marquee {
    position: relative;
    z-index: 3;
}

.theme1-home-classic .theme1-classic-marquee.-mobile {
    margin-top: 0.75rem;
}

/* เว้นระยะหัวข้อ/แบนเนอร์จากด้านบน (กันชิด header) */
.theme1-home-classic .x-category.-total-game.-v2 {
    margin-top: 1.25rem;
}

@media (max-width: 767.98px) {
    .theme1-home-classic .x-category.-total-game.-v2 {
        margin-top: 0.85rem;
    }
}

/* ระยะห่างซ้าย-ขวา (gutter) ของแบนเนอร์ ให้เหมือนหน้าใหม่ — มือถือ/แท็บเล็ต
   (ตัววิ่งยังคงเต็มกว้าง ไม่ใส่ gutter) */
@media (max-width: 991.98px) {
    .theme1-home-classic .js-home-banner-outer {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}

/* ============================================================
   Layout: แบนเนอร์เต็มกว้างด้านบน + เมนูหมวด (มือถือ) ซ้าย | เกม ขวา
   อิงโครงสร้างเว็บเวอร์ชั่นเก่า (banner เต็มกว้าง แล้ว flex [menu|games])
   - Desktop (≥992px): ใช้ global sidebar ของ template, เมนูนี้ซ่อน (d-lg-none)
   - Mobile (≤991.98px): เมนูนี้แสดงเป็นคอลัมน์ซ้าย, เกมอยู่ขวา
   ============================================================ */
.theme1-home-classic .theme1-classic-body {
    display: block;
}

.theme1-home-classic .theme1-classic-content {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .theme1-home-classic .theme1-classic-body {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        margin-top: 1.25rem;
        padding: 0 0.85rem;
    }

    .theme1-home-classic .theme1-classic-sidemenu {
        flex: 0 0 20%;
        max-width: 20%;
        position: -webkit-sticky;
        position: sticky;
        top: 70px;
    }

    .theme1-home-classic .theme1-classic-content {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* เกมอยู่ในคอลัมน์ขวาแล้ว ไม่ต้องมี padding ซ้าย/ขวาซ้ำ */
    .theme1-home-classic .theme1-classic-content .x-category-provider .-games-list-container {
        padding-right: 0;
        padding-left: 0;
    }

    /* ---------- ปุ่มเมนูหมวด (มือถือ) ---------- */
    .theme1-home-classic .theme1-classic-sidemenu .nav-menu {
        overflow: visible;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav.nav-pills {
        display: flex;
        flex-direction: column;
        gap: 0.7rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-item {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 82px;
        padding: 0.6rem 0.25rem;
        text-align: center;
        text-decoration: none;
        border: 1px solid color-mix(in srgb, var(--st-color-1, #6793e9) 34%, transparent);
        border-radius: 14px;
        background: linear-gradient(180deg, var(--st-color-4, #24416b), var(--st-color-5, #0c1c42));
        box-shadow: 0 8px 16px rgba(2, 9, 28, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
        transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-link .-ic-menu {
        width: 40px;
        height: auto;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-link .-text-provider-wrapper {
        width: 100%;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-link .-text-nav-menu.-title-mobile {
        margin: 0;
        font-size: 0.84rem;
        font-weight: 400;
        line-height: 1.18;
        color: rgba(228, 236, 255, 0.9);
        text-shadow: none;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-link.active {
        border-color: color-mix(in srgb, var(--st-color-1, #afd9ff) 74%, transparent);
        background: linear-gradient(180deg, var(--st-color-2, #3a84ea) 0%, var(--st-color-4, #1d4f9a) 100%);
        box-shadow: 0 12px 22px rgba(5, 16, 43, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-link.active .-text-nav-menu.-title-mobile {
        color: #fff;
    }
}

@media (max-width: 575.98px) {
    .theme1-home-classic .theme1-classic-sidemenu {
        flex-basis: 23%;
        max-width: 23%;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-link {
        min-height: 74px;
        padding: 0.5rem 0.2rem;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-link .-ic-menu {
        width: 36px;
    }

    .theme1-home-classic .theme1-classic-sidemenu .nav-link .-text-nav-menu.-title-mobile {
        font-size: 0.76rem;
    }
}

/* ---------- grid (nav-pills) ---------- */
.theme1-home-classic .x-category-provider .nav-menu .nav.nav-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin: 0;
    padding-left: 0;
    list-style: none;
}

@media (max-width: 767.98px) {
    .theme1-home-classic .-games-list-container .nav {
        padding-right: 0.375rem;
        padding-left: 0.375rem;
    }
}

.theme1-home-classic .-games-list-container .nav .nav-item {
    margin-bottom: 1.5rem;
    padding: 0 0.65rem;
}

@media (max-width: 991.98px) {
    .theme1-home-classic .-games-list-container .nav .nav-item {
        margin-bottom: 1rem;
    }
}

/* คาสิโน + เล่นล่าสุด : 4 ต่อแถว */
.theme1-home-classic .-games-list-container .nav .nav-item.-game-casino-macro-container {
    width: 25%;
    padding: 0 0.5rem;
    margin: 1rem 0 0.25rem;
}

@media (max-width: 767.98px) {
    .theme1-home-classic .-games-list-container .nav .nav-item.-game-casino-macro-container {
        width: 50%;
        padding: 0 0.375rem;
    }
}

@media (max-width: 350px) {
    .theme1-home-classic .-games-list-container .nav .nav-item.-game-casino-macro-container {
        padding: 0 0.25rem;
    }
}

/* สล็อต : 7 ต่อแถว */
.theme1-home-classic .-games-list-container .nav .nav-item.-game-slot-macro-container {
    width: 14.2%;
    padding: 0 0.5rem;
    margin: 1rem 0 0.25rem;
}

@media (max-width: 1340px) {
    .theme1-home-classic .-games-list-container .nav .nav-item.-game-slot-macro-container {
        width: 15%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .theme1-home-classic .-games-list-container .nav .nav-item.-game-slot-macro-container {
        width: 20%;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .theme1-home-classic .-games-list-container .nav .nav-item.-game-slot-macro-container {
        width: 25%;
        padding: 0 0.375rem;
    }
}

@media (max-width: 767.98px) {
    .theme1-home-classic .-games-list-container .nav .nav-item.-game-slot-macro-container {
        padding: 0 0.375rem;
    }
}

@media (max-width: 575.98px) {
    .theme1-home-classic .-games-list-container .nav .nav-item.-game-slot-macro-container {
        width: 33.33333%;
    }
}

/* ---------- หัวข้อ (heading) ---------- */
@media (max-width: 767.98px) {
    .theme1-home-classic .x-hot-games-container {
        padding-top: 1rem;
    }
}

.theme1-home-classic .x-hot-games-container .-inner-heading-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

@media (max-width: 767.98px) {
    .theme1-home-classic .x-hot-games-container .-inner-heading-wrapper {
        padding-left: 0.5rem;
    }
}

.theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-icon {
    width: 40px;
    height: auto;
    -webkit-filter: none;
    filter: none;
    -webkit-animation: none;
    animation: none;
}

@media (max-width: 991.98px) {
    .theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-icon {
        width: 30px;
    }
}

.theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-title {
    display: inline-block;
    width: auto;
    margin-bottom: 0;
    margin-left: 1rem;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    text-shadow: none;
    background: linear-gradient(180deg, #56ccf2, #2f80ed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

@media (max-width: 991.98px) {
    .theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-title {
        margin-left: 0.5rem;
        font-size: 1rem;
    }
}

/* ปุ่ม "ดูทั้งหมด" (เหมือน homepage ใหม่) — ดันไปชิดขวาของหัวข้อ */
.theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-see-all-wrapper {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
}

.theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-see-all-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-width: 72px;
    height: 32px;
    margin-bottom: 0;
    padding: 0 14px;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    color: rgba(228, 236, 255, 0.88);
    border: 1px solid rgba(172, 199, 255, 0.3);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.045);
    box-shadow: none;
    text-decoration: none;
    transition: color 0.25s, background-color 0.25s, border-color 0.25s;
}

.theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-see-all-link:hover,
.theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-see-all-link:focus {
    color: #fff;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 575.98px) {
    .theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-see-all-wrapper {
        margin-left: auto;
    }

    .theme1-home-classic .x-hot-games-container .-inner-heading-wrapper .-see-all-link {
        min-width: 64px;
        height: 28px;
        padding: 0 11px;
        font-size: 0.72rem;
    }
}

.theme1-home-classic .x-hot-games-container .-hot-recently-games {
    margin-bottom: 2rem;
}

@media (max-width: 767.98px) {
    .theme1-home-classic .x-hot-games-container .-hot-recently-games {
        margin-bottom: 1.5rem;
    }
}

.theme1-home-classic .x-hot-games-container .-hot-slot-container {
    margin-top: 2rem;
}

@media (max-width: 767.98px) {
    .theme1-home-classic .x-hot-games-container .-hot-slot-container {
        margin-top: 1.5rem;
    }
}

/* หัวข้อ SEO ด้านบน */
.theme1-home-classic .x-category.-total-game .container h1 {
    margin-bottom: 0.75rem;
    color: #fff;
    font-weight: 400;
}

/* ---------- การ์ดเกม ---------- */
.theme1-home-classic .x-game-list-item-macro {
    position: relative;
}

.theme1-home-classic .x-game-list-item-macro .-inner-wrapper {
    position: relative;
    background: transparent;
    box-shadow: none;
    border-radius: 15px;
    overflow: visible;
}

.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-cover-img {
    width: 100%;
    border-radius: 15px;
}

@media (max-width: 767.98px) {
    .theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-cover-img {
        border-radius: 10px;
    }
}

.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    background: rgba(51, 46, 50, 0.7);
    transition: all 0.4s;
    border-radius: 15px;
    z-index: 3;
    padding: 0;
}

@media (max-width: 767.98px) {
    .theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay {
        border-radius: 10px;
    }
}

.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 150px;
    padding: 10px;
    text-align: center;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    transition: all 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 575.98px) {
    .theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner {
        min-width: -webkit-fit-content;
        min-width: -moz-fit-content;
        min-width: fit-content;
    }
}

.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner .-wrapper-container {
    display: flex;
    flex-direction: column;
    margin: auto;
}

.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner .-wrapper-container .-btn {
    min-width: 120px;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 575.98px) {
    .theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner .-wrapper-container .-btn {
        min-width: 80px;
        padding: 6px;
        font-size: 0.75rem;
    }
}

.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner .-wrapper-container .-btn .-text-btn,
.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner .-wrapper-container .-btn .fas {
    position: relative;
    z-index: 2;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner .-wrapper-container .-btn .fas {
    top: 1px;
    margin-right: 8px;
    font-size: 12px;
}

/* ปุ่มเข้าเล่น (สีส้มแบบเดิม) */
.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner .-wrapper-container .-btn.-btn-play {
    position: relative;
    color: #fff;
    background: linear-gradient(180deg, #fbc844, #f88012);
    overflow: hidden;
}

.theme1-home-classic .x-game-list-item-macro .-inner-wrapper .-overlay .-overlay-inner .-wrapper-container .-btn.-btn-play:hover {
    text-decoration: none;
    color: #fff;
    background: linear-gradient(180deg, #fcd776, #f99b44);
}

/* ชื่อเกม */
.theme1-home-classic .x-game-list-item-macro .-title {
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.75rem;
    margin-bottom: 0;
    color: #c4c4c4;
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    text-shadow: none;
}

@media (max-width: 767.98px) {
    .theme1-home-classic .x-game-list-item-macro .-title {
        margin-top: 0.5rem;
        font-size: 0.875rem;
    }
}

/* แสดง overlay เมื่อ hover (จอใหญ่) */
@media (min-width: 992px) {
    .theme1-home-classic .x-game-list-item-macro:hover .-inner-wrapper .-overlay {
        opacity: 1;
        visibility: visible;
    }

    .theme1-home-classic .x-game-list-item-macro:hover .-inner-wrapper .-overlay .-overlay-inner .-wrapper-container .-btn {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

/* ป้ายล็อก (เล่นไม่ได้จากเงื่อนไขโปร) */
.theme1-home-classic .x-game-badge-image {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    width: 70px;
    height: 70px;
    overflow: hidden;
}

.theme1-home-classic .x-game-badge-image .-img,
.theme1-home-classic .x-game-badge-image:before {
    position: absolute;
    top: 32%;
    left: 32%;
}

.theme1-home-classic .x-game-badge-image .-img {
    z-index: 1;
    width: 18px;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

.theme1-home-classic .x-game-badge-image:before {
    content: "";
    width: 110px;
    height: 28px;
    background: rgba(0, 0, 0, 0.4);
    -webkit-transform: translate(-50%, -50%) rotate(-45deg);
    transform: translate(-50%, -50%) rotate(-45deg);
}
