/* นำเข้า Kanit จาก Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;700&display=swap');

body {
    background-image: url('/img/bg.jpg');
    /* Path รูปภาพ */
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: 'Kanit', sans-serif;
}

/* กำหนดฟอนต์ Kanit ให้กับทุกองค์ประกอบ */
html {
    font-family: 'Kanit', sans-serif;
}

/* ตัวเลือกเพิ่มเติมสำหรับฟอนต์ใน Bootstrap */
:root {
    --bs-font-sans-serif: 'Kanit', sans-serif;
}

/* สำหรับ Chrome, Safari, Edge และ Opera */
input[type=number] {
    -webkit-appearance: none;
    /* สำหรับ Webkit (Chrome, Safari, Edge) */
    -moz-appearance: textfield;
    /* สำหรับ Firefox */
    appearance: none;
    /* สำหรับมาตรฐาน CSS */
}

/* ปิดการเพิ่ม/ลด spinner */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    /* สำหรับมาตรฐาน CSS */
    margin: 0;
}


.bg-gradient {
    background: linear-gradient(to top right, #f8f9fa, #ffffff);
}

.btn-light:hover {
    color: #6c757d;
    /* Bootstrap gray-400 */
    background-color: #f8f9fa;
}

.btn-custom {
    background-color: #BDBE2E;
    color: black;
    border: none;
    font-size: 1.25rem;
    /* เทียบเท่า text-2xl */
}

.btn-custom:hover {
    background-color: rgba(189, 190, 46, 0.5);
    /* Hover */
    color: white;
}

.back-to-top {
    display: none;
    /* ซ่อนปุ่มเมื่อไม่ได้เลื่อน */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.back-to-top.show {
    display: flex;
    /* ใช้ Flexbox เมื่อแสดงปุ่ม */
    opacity: 1;
}

.back-to-top i {
    font-size: 1.25rem;
    /* ขนาดไอคอน */
}

a.btn:hover {
    background-color: #04a444;
    /* สีเขียวเข้ม */
}

.select2-container .select2-selection--single {
    height: calc(2.25rem + 2px);
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 1.5;
}

.select2-container--default .select2-selection--single .select2-selection__rendered img {
    margin-right: 8px;
    vertical-align: middle;
}

/* Custom Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.nav-tabs {
    white-space: nowrap;
    /* ป้องกันการตัดบรรทัด */
    overflow-x: auto;
    /* เปิดเฉพาะการเลื่อนแนวนอน */
    overflow-y: hidden;
    /* ปิดการเลื่อนแนวตั้ง */
    -webkit-overflow-scrolling: touch;
    /* รองรับ scroll ที่ลื่นไหลบนมือถือ */
    display: flex;
    /* จัด layout ให้ ul ใช้ flex */
}

.nav-tabs li {
    flex: 0 0 auto;
    /* แต่ละไอเท็มไม่ขยายและไม่หด */
}

.nav-tabs::-webkit-scrollbar {
    height: 6px;
    /* ปรับขนาด scrollbar แนวนอน */
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: #ccc;
    /* สี scrollbar */
    border-radius: 3px;
    /* ทำให้ scrollbar โค้งมน */
}

.nav-tabs::-webkit-scrollbar-track {
    background: transparent;
    /* พื้นที่ scrollbar เป็นโปร่งใส */
}

.select2-container {
    z-index: 1050 !important;
    /* Modal Bootstrap ใช้ z-index 1050 */
    width: 100% !important;
    /* ทำให้ Select2 กว้างเต็ม 100% */
}

.select2-container .select2-selection {
    height: auto;
    /* ปรับความสูงให้อัตโนมัติ */
}

/* shop payment */
.container {
    max-width: 600px;
    margin: auto;
}

.border {
    background-color: #f9f9f9;
}

.text-center img {
    max-width: 100%;
    height: auto;
}

#cart-badge {
    min-width: 1.5rem;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

#cart-badge-mobile {
    min-width: 1.5rem;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.menu-heading {
    font-weight: bold;
    font-size: 1rem;
    color: #495057;
    /* สีเทาเข้ม */
    margin-bottom: 0.5rem;
    display: block;
    text-transform: uppercase;
}

/* ป้องกันการตกบรรทัด */
.d-flex.flex-nowrap {
    flex-wrap: nowrap;
}

/* ปรับขนาดปุ่ม */
.btn-sm {
    min-width: 2.5rem;
    padding: 0.5rem;
    text-align: center;
}

/* ลดระยะห่างระหว่างกลุ่มปุ่ม */
.d-flex.flex-column.gap-1 {
    gap: 0.3rem;
    /* ลดระยะห่าง */
}

/* จัดการการแสดงผลสำหรับหน้าจอเล็ก */
@media (max-width: 576px) {
    .number-input {
        font-size: 1.2rem;
        /* ลดขนาดฟอนต์ */
        width: 2.5rem;
        /* ลดความกว้าง */
    }

    .quantity {
        font-size: 1.5rem;
        /* ลดขนาดฟอนต์ของจำนวน */
    }

    .btn-sm {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .row {
        flex-direction: column;
        /* จัดเรียงเป็นแนวตั้ง */
        align-items: flex-start;
        /* จัดตำแหน่งให้อยู่ซ้าย */
    }

    .row>div {
        width: 100%;
        /* ใช้ความกว้างเต็มหน้าจอ */
        margin-bottom: 0.5rem;
    }
}

/* สำหรับหน้าจอมือถือ (หน้าจอเล็กกว่า 768px) */
@media (max-width: 768px) {
    .purchase-type {
        display: block;
        /* ขึ้นบรรทัดใหม่ */
    }
}

/* สำหรับหน้าจอที่ใหญ่กว่า 768px */
@media (min-width: 769px) {
    .purchase-type {
        display: inline;
        /* แสดงในบรรทัดเดียวกัน */
    }
}

.custom-file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-file-upload input[type="file"] {
    display: none;
    /* ซ่อน input file */
}

.custom-file-upload label {
    cursor: pointer;
    padding: 10px 15px;
    font-size: 16px;
    text-align: center;
    color: #fff;
    background-color: #007bff;
    /* สีน้ำเงิน */
    border: none;
    border-radius: 5px;
    width: 100%;
    display: inline-block;
}

.custom-file-upload label:hover {
    background-color: #0056b3;
    /* สีเข้มเมื่อ hover */
}

#existing_customer_form {
    z-index: 1; /* ลดค่า z-index ให้อยู่ในเลเยอร์ที่เหมาะสม */
}
