@charset "utf-8";
/* ตั้งค่ากล่องพื้นฐาน */
.order-menu-container, 
.order-menu-container * {
	box-sizing: border-box;
}

.order-menu-container {
	position: relative;
	width: 100%;
	
	font-family: "Noto Sans Thai";
	user-select: none;
	margin: 15px 0;
	font-size: 1.05rem;
}

/* ปุ่มกดหลัก */
.order-menu-button {
    min-height: 85px; 
    padding: 15px 22px;
    background-color: #92278f;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* --- ส่วนที่เพิ่ม: สถานะเมื่อ "ยังไม่มีการสั่งซื้อ" --- */
.order-menu-button.no-orders {
    background-color: #f0f0f0;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
    box-shadow: none;
}

.order-menu-button.no-orders .order-arrow {
    display: none; /* ซ่อนลูกศรเมื่อไม่มีรายการ */
}
/* ------------------------------------------- */

/* รายการที่เลื่อนลงมา */
.order-menu-list {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	width: 100%;
	background-color: #F8F4FF; /* ม่วงอ่อนนวลๆ */
	border-radius: 14px;
	border: 1px solid #D1C4E9;
	z-index: 9999;
	/* ระบบ Scroll */
	max-height: 280px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch; /* ให้การ Swipe บน Tablet ลื่นไหล */
	/* Animation */
	opacity: 0;
	visibility: hidden;
	transform: translateY(-15px);
	transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
	box-shadow: 0 12px 35px rgba(0,0,0,0.15);
	font-family: serithairegular;
	font-size: 1rem;
}

/* เปิดเมนู */
.order-menu-container.is-open .order-menu-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ปรับแต่งแถบเลื่อน (Scrollbar) ให้ใหญ่ขึ้นเล็กน้อยเพื่อให้ Tablet ใช้นิ้วเลื่อนได้ */
.order-menu-list::-webkit-scrollbar {
    width: 8px;
}
.order-menu-list::-webkit-scrollbar-track {
    background: transparent;
}
.order-menu-list::-webkit-scrollbar-thumb {
    background: #BE95C4; 
    border-radius: 10px;
    border: 2px solid #F8F4FF; /* สร้างช่องว่างให้แถบเลื่อนดูไม่ติดขอบ */
}

/* รายการในลิสต์ */
.order-item {
    padding: 16px 22px;
    color: #3C096C;
    cursor: pointer;
    border-bottom: 1px solid #E1BEE7;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-item:last-child {
    border-bottom: none;
}

.order-date {
    font-size: 12px;
    color: #8E6DA8;
    background: rgba(123, 44, 191, 0.05);
    padding: 2px 8px;
    border-radius: 6px;
}
.order-time {
    font-size: 11px;
    color: #8E6DA8;
    background: rgba(123, 44, 191, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
}
/* Hover & Active (รองรับทั้งการคลิกและทัช) */
.order-item:hover, .order-item:active {
    background-color: #E0B1FF;
    padding-left: 28px;
}

/* ลูกศร */
.order-arrow {
    width: 9px;
    height: 9px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.is-open .order-arrow {
    transform: rotate(-135deg);
}

/* Media Queries สำหรับ Tablet และ Mobile */
@media (max-width: 1024px) {
    .order-menu-container {
        max-width: 380px; /* ขนาดที่พอเหมาะสำหรับ iPad/Tablet */
		
    }
	.order-menu-button {
        padding: 14px 18px;
    }
}
@media (max-width: 768px) {
    .order-item {
        padding: 14px 20px;
    }
    .order-number {
        font-size: 14px;
    }
}
@media (max-width: 480px) {
    .order-menu-container {
        max-width: 100%; /* มือถือให้เต็มจอ */
    }
    .order-menu-button {
        padding: 18px;
        font-size: 18px;
    }
   .order-item {
        flex-direction: column; /* บนมือถือที่จอแคบมาก ให้เลขสั่งซื้ออยู่บน วันเวลาอยูล่าง */
        align-items: flex-start; /* เปลี่ยนเป็นชิดซ้ายให้หมดเพื่อให้ดูง่าย */
        gap: 8px;
        padding: 15px;
    }
.order-number {
        font-size: 16px; /* ขยายเลขสั่งซื้อให้ชัดเจน */
        color: #92278f;
    }
    .order-date {
        font-size: 12px;
    }
 .order-info-group {
        align-items: flex-start; /* วันเวลาชิดซ้ายตามเลขสั่งซื้อ */
        width: 100%;
        border-top: 1px dashed #E1BEE7; /* เพิ่มเส้นคั่นบางๆ */
        padding-top: 8px;
    }
	
}
/* กลุ่มข้อความวันที่และเวลา */
.order-info-group {
    display: flex;
    flex-direction: column; /* เรียงวันที่และเวลาลงมาข้างล่าง */
    align-items: flex-end;   /* ชิดขวาเสมอ */
    gap: 2px;               /* ระยะห่างระหว่างบรรทัด */
    text-align: right;
}
.order-number {
    font-weight: bold;
    font-size: 15px;
}
/* คอนเทนเนอร์หลักของข้อมูลวันที่และเวลา */
.order-info-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* ชิดขวาบน Desktop/Tablet */
    gap: 4px;
    text-align: right;
}

/* แถวของวันที่และเวลา */
.order-date-row, .order-time-row {
    display: flex;
    align-items: center;
    gap: 5px; /* ระยะห่างระหว่างคำว่า "เวลา:" กับ "14:30" */
}
/* ปรับแต่งคำว่า "สั่งซื้อวันที่:" และ "เวลา:" */
.label-small {
    font-size: 11px;
    color: #8E6DA8;
    font-weight: normal;
}

/* ปรับแต่งตัวเลขวันที่และเวลา */
.value-text {
    font-size: 13px;
    font-weight: 600;
    color: #3C096C;
}

/* ตกแต่งแถวเวลาให้ดูเด่นขึ้นเล็กน้อย */
.order-time-row {
    background: rgba(146, 39, 143, 0.08);
    padding: 2px 8px;
    border-radius: 5px;
}
/* สไตล์หัวข้อด้านบนปุ่ม */
.order-title {
    font-family: "Noto Sans Thai", sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #3C096C;
    margin-bottom: 8px; /* ระยะห่างระหว่างหัวข้อกับปุ่ม */
    margin-left: 5px;
}
.label-text {
    width: 100%;
}