/* ============================================================
   🔹 1. RESET & LAYOUT BASE
   ------------------------------------------------------------*/
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden; /* ป้องกันเลื่อนขวา */
  font-family: Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ============================================================
   🔹 2. CART BUTTON (ปุ่มตะกร้า)
   ------------------------------------------------------------*/
#cart-button {
  position: relative; /* สำหรับยึด badge */
}

#cart-button i {
  font-family: "Font Awesome 5 Free" !important;
  font-weight: 900 !important;
}

#cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: red;
  color: white;
  font-size: 1rem;
  border-radius: 50%; /* วงกลมสำหรับเลขตัวเดียว */
  padding: 4px 6px;
  min-width: 40px; /* เพิ่มขั้นต่ำ */
  height: 25px; /* ให้ความสูงคงที่ */
  line-height: 20px; /* จัดตัวเลขตรงกลาง */
  text-align: center;
  display: inline-block;
}

/* ============================================================
   🔹 3. PRODUCT CARD LAYOUT
   ------------------------------------------------------------*/
.card-deck {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.card {
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 10px;
  padding: 5px;
  width: 100%;
  max-width: 200px;
}

.card img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  transition: all 0.3s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.card-body {
  padding: 2px;
}

.card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  outline: 2px solid #008cff;
}

.card-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 1px;
}

.card-text {
  font-size: 0.9rem;
  color: hsl(0, 1%, 27%);
  margin: 0 0 2px;
}

/* ปุ่มเพิ่มสินค้า */
.btn-add-to-cart {
  background-color: #28a745;
  color: white;
  transition: background-color 0.3s ease;
}

.btn-add-to-cart:hover {
  background-color: #218838;
}

/* ============================================================
   🔹 4. RESPONSIVE CARD GRID
   ------------------------------------------------------------*/
@media (min-width: 768px) {
  .card {
    flex: 1 1 calc(33.333% - 10px); /* 3 ใบต่อแถว */
    margin-right: 10px;
  }
}

@media (max-width: 767px) {
  .card {
    flex: 1 1 calc(50% - 10px); /* 2 ใบต่อแถว */
    margin: 0 10px 10px 0;
    max-width: 100%;
  }
}

/* ============================================================
   🔹 5. NAVBAR MENU
   ------------------------------------------------------------*/
/* เมนูบนจอใหญ่ */
#nav-menu ul {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end;
  gap: 20px;
  list-style-type: none;
}

/* ปรับ li ให้แสดงผลเป็นคอลัมน์ภายใน nav */
#navbar li {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end;
  gap: 20px;
  list-style-type: none;
}

/* เมนูบนจอเล็ก */
@media (max-width: 768px) {
  #nav-menu ul {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px;
  }

  #nav-menu ul li {
    margin-bottom: 10px !important;
  }
}

/* ============================================================
   🔹 6. CONTACT STICKER (ปุ่มติดต่อ)
   ------------------------------------------------------------*/
.contact-sticker {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 999;
}

.contact-button {
  background-color: #ffffff18;
  border: 1px solid #ff5733;
  color: #ff5733;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 10px 0 0 10px;
  font-size: 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease-in-out;
}

.contact-button:hover {
  background-color: #ff5733;
  border-color: #ff5733;
  color: #fff;
}

/* เมนูย่อยในปุ่มติดต่อ */
.contact-menu {
  position: absolute;
  top: 100%;
  right: 0;
  display: flex;
  flex-direction: column;
  background-color: #f1f1f1;
  padding: 10px;
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.3s ease-in-out;
}

.contact-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ปุ่มในเมนูย่อย */
.submenu-item {
  background-color: #fff;
  color: #030a13ce;
  padding: 10px;
  margin: 5px 0;
  border: 1px solid hsl(219, 100%, 60%);
  border-radius: 10px;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.submenu-item:hover {
  background-color: #007bff;
  color: white;
}

/* ============================================================
   🔹 7. INFO TAB (แถบข้อมูลร้าน)
   ------------------------------------------------------------*/
.info-tab {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background-color: white;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
  z-index: 1100;
  padding: 20px;
  overflow-y: auto;
  transition: right 0.6s ease-in-out;
}

.info-tab.active {
  right: 0; /* Slide เข้ามา */
}

/* ปุ่มปิด */
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #f00;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  z-index: 1200;
}

/* เนื้อหาใน info tab */
.tab-content {
  margin-top: 50px;
}

.contact-category {
  margin-bottom: 10px;
}

.contact-category .footer-heading {
  font-weight: bold;
  margin-bottom: 10px;
}

.contact-details p {
  margin: 1px 0;
}

.qr-code {
  width: 150px;
  height: auto;
  margin-top: 5px;
}

/* ============================================================
   🔹 8. TEXT & STYLE UTILITIES
   ------------------------------------------------------------*/
.highlighttext {
  background-color: yellow;
  font-weight: bold;
}

.highlightbrand {
  color: blue;
  font-weight: bold;
}

.shop-name {
  color: #007bff;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  margin: 0;
}

/* ============================================================
   🔹 9. BUTTONS & SCROLLBAR
   ------------------------------------------------------------*/
.btn-gradient-blue {
  background: linear-gradient(135deg, #2192f5, #31e9f3);
  color: white;
  border: none;
  transition: 0.3s;
}

.btn-gradient-blue:hover {
  background: linear-gradient(135deg, #3b8efc, #00d0e6);
  color: #fff;
}

/* สไตล์ Scrollbar เฉพาะ modal */
#modal_description::-webkit-scrollbar {
  width: 6px;
}

#modal_description::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

#modal_description::-webkit-scrollbar-thumb:hover {
  background: #555;
}
