/* ====== สไตล์แท็บบาร์ทั่วไป (PC) ====== */
.topbar_menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 20px;
    border-radius: 5px;
    background-color: white;
}

#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 1px 1px 5px #ccc;
    background-color: white;
    margin: 0 20px;
    border-radius: 5px;
}

.topbar_menu_logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.topbar_menu_logo img {
    width: 30px;
    height: 30px;
}

.topbar_menu_logo p {
    font-weight: bold;
    margin: 3px 0 0 0;
    font-size: 16px;
}

.topbar_menu_list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 12px;
}

.topbar_menu_list ul {
    display: flex;
    margin: 0;
    padding: 0;
}

.topbar_menu_list ul li {
    margin-right: 20px;
    list-style: none;
    font-weight: bold;
}

.topbar_menu_list ul li a {
    text-decoration: none;
    color: black;
}

.topbar_menu_list ul li a:hover {
    opacity: 40%;
}

.topbar_menu_list ul li a.active {
    color: rgb(130, 54, 23);
    font-weight: bold;
}

/* ====== ปุ่มสีเขียว ====== */
.btn-custom {
    background-color: #4DA866;
    color: white;
    padding: 10px 20px;
    font-size: 12px;
    border-radius: 5px;
    text-decoration: none;
}

.btn-custom:hover {
    background-color: rgb(163, 155, 155);
    color: black;
}

/* ====== เมนู dropdown ====== */
.dropdown-menu a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #333;
}

.dropdown-menu a:hover {
    background-color: #f0f0f0;
}

/* ====== เมนูหลัก และ Hamburger ====== */
.main-menu a.active {
    color: rgb(130, 54, 23) !important;
}

.hamburger {
    display: none;
    font-size: 28px;
    cursor: pointer;
    padding: 10px;
    user-select: none;
}

.main-menu {
    display: flex;
    align-items: center;
}

/* ====== ตะกร้าสินค้าลอย ====== */
#floating_cart {
    display: none !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4DA866;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 9999;
    transition: background-color 0.3s ease;
}

#floating_cart:hover {
    background-color: #3b7d52;
}

#cart_count_badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: red;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

/* ====== ปรับแต่งสำหรับมือถือ (max-width: 768px) ====== */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .main-menu {
        display: none;
        flex-direction: column;
        background-color: white;
        position: absolute;
        top: 60px;
        left: 10px;
        right: 10px;
        border-radius: 5px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        z-index: 9999;
        padding: 10px;
    }

    .main-menu.show {
        display: flex;
    }

    .main-menu ul {
        flex-direction: column;
        padding-left: 0;
        margin: 0;
    }

    .main-menu ul li {
        margin-right: 0;
        margin-bottom: 10px;
    }

    /* ซ่อนไอคอนตะกร้าในเมนูหลักเมื่ออยู่บนมือถือ */
    .main-menu a[href$="cart.php"] {
        display: none !important;
    }

    #floating_cart {
        display: flex !important;
    }
}
