.promotion-grid { display: grid; grid-template-columns: repeat(3, 417.5px); gap: 16px 10px; justify-content: center; width: 100%; max-width: 900px; padding: 0; margin-left: 300px; } .promotion-item { position: relative; width: 100%; border-radius: 12px; overflow: hidden; transition: all 0.3s ease; cursor: pointer; padding: 16px; background: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 47%, rgba(0, 0, 0, 0.808) 77%, rgb(107 107 107 / 77%) 100%); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); z-index: 0; max-height: 350px; } .promotion-item:hover { z-index: 10; max-height: 500px; box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2); } .promotion-item .css-gsjzcg { max-height: 0; overflow: hidden; transition: max-height 0.3s ease, opacity 0.3s ease; pointer-events: none; opacity: 0; } .promotion-item:hover .css-gsjzcg { max-height: 300px; pointer-events: auto; opacity: 1; } /* chips ด้านบน */ .css-1kgakwq { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; } /* รูปภาพ */ .css-1alou07 { width: 100%; height: auto; filter: brightness(1.1); object-fit: contain; margin-bottom: 12px; } /* ข้อความ */ .css-cut7kz { font-size: 1rem; font-weight: bold; margin-bottom: 6px; color: white; } .css-k36ljx { font-size: 0.9rem; color: #ccc; margin-bottom: 12px; } .css-95g4uk, .css-a0y2e3 { font-size: 0.9rem; margin-bottom: 6px; } /* ชิพ (chips) */ .MuiChip-root { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 16px; font-size: 0.8rem; } .MuiChip-outlined { transition: background-color 300ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1); background-color: rgb(51, 102, 255); } .MuiChip-filledSecondary { background-color: transparent; border: 1px solid rgba(145, 158, 171, 0.3); color: white; } .MuiChip-filledDefault { transition: background-color 300ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid rgba(145, 158, 171, 0.3); overflow: hidden; text-overflow: ellipsis; padding-left: 12px; padding-right: 12px; white-space: nowrap; } .MuiChip-filledDefault .MuiChip-label { color: white !important; } .price-container { margin-top: 4px; display: flex; align-items: center; gap: 8px; } .price-label { font-size: 1rem; font-weight: 500; line-height: 1.5; color: rgb(255, 255, 255); } #promotion-popup { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.75); display: flex; justify-content: center; align-items: center; z-index: 9999; visibility: visible; opacity: 1; transition: opacity 0.3s ease; } #promotion-popup.hidden { visibility: hidden; opacity: 0; pointer-events: none; } #promotion-popup .popup-content { padding: 20px; text-align: center; justify-content: center; background-color: rgb(33, 30, 31); color: rgb(255, 255, 255); background-image: none; position: relative; display: flex; flex-direction: column; max-height: 80vh; max-width: 600px; overflow-y: auto; /* ให้ scroll ถ้าเนื้อหายาวเกิน */ box-shadow: rgba(0, 0, 0, 0.24) 0px 0px 4px 0px, rgba(0, 0, 0, 0.24) 0px 24px 48px 0px; transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1); border-radius: 8px; margin: 32px; } /* Custom scrollbar สำหรับ #popup-description */ #popup-description::-webkit-scrollbar { width: 8px; /* ความกว้างของ scrollbar */ } #popup-description::-webkit-scrollbar-track { background: transparent; /* พื้นหลังของแทร็ก */ } #popup-description::-webkit-scrollbar-thumb { background: #555; /* สีของตัวเลื่อน */ border-radius: 6px; /* ทำให้โค้งมน */ transition: background-color 0.3s ease; } #popup-description::-webkit-scrollbar-thumb:hover { background: #888; /* เมื่อเอาเมาส์ชี้ */ } /* รูปภาพ */ #popup-image { width: 100%; height: auto; border-radius: 6px; margin-bottom: 15px; object-fit: contain; } /* ชื่อสินค้า */ #popup-title { font-size: 1.3rem; /* เดิม 1.5rem */ margin-bottom: 8px; font-weight: bold; color: #fff; } /* รายละเอียดเล็กๆ */ #popup-status, #popup-remaining, #popup-price, #popup-type, #popup-id, #popup-current { font-size: 0.9rem; margin-bottom: 6px; color: #ccc; /* เปลี่ยนเป็นสีเทาอ่อนเพื่อความสว่างบนพื้นหลังเข้ม */ } #popup-description { margin: 10px 0; font-size: 0.95rem; line-height: 1.25; color: #ddd; white-space: pre-line; max-height: 300px; /* จำกัดความสูงไม่ให้เกินไป */ overflow-y: auto; /* เพิ่ม scrollbar ถ้าข้อความยาว */ } #promotion-popup .popup-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; } #promotion-popup button { padding: 8px 16px; border: none; border-radius: 5px; font-size: 1rem; cursor: pointer; transition: background-color 0.25s ease; user-select: none; } #cancel-popup { background-color: #444; color: #eee; border: 1px solid #666; } #cancel-popup:hover { background-color: #555; } #redeem-popup { background-color: #2979ff; color: white; box-shadow: 0 2px 6px rgba(41, 121, 255, 0.7); } #redeem-popup:hover { background-color: #1565c0; box-shadow: 0 4px 12px rgba(21, 101, 192, 0.9); } .quantity-input { padding: 12px 10px; border-radius: 5px; color: white; font-size: 14px; width: 100%; } .quantity-input input[type="text"] { padding: 8px 10px; border-radius: 5px; border: 1px solid #555; background-color: rgb(33, 30, 31); color: white; font-size: 14px; margin-bottom: 10px; text-align: center; transition: all 0.2s ease-in-out; } .quantity-input input:focus, .quantity-input input:not(:placeholder-shown) { background-color: rgb(33, 30, 31); border-color: #C24849; outline: none; text-align: left; padding-left: 0.75rem; } /* Autofill fix */ .quantity-input input:-webkit-autofill { -webkit-box-shadow: 0 0 0px 1000px #b8b8b8 inset !important; -webkit-text-fill-color: white !important; transition: background-color 5000s ease-in-out 0s; } /* Label Input */ .quantity-input-container { position: relative; width: 100%; background-color: rgb(33, 30, 31); } .quantity-label { position: absolute; left: 10px; top: 40%; transform: translateY(-50%); color: #b8b8b8; font-size: 14px; font-weight: 500; pointer-events: none; transition: 0.2s ease all; background-color: rgb(33, 30, 31); padding: 0 4px; } .quantity-input:focus+.quantity-label, .quantity-input:not(:placeholder-shown)+.quantity-label { top: 3px; left: 8px; font-size: 12px; color: #C24849; background-color: rgb(33, 30, 31); } .hidden { display: none !important; } #promotion-popup, #message-popup { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; } .popup-message { background-color: rgb(51, 49, 49); padding: 20px; border-radius: 8px; max-width: 400px; width: 90%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; } #message-text { margin-bottom: 10px; } .btn { background-color: rgb(194, 72, 73); color: white; border: none; border-radius: 5px; padding: 8px 16px; cursor: pointer; font-size: 1rem; transition: background-color 0.3s ease; } .btn:hover { background-color: rgb(172, 62, 63); } .promotion-header-box { margin-bottom: 24px; /* ปรับค่าตามความต้องการ */ } .promotion-header-box { display: flex; justify-content: center; align-items: center; gap: 15px; flex-wrap: wrap; height: 50px; border-radius: 8px; background-color: #222; font-weight: bold; font-size: 16px; color: #b4b2b7 !important; text-align: center; } .promotion-header-box .divider { color: #aaa; } .point-value { color: white; } .redeem-code-list { margin-top: 15px; display: flex; flex-direction: column; gap: 12px; } .redeem-code-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; background-color: #1e1e2f; border: 2px solid #00ff99; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 255, 153, 0.4); } .redeem-label { font-weight: bold; font-size: 18px; color: #ffffffcc; } .redeem-code { font-size: 20px; font-weight: bold; background: #000; color: #00ff99; padding: 6px 14px; border-radius: 6px; font-family: 'Courier New', monospace; letter-spacing: 1px; } .redeem-code-item button { padding: 6px 12px; background-color: #00ff99; border: none; border-radius: 6px; color: #000; font-weight: bold; cursor: pointer; transition: background-color 0.2s ease; } .redeem-code-item button:hover { background-color: #00cc77; }