@charset "utf-8";
.title-product-select {
	width: 90%;
	display: flex;
	float: left;
	margin-top: 5px;
	margin-right: auto;
	margin-bottom: 5px;
	margin-left: 5%;
	height: auto;
}
.title-product-select-50 {
	width: 48%;
	display: flex;
	float: left;
	margin-top: 5px;
	margin-right: 1%;
	margin-bottom: 5px;
	margin-left: 1%;
	height: auto;
}
.title-product-select-list {
	width: 20%;
	display: flex;
	float: left;
	margin-top: 5px;
	margin-bottom: 5px;
	margin-left: 2%;
	height: auto;
}
.title-product-select-list-etc {
	width: 26%;
	display: flex;
	float: left;
	margin-top: 5px;
	margin-bottom: 5px;
	margin-left: 2%;
	height: auto;
}
.custom-dropdown {
    position: relative;
    font-family: 'serithairegular', sans-serif;
    width: 100%;
  
    user-select: none;
}

.select-selected {
    background-color: #fff;
    border: 2px solid #FDE594;
    border-radius: 15px;
    padding: 12px 20px;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}

.select-selected:after {
    content: "▼";
    font-size: 10px;
    color: #C45E9C;
    transition: 0.3s;
}

.select-selected.select-arrow-active:after {
    transform: rotate(180deg);
}
.select-selected:hover {
    background-color: #fff9e6; /* เปลี่ยนสีพื้นหลังนิดหน่อยให้ดูนุ่มนวล */
    transform: scale(1.02);    /* ขยายขนาดขึ้น 2% */
    border-color: #C45E9C;     /* เปลี่ยนสีขอบให้เด่นขึ้น */
}

.select-items {
    position: absolute;
    background-color: #fff;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 999;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #eee;
	transition: 0.2s; /* เพิ่ม transition เพื่อความสมูท */
/* --- แก้ไขตรงนี้ --- */
    max-height: 280px;    /* เพิ่มความสูงให้พอสำหรับ 5 รายการ + เผื่อตอนขยายตัว (Scale) */
    overflow-y: auto;     /* ใช้ auto เพื่อให้สกอลบาร์ขึ้นเฉพาะตอนล้นจริงๆ */
    overflow-x: hidden;
    /* ------------------ */
}

/* ตกแต่ง Scrollbar ให้ดูสวยงาม (Optional) */
.select-items::-webkit-scrollbar {
    width: 6px;
}
.select-items::-webkit-scrollbar-thumb {
    background: #FDE594; 
    border-radius: 10px;
}
.select-items::-webkit-scrollbar-track {
    background: transparent; /* พื้นหลังโปร่งใส จะได้ไม่เห็นร่องสกอลบาร์ตอนมีแค่ 3 อัน */
}
.select-items div:last-child {
 border-bottom: none; /* ลบเส้นขอบอันสุดท้ายออก ไม่ให้ไปดันขอบล่าง */
}
.select-hide {
    display: none;
}

.select-items div {
   padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    box-sizing: border-box; /* ป้องกันการคำนวณขนาดผิดพลาด */
}

.select-items div:hover {
    background-color: #C45E9C;
    color: #fff;
   /* --- แนะนำให้ปรับตรงนี้ --- */
    /* ถ้าใช้ scale(1.05) มันจะดันขอบจนสกอลบาร์โผล่ */
    /* แนะนำให้ใช้แค่การดัน padding-left หรือเปลี่ยนสีก็พอครับ */
    transform: scale(1.01); /* ลดขนาดการขยายลงให้เหลือแค่ 1% หรือเอาออกเลย */
    padding-left: 25px;
}

/* สำหรับ Mobile */
@media screen and (max-width: 670px) {
	.title-product-select-list {
	width: 48%;
	display: flex;
	float: left;
	margin-top: 5px;
	margin-bottom: 5px;
	margin-left: 1%;
	height: auto;
}
	.title-product-select-list-etc {
	width: 98%;
	display: flex;
	float: left;
	margin-top: 5px;
	margin-bottom: 5px;
	margin-left: 1%;
	height: auto;
}
    .custom-dropdown { max-width: 100%; }
}

