:root {
  --primary: #2563EB;
  --secondary: #1E40AF;
  --accent: #F59E0B;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --background: #F3F4F6;
  --text: #1F2937;
  --light: #F9FAFB;
  --dark: #111827;
  --transition-speed: 0.3s;
}
/* เปลี่ยนสีพื้นหลังส่วนบนจากสีน้ำเงินเป็นไล่ระดับ */
.navbar, nav, .nav-container, header {
  background: linear-gradient(80deg, #1b4ae7 0%, #041d6e 100%) !important;
}

/* ส่วนแบนเนอร์ด้านบนสุด (ส่วนของโปรโมชั่น) ยังคงเป็นสีแดงเหมือนเดิม */
.announcement-bar, .promo-bar {
  background-color: #ef4444 !important;
}

/* ส่วนล่าง footer */
footer, .footer {
  background: linear-gradient(90deg, #1b4ae7 0%, #041d6e 100%) !important;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Prompt', sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition-speed), color var(--transition-speed);
  font-size: 16px;
  overflow-x: hidden;
}

body.dark-mode {
  background: #3d4141;
  color: #0e0303;
}

body.dark-mode .header,
body.dark-mode .footer,
body.dark-mode .modal-content {
  background: #202323;
}

body.dark-mode .nav-links a,
body.dark-mode .product-info h3,
body.dark-mode .product-info p {
  color: #0e0303;
}

/* Header */
.header {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.top-bar {
  background: var(--danger); /* ใช้สีแดงจาก --danger เพื่อให้เข้ากับธีม */
  color: white;
  padding: 0.5rem;
  text-align: center;
  font-size: 1rem; /* ขนาดฟอนต์ให้สมดุลกับดีไซน์ */
  overflow: hidden;
  white-space: nowrap;
  animation: marquee 15s linear infinite;
  width: 100%;
  box-sizing: border-box;
  transition: background var(--transition-speed);
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.top-bar:hover {
  animation-play-state: paused;
  background: var(--warning); /* เปลี่ยนสีเมื่อ hover ให้เข้ากับธีม */
}

body.dark-mode .top-bar {
  background: #b91c1c; /* สีแดงเข้มขึ้นเล็กน้อยในโหมดมืด */
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ส่วนที่เหลือของ CSS ยังคงเหมือนเดิม */
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--light);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--light);
  font-weight: 500;
  transition: color var(--transition-speed);
}

.nav-links a:hover {
  color: var(--accent);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-actions button,
.user-actions a,
#userGreeting {
  font-size: 1rem;
  padding: 0.9rem 1rem;
}

/* Cart Icon */
.cart-icon {
  position: relative;
  cursor: pointer;
  padding: 0.5rem;
}

.cart-icon i.fas.fa-shopping-cart {
  font-size: 1.5rem;
  color: white;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  z-index: 10;
}

body.dark-mode .cart-icon i.fas.fa-shopping-cart {
  color: white;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  cursor: pointer;
  border: none;
  padding: 0.9rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: background var(--transition-speed);
}

.btn-primary {
  background: var(--primary);
  color: rgb(248, 240, 240);
}

.btn-primary:hover {
  background: var(--secondary);
}

.btn-secondary {
  background: var(--accent);
  color: rgb(248, 241, 241);
}

.btn-secondary:hover {
  background: var(--warning);
}

.btn-danger,
.btn-logout {
  background: var(--danger);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 0.3rem;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition-speed);
}

.btn-danger:hover,
.btn-logout:hover {
  opacity: 0.8;
}

#userGreeting {
  margin-right: 0.5rem;
  font-weight: 500;
  color: var(--success);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1100;
  animation: fadeIn var(--transition-speed);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-content.product-detail {
  max-width: 600px;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--danger);
}
.tabs {
  display: flex;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
}

.tab.active {
  border-bottom: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
}
/* Form Styling (ข้อมูลจัดส่งและข้อมูลส่วนตัว) */
.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-align: left;
  width: 100%;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid rgb(165, 157, 157);
  border-radius: 0.5rem;
  font-size: 1rem;
}

/* Profile Modal */
.profile-content {
  max-width: 600px;
  margin: auto;
  padding: 2rem;
  max-height: 80vh;
  overflow-y: auto;
}

.profile-content h2 {
  margin-bottom: 1.5rem;
  color: #333;
  text-align: center;
}

.profile-content .form-group {
  width: 100%;
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 400px;
  height: 100%;
  background: white;
  padding: 2rem;
  box-shadow: -2px 0 4px rgb(5, 17, 7);
  transition: right var(--transition-speed) ease-in-out;
  z-index: 1050;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-cart {
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--danger);
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ddd;
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.cart-summary {
  margin-top: auto;
}

/* Product & Search Section */
.search-section {
  margin-top: 4.5rem;
  padding: 0 1rem;
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.advanced-search {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
}

.search-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
}

.product-section {
  display: grid;
  grid-template-columns: 250px 1fr; /* ปรับจาก 1fr เป็น 250px 1fr เพื่อให้มีสองคอลัมน์ */
  gap: 2rem;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
}

.filters-sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  height: fit-content;
  /* ลบ display: none; เพื่อให้ sidebar แสดงผล */
}

.filter-category {
  margin-bottom: 1.5rem;
}

.price-range {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  width: 100%;
  margin: 0 auto;
  justify-content: center;
}

.product-card {
  position: relative;
  overflow: hidden;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-speed);
  width: 100%;
}

.product-card:hover {
  transform: translateY(-3px);
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.product-info {
  padding: 1rem;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--accent);
}

.action-button {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.action-button:hover {
  opacity: 0.8;
}

.action-button.action-like.liked {
  color: var(--danger);
}

/* AI & Reviews */
.reviews {
  max-width: 1400px;
  margin: 4rem auto;
  padding: 0 1rem;
  width: 100%;
}

.review-card {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rating {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.ai-recommend-section {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
}

.ai-recommend-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  width: 100%;
  margin: 0 auto;
  justify-content: center;
}

/* Footer */
.footer {
  background: var(--primary);
  color: white;
  margin-top: 2rem;
  width: 100%;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 1rem;
  width: 100%;
}

/* Blog Section */
.blog-section {
  max-width: 1400px;
  margin: 3rem auto;
  padding: 1rem;
  background: var(--light);
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.blog-section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--primary);
}

.blog-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
  margin: 0 auto;
}

/* Media Queries */
@media (max-width: 768px) {
  body {
    font-size: 14px;
    line-height: 1.4;
  }

  .nav-container {
    flex-direction: row;
    padding: 0.5rem 1rem;
    justify-content: space-between;
  }

  .logo {
    font-size: 1.2rem;
  }

  .nav-links {
    display: none;
  }

  .user-actions {
    gap: 0.5rem;
    justify-content: flex-end;
  }

  .user-actions button,
  .user-actions a,
  #userGreeting {
    font-size: 0.8rem;
    padding: 0.5rem 0.7rem;
  }

  .cart-icon {
    padding: 0.3rem;
  }

  .cart-count {
    width: 16px;
    height: 16px;
    font-size: 0.7rem;
  }

  .search-section {
    padding: 0 0.5rem;
  }

  .advanced-search {
    padding: 1rem;
  }

  .product-section {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .filters-sidebar {
    display: none;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .product-info {
    padding: 0.5rem;
  }

  .product-info h3,
  .product-info p {
    font-size: 0.9rem;
    margin: 0.3rem 0;
  }

  .product-actions {
    bottom: 0;
    font-size: 0.8rem;
  }

  .cart-sidebar {
    width: 100%;
    right: -100%;
  }

  .reviews {
    padding: 0 0.5rem;
  }

  .ai-recommend-section {
    padding: 0 0.5rem;
  }

  .blog-section {
    padding: 0.5rem;
  }

  .blog-posts {
    grid-template-columns: 1fr;
  }

  /* ปรับ Modal ในจอเล็ก */
  .modal-content {
    padding: 1rem;
    max-width: 90%;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 0.9rem;
  }

  /* ปรับ top-bar ในจอเล็ก */
  .top-bar {
    font-size: 0.9rem;
    padding: 0.4rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 12px;
  }

  .nav-container {
    padding: 0.3rem 0.5rem;
  }

  .logo {
    font-size: 1rem;
  }

  .user-actions {
    gap: 0.3rem;
  }

  .user-actions button,
  .user-actions a,
  #userGreeting {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }

  .cart-icon {
    padding: 0.2rem;
  }

  .cart-count {
    width: 14px;
    height: 14px;
    font-size: 0.6rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-info h3 {
    font-size: 0.8rem;
  }

  .product-info p {
    font-size: 0.7rem;
  }

  /* ปรับ Modal ในจอเล็กมาก */
  .modal-content {
    padding: 0.5rem;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 0.8rem;
  }

  /* ปรับ top-bar ในจอเล็กมาก */
  .top-bar {
    font-size: 0.8rem;
    padding: 0.3rem;
  }
}

/* Promotion Slider */
.promo-slider {
  margin-top: 4.5rem; /* ปรับให้อยู่ถัดจาก header (ที่ fixed) */
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  position: relative;
}

.slider-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.slides {
  display: flex;
  transition: transform var(--transition-speed) ease-in-out;
  width: 100%;
}

.slide {
  min-width: 100%;
  flex-shrink: 0;
}

.slide img {
  width: 100%;
  height: 400px; /* ความสูงคงที่ ปรับได้ตามต้องการ */
  object-fit: cover;
  display: block;
}

.prev-slide,
.next-slide {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background var(--transition-speed);
}

.prev-slide {
  left: 1rem;
}

.next-slide {
  right: 1rem;
}

.prev-slide:hover,
.next-slide:hover {
  background: var(--accent);
}

/* Media Queries */
@media (max-width: 768px) {
  .promo-slider {
    margin-top: 4rem;
    padding: 0 0.5rem;
  }

  .slide img {
    height: 100px; /* ลดความสูงในจอเล็ก */
  }

  .prev-slide,
  .next-slide {
    padding: 0.3rem 0.8rem;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .promo-slider {
    margin-top: 3.5rem;
  }

  .slide img {
    height: 200px; /* ลดความสูงในจอเล็กมาก */
  }

  .prev-slide,
  .next-slide {
    padding: 0.2rem 0.6rem;
    font-size: 1rem;
  }
}
/* Announcement Box */
.announcement-box {
  margin-top: 2rem; /* ระยะห่างจาก promo-slider */
  width: 100%;
  max-width: 1000px; /* เท่ากับ promo-slider ที่ปรับแล้ว */
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.announcement-container {
  background: var(--light); /* ใช้สีพื้นหลังอ่อนจากธีม */
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(245, 238, 238, 0.1);
  text-align: center;
}

.announcement-container h2 {
  font-size: 1.5rem;
  color: var(--primary); /* ใช้สีหลักจากธีม */
  margin-bottom: 1rem;
}

.announcement-content {
  font-size: 1rem;
  color: var(--text);
}

.announcement-content p {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

body.dark-mode .announcement-container {
  background: #fdfcfc; /* สีเข้มขึ้นในโหมดมืด */
  color: #e0e0e0;
}

body.dark-mode .announcement-container h2 {
  color: var(--accent); /* เปลี่ยนสีหัวข้อในโหมดมืด */
}

/* Media Queries */
@media (max-width: 768px) {
  .announcement-box {
    margin-top: 1.5rem;
    padding: 0 0.5rem;
  }

  .announcement-container {
    padding: 1rem;
  }

  .announcement-container h2 {
    font-size: 1.3rem;
  }

  .announcement-content {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .announcement-box {
    margin-top: 1rem;
  }

  .announcement-container {
    padding: 0.8rem;
  }

  .announcement-container h2 {
    font-size: 1.1rem;
  }

  .announcement-content {
    font-size: 0.8rem;
  }
}
/* Contact Dropdown */
.contact-dropdown {
  position: relative;
  display: inline-flex; /* เพื่อให้เข้ากับ flex ของ nav-links */
  align-items: center;
}

.contact-btn {
  text-decoration: none;
  color: var(--light); /* สีเดียวกับ nav-links */
  font-weight: 500;
  transition: color var(--transition-speed); /* ใช้ transition เดิม */
}

.contact-btn:hover {
  color: var(--accent); /* สีเมื่อ hover เหมือน nav-links */
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%; /* วางใต้ปุ่ม */
  right: 0; /* ชิดขวาของปุ่มติดต่อ */
  background: var(--light); /* ใช้สีพื้นหลังอ่อนจากธีม */
  min-width: 120px;
  border-radius: 0.5rem; /* เข้ากับดีไซน์กลมของธีม */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* เงาเหมือนส่วนอื่นๆ */
  z-index: 1001; /* อยู่เหนือ header */
}

.dropdown-content a {
  color: var(--text); /* สีข้อความจากธีม */
  padding: 0.5rem 1rem; /* padding สไตล์เดียวกับส่วนอื่น */
  text-decoration: none;
  display: block;
  font-size: 0.9rem; /* ขนาดฟอนต์ให้สมดุล */
  transition: background var(--transition-speed);
}

.dropdown-content a:hover {
  background: var(--background); /* สีเมื่อ hover ให้ตัดกับพื้นหลัง */
  color: var(--primary); /* เปลี่ยนสีข้อความเมื่อ hover */
}

.contact-dropdown:hover .dropdown-content {
  display: block;
}

/* Dark Mode Support */
body.dark-mode .dropdown-content {
  background: #2d2d2d; /* สีเข้มสำหรับโหมดมืด */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* เงาเข้มขึ้น */
}

body.dark-mode .dropdown-content a {
  color: #e0e0e0; /* สีข้อความในโหมดมืด */
}

body.dark-mode .dropdown-content a:hover {
  background: #5e5858; /* สี hover ในโหมดมืด */
  color: var(--accent); /* ใช้สี accent เมื่อ hover */
}

/* Media Queries - ปรับให้เข้ากับ responsive เดิม */
@media (max-width: 768px) {
  .contact-dropdown {
      display: none; /* ซ่อน dropdown ในจอเล็กเหมือน nav-links */
  }
}
/* Product & Search Section เพื่อให้หน้าโทรศัพปรากฏ*/
.product-section {
  display: grid;
  grid-template-columns: 250px 1fr; /* ค่าเริ่มต้นสำหรับจอใหญ่ */
  gap: 2rem;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
}

.filters-sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  height: fit-content;
}

/* Media Queries */
@media (max-width: 768px) {
  .product-section {
    grid-template-columns: 1fr; /* ยังคงเป็นคอลัมน์เดียวในจอเล็ก */
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .filters-sidebar {
    display: block; /* เปลี่ยนจาก none เป็น block เพื่อให้แสดง */
    width: 100%; /* ให้กว้างเต็มจอ */
    margin-bottom: 1rem; /* เพิ่มระยะห่างจากเนื้อหาด้านล่าง */
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .product-section {
    padding: 0 0.5rem;
  }

  .filters-sidebar {
    padding: 1rem; /* ลด padding ในจอเล็กมาก */
  }

  .products-grid {
    grid-template-columns: 1fr; /* เหลือคอลัมน์เดียวในจอเล็กมาก */
  }
}
/* แก้ไขส่วน Modal ในไฟล์เสริม เพื่อไม่ให้ขัดแย้งกับไฟล์แรก */

/* Modal หลักในไฟล์เสริม - เปลี่ยนเป็น class เฉพาะเพื่อหลีกเลี่ยงการขัดแย้ง */
.login-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1100;
  animation: fadeIn var(--transition-speed);
}

/* คงคลาส modal เดิมไว้สำหรับ Modal Product Detail */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1100;
  animation: fadeIn 0.3s;
  backdrop-filter: blur(5px);
  padding: 20px;
  overflow-y: auto;
}

/* แก้ไขการแสดงผลของ Modal Content เพื่อให้เข้ากันกับการออกแบบใหม่ */
.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* เพิ่มคลาสเฉพาะสำหรับ Product Detail Modal */
.modal-content.product-detail-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 0;
  margin: 20px auto;
  animation: slideUp 0.4s ease-out;
}

/* สำหรับ Dark Mode */
body.dark-mode .modal-content {
  background: #202323;
}

body.dark-mode .modal-content.product-detail-modal {
  background: #202323;
  color: #e0e0e0;
}

/* Media Queries สำหรับความรองรับหน้าจอขนาดต่างๆ */
@media (max-width: 768px) {
  .modal-content.product-detail-modal {
    max-width: 90%;
    max-height: 80vh;
  }
}

@media (max-width: 480px) {
  .modal-content.product-detail-modal {
    padding: 0;
    margin: 10px auto;
  }
}

/* ปรับปรุง Modal สินค้าให้ดูทันสมัยและมีเอกลักษณ์ */

/* หลัก Modal Container */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 1100;
  animation: modalFadeIn 0.4s;
  backdrop-filter: blur(8px);
  padding: 20px;
  overflow-y: auto;
}

@keyframes modalFadeIn {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(8px); }
}

.modal-content.product-detail-modal {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  padding: 0;
  margin: 20px auto;
  animation: modalSlideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes modalSlideUp {
  from { transform: translateY(70px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ปรับแต่ง Scrollbar ให้สวยงามมากขึ้น */
.modal-content.product-detail-modal::-webkit-scrollbar {
  width: 8px;
}

.modal-content.product-detail-modal::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.modal-content.product-detail-modal::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
  transition: all 0.3s;
}

.modal-content.product-detail-modal::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* ปุ่มปิด Modal แบบใหม่ */
.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
  border: none;
}

.close-modal:hover {
  background: var(--danger);
  color: white;
  transform: rotate(90deg) scale(1.1);
}

.close-modal i {
  font-size: 20px;
}

/* ปรับแต่งส่วนหัวของสินค้า */
.product-detail-container {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 30px;
  padding: 35px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(245, 245, 245, 0.9));
  border-radius: 20px 20px 0 0;
}

/* ปรับแต่งรูปภาพสินค้า */
.product-detail-image-section {
  position: relative;
}

.product-main-image {
  border-radius: 15px;
  overflow: hidden;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  transition: all 0.4s;
}

.product-main-image:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

.product-main-image img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
  transition: transform 0.7s ease-in-out;
}

.product-main-image img:hover {
  transform: scale(1.07);
}

/* ส่วนรูปย่อยด้านล่าง */
.image-thumbnails {
  display: flex;
  margin-top: 20px;
  gap: 12px;
  justify-content: center;
}

.thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.thumbnail:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail.active {
  border: 2px solid var(--primary);
}

/* ส่วนข้อมูลสินค้า */
.product-detail-info-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-badges {
  display: flex;
  gap: 10px;
  margin-bottom: 5px;
}

.badge {
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.new-badge {
  background: linear-gradient(135deg, var(--primary), #4f7bf2);
  color: white;
}

.hot-badge {
  background: linear-gradient(135deg, var(--danger), #f47171);
  color: white;
}

.product-detail-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 10px 0;
}

.product-rating .fas {
  color: var(--warning);
  font-size: 18px;
}

.product-rating .far {
  color: #d1d1d1;
  font-size: 18px;
}

.rating-count {
  margin-left: 10px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.product-price-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 15px 0;
  background: rgba(245, 245, 245, 0.7);
  padding: 15px;
  border-radius: 12px;
}

.product-detail-price {
  font-size: 38px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
}

.price-currency {
  font-size: 24px;
  margin-right: 5px;
  align-self: flex-start;
  margin-top: 5px;
}

.product-availability {
  color: white;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--success), #4ade80);
  padding: 8px 15px;
  border-radius: 30px;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.2);
}

.product-description {
  color: #555;
  line-height: 1.7;
  border-top: 1px solid #eee;
  padding-top: 20px;
  font-size: 15px;
}

/* คุณสมบัติสินค้า */
.product-specs {
  background: rgba(245, 245, 245, 0.7);
  padding: 20px;
  border-radius: 15px;
  margin-top: 10px;
}

.product-specs h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--dark);
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 8px;
}

.product-specs ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product-specs li {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-specs li i {
  color: var(--success);
  font-size: 16px;
}

/* ส่วนซื้อสินค้า */
.product-quantity {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}

.product-quantity label {
  font-weight: 500;
  color: #555;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 2px solid #eaeaea;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.qty-btn {
  width: 40px;
  height: 40px;
  background: #f8f8f8;
  border: none;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: #e9e9e9;
  color: var(--primary);
}

#product-qty {
  width: 60px;
  height: 40px;
  border: none;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  -moz-appearance: textfield;
  background: white;
}

#product-qty::-webkit-outer-spin-button,
#product-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ปุ่มกระทำการ */
.product-actions-container {
  display: flex;
  gap: 15px;
  margin: 25px 0;
}

.action-button {
  border: none;
  border-radius: 12px;
  padding: 15px 25px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cart-button {
  background: linear-gradient(135deg, var(--primary), #4f7bf2);
  color: white;
  flex: 2;
}

.cart-button:hover {
  background: linear-gradient(135deg, #4f7bf2, var(--primary));
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.buy-button {
  background: linear-gradient(135deg, var(--accent), #f7ba4e);
  color: white;
  flex: 2;
}

.buy-button:hover {
  background: linear-gradient(135deg, #f7ba4e, var(--accent));
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.wishlist-button, .share-button {
  background: white;
  color: #555;
  width: 50px;
  height: 50px;
  padding: 0;
  flex: 0;
  border-radius: 50%;
}

.wishlist-button:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  transform: translateY(-3px) scale(1.1);
}

.share-button:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  transform: translateY(-3px) scale(1.1);
}

/* ข้อมูลการจัดส่ง */
.product-delivery-info {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(245, 245, 245, 0.7));
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.delivery-option {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
  background: white;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.3s;
}

.delivery-option:hover {
  transform: translateX(5px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.delivery-option:last-child {
  margin-bottom: 0;
}

.delivery-option i {
  color: var(--primary);
  font-size: 18px;
  background: rgba(37, 99, 235, 0.1);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* ส่วน Tabs */
.product-detail-tabs {
  margin-top: 0;
  padding: 0 35px 35px;
  background: white;
  border-radius: 0 0 20px 20px;
}

.tab-headers {
  display: flex;
  margin-bottom: 25px;
  border-bottom: none;
  gap: 5px;
}

.tab-btn {
  padding: 12px 20px;
  background: rgba(245, 245, 245, 0.7);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #777;
  transition: all 0.3s;
}

.tab-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), #4f7bf2);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

.tab-btn:hover:not(.active) {
  background: rgba(235, 235, 235, 0.9);
  color: var(--dark);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s;
  background: rgba(250, 250, 250, 0.7);
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
  display: block;
}

/* สินค้าที่เกี่ยวข้อง */
.related-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.related-product-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  border: 1px solid #f0f0f0;
  position: relative;
}

.related-product-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.related-product-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: all 0.5s;
}

.related-product-card:hover .related-product-image {
  transform: scale(1.08);
}

.related-product-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(250, 250, 250, 0.9));
}

.related-product-info h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--dark);
  line-height: 1.4;
  height: 44px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.related-product-info p {
  margin: 0 0 10px;
  font-size: 14px;
  color: #666;
  flex-grow: 1;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.related-product-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 12px;
}

.related-product-card .action-button {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  background: linear-gradient(135deg, var(--primary), #4f7bf2);
  color: white;
  border-radius: 8px;
  transition: all 0.3s;
}

.related-product-card .action-button:hover {
  background: linear-gradient(135deg, #4f7bf2, var(--primary));
  transform: translateY(-2px);
}

/* รีวิวจากลูกค้า */
.customer-reviews {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-item {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
  transition: all 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.review-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.reviewer-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.reviewer-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.reviewer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reviewer-name {
  font-weight: 600;
  color: var(--dark);
}

.review-date {
  font-size: 13px;
  color: #888;
}

.review-rating {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
  padding: 5px 10px;
  border-radius: 20px;
}

.review-text {
  line-height: 1.7;
  color: #555;
  background: rgba(250, 250, 250, 0.7);
  padding: 15px;
  border-radius: 10px;
  font-style: italic;
}

/* รายละเอียดเพิ่มเติม */
.detailed-specs {
  padding: 10px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.specs-table th, .specs-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.specs-table th {
  width: 30%;
  font-weight: 600;
  color: var(--dark);
  background: rgba(245, 245, 245, 0.9);
}

.specs-table tr:last-child th,
.specs-table tr:last-child td {
  border-bottom: none;
}

.specs-table tr:hover td {
  background: rgba(0, 0, 0, 0.01);
}

/* Dark Mode Support */
body.dark-mode .modal-content.product-detail-modal {
  background: #202323;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .product-detail-container {
  background: linear-gradient(145deg, rgba(40, 40, 40, 1), rgba(30, 30, 30, 0.9));
}

body.dark-mode .product-detail-title,
body.dark-mode .product-specs h4 {
  color: #fff;
}

body.dark-mode .product-description,
body.dark-mode .review-text {
  color: #ccc;
}

body.dark-mode .product-specs li {
  color: #ddd;
}

body.dark-mode .product-specs {
  background: rgba(45, 45, 45, 0.7);
}

body.dark-mode .product-price-section {
  background: rgba(45, 45, 45, 0.7);
}

body.dark-mode .qty-btn,
body.dark-mode #product-qty {
  background: #333;
  color: #eee;
}

body.dark-mode .qty-btn:hover {
  background: #444;
  color: var(--primary);
}

body.dark-mode .product-delivery-info {
  background: linear-gradient(145deg, rgba(40, 40, 40, 0.8), rgba(30, 30, 30, 0.7));
}

body.dark-mode .delivery-option {
  background: #2d2d2d;
}

body.dark-mode .tab-btn {
  background: rgba(50, 50, 50, 0.7);
  color: #aaa;
}

body.dark-mode .tab-btn:hover:not(.active) {
  background: rgba(60, 60, 60, 0.9);
  color: #eee;
}

body.dark-mode .tab-content {
  background: rgba(40, 40, 40, 0.7);
}

body.dark-mode .related-product-card {
  background: #2d2d2d;
  border-color: #444;
}

body.dark-mode .related-product-info {
  background: linear-gradient(145deg, rgba(45, 45, 45, 1), rgba(40, 40, 40, 0.9));
}

body.dark-mode .related-product-info h4 {
  color: #fff;
}

body.dark-mode .related-product-info p {
  color: #ccc;
}

body.dark-mode .review-item {
  background: #2d2d2d;
}

body.dark-mode .review-text {
  background: rgba(45, 45, 45, 0.7);
}

body.dark-mode .specs-table th {
  background: #333;
  color: #fff;
}

body.dark-mode .specs-table td {
  color: #ddd;
}

body.dark-mode .specs-table th,
body.dark-mode .specs-table td {
  border-color: #444;
}

body.dark-mode .wishlist-button, 
body.dark-mode .share-button {
  background: #2d2d2d;
  color: #ddd;
}

body.dark-mode .wishlist-button:hover {
  background: rgba(239, 68, 68, 0.2);
}

body.dark-mode .share-button:hover {
  background: rgba(37, 99, 235, 0.2);
}

/* Media Queries */
@media (max-width: 992px) {
  .product-detail-container {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 25px;
  }
  
  .product-main-image img {
    height: 350px;
  }
  
  .product-detail-title {
    font-size: 28px;
  }
  
  .product-detail-price {
    font-size: 34px;
  }
  
  .product-specs ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .product-detail-container {
    padding: 20px;
  }
  
  .product-main-image img {
    height: 300px;
  }
  
  .product-detail-title {
    font-size: 24px;
  }
  
  .product-actions-container {
    flex-wrap: wrap;
  }
  
  .cart-button, .buy-button {
    flex: 1 0 100%;
    margin-bottom: 10px;
  }
  
  .wishlist-button, .share-button {
    flex: 1;
  }
  
  .tab-btn {
    padding: 10px 15px;
    font-size: 14px;
  }
  
  .product-detail-tabs {
    padding: 0 20px 20px;
  }
  
  .related-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .modal-content.product-detail-modal {
    margin: 10px;
    max-width: calc(100% - 20px);
  }
  
  .product-detail-container,
  .product-detail-tabs {
    padding: 15px;
  }
  
  .product-main-image img {
    height: 250px;
  }
  
  .product-detail-title {
    font-size: 22px;
  }
  
  .product-detail-price {
    font-size: 30px;
  }
  
  .tab-headers {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    gap: 3px;
  }
  
  .tab-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .related-products-grid {
    grid-template-columns: 1fr;
  }
  
  .related-product-image {
    height: 180px;
  }
  
  .image-thumbnails {
    gap: 8px;
  }
  
  .thumbnail {
    width: 60px;
    height: 60px;
  }
}
/* แก้ไขปัญหาแถบดำของปุ่มกระทำการสินค้า */

/* ปุ่มกระทำการสินค้า - ปรับปรุงใหม่ */
.product-actions {
  position: absolute;
  bottom: -60px; /* เริ่มต้นซ่อนไว้ด้านล่าง */
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between; /* กระจายปุ่มแบบสม่ำเสมอ */
  align-items: center;
  transition: all 0.3s ease;
  z-index: 5;
  border-radius: 0 0 8px 8px;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.product-card {
  position: relative;
  overflow: hidden;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  width: 100%;
  height: 100%; /* ให้แน่ใจว่าการ์ดมีความสูงที่แน่นอน */
  display: flex;
  flex-direction: column;
}

/* ปรับปรุงการแสดงปุ่มกระทำการเมื่อ hover */
.product-card:hover .product-actions {
  bottom: 0;
  opacity: 1;
}

/* เริ่มต้นซ่อนแถบปุ่มกระทำการ (ถ้าต้องการ) */
.product-actions {
  bottom: -60px; /* ซ่อนไว้ด้านล่าง */
  opacity: 0.9;
}

/* ปรับแต่งปุ่มกระทำการให้สวยงาม */
.action-button {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  padding: 5px 10px;
  border-radius: 5px;
}

/* ปุ่มเพิ่มสินค้า */
.action-add {
  background: var(--primary);
  flex-grow: 1;
}

.action-add:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

/* ปุ่มใส่ตะกร้า */
.action-cart {
  background: var(--accent);
  flex-grow: 1;
}

.action-cart:hover {
  background: var(--warning);
  transform: translateY(-2px);
}

/* ปุ่มชื่นชอบ */
.action-like {
  background: transparent;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.action-like:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

/* ราคาสินค้า */
.product-price-tag {
  color: var(--warning);
  font-weight: 700;
  font-size: 1.1rem;
}

/* แก้ไขการแสดงผลบนอุปกรณ์มือถือ */
@media (max-width: 768px) {
  .product-actions {
    padding: 8px 10px;
  }
  
  .action-button {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
}

/* แก้ไขเมื่อ Modal เปิด */
.modal-open .product-actions {
  z-index: 1; /* ลด z-index เมื่อ modal เปิด */
}

/* แก้ไขความขัดแย้งกับ Modal */
.modal {
  z-index: 1200; /* สูงกว่า product-actions */
}

.modal-content {
  z-index: 1210; /* สูงกว่า modal */
}

/* สร้างเอฟเฟกต์เคลื่อนไหวที่สวยงาม */
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.product-actions {
  animation: slideUp 0.3s ease-out;
}

/* Modern Social Links - Square Rounded Style */
.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.social-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  transform-style: preserve-3d;
}

/* Facebook */
.social-links a:nth-child(1) {
  background: linear-gradient(135deg, #3b5998, #1e3a8a);
  box-shadow: 0 4px 15px rgba(59, 89, 152, 0.4);
}

.social-links a:nth-child(1):hover {
  background: linear-gradient(135deg, #4267B2, #2563eb);
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 25px rgba(59, 89, 152, 0.6);
}

/* Line */
.social-links a:nth-child(2) {
  background: linear-gradient(135deg, #00c300, #00b300);
  box-shadow: 0 4px 15px rgba(0, 195, 0, 0.4);
}

.social-links a:nth-child(2):hover {
  background: linear-gradient(135deg, #06d755, #00c300);
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 195, 0, 0.6);
}

/* TikTok */
.social-links a:nth-child(3) {
  background: linear-gradient(135deg, #2b292a, #000);
  box-shadow: 0 4px 15px rgba(255, 0, 80, 0.4);
}

.social-links a:nth-child(3):hover {
  background: linear-gradient(135deg, #ff1757, #1a1a1a);
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 25px rgba(255, 0, 80, 0.6);
}

.social-links a i {
  font-size: 24px;
  color: white;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.social-links a:hover i {
  transform: scale(1.2);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

/* Ripple effect */
.social-links a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.social-links a:hover::before {
  width: 100%;
  height: 100%;
}

/* Additional rounded square effects */
.social-links a::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 20px;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.social-links a:hover::after {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 480px) {
  .social-links a {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .social-links a i {
    font-size: 20px;
  }

  .social-links {
    gap: 15px;
  }

  .social-links a::before {
    border-radius: 15px;
  }
}
/* เพิ่มใน CSS file หรือ <style> tag */
#registerForm #reg-phone,
#registerForm #reg-address,
#registerForm label[for="reg-phone"],
#registerForm label[for="reg-address"] {
  display: none !important;
}
/* =================================== */
/* Styling for Footer Policy Links    */
/* =================================== */

.footer-bottom {
  border-bottom: 1px solid #444; /* สร้างเส้นคั่นบางๆ */
  padding-top: 1rem;
  margin-top: 1.5rem;
  text-align: center;
  color: #f4f6f8; /* สีตัวอักษรโทนเทาอ่อน */
  font-size: 0.9rem;
}

.footer-legal-links a {
  display: block; /* ทำให้แต่ละลิงก์กินพื้นที่ทั้งบรรทัด */
  margin-bottom: 5px; /* เพิ่มระยะห่างระหว่างลิงก์เล็กน้อย (ปรับได้ตามต้องการ) */
}

/* คุณอาจจะต้องปรับการจัดเรียงข้อความถ้าหากมันจัดกึ่งกลางอยู่ */
.footer-legal-links {
  text-align: left; /* ทำให้ลิงก์จัดชิดซ้าย (ถ้าเดิมเป็นกึ่งกลาง) */
}

.footer-legal-links a {
  color: #adb5bd;
  text-decoration: none;
  margin: 0 10px; /* ระยะห่างระหว่างลิงก์ */
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

.footer-legal-links a:hover {
  color: #ffffff; /* เปลี่ยนเป็นสีขาวเมื่อเมาส์ชี้ */
  text-decoration: underline;
}

.footer-bottom p {
  margin: 0;
  padding: 0;
}
/* 🏛️ ENTERPRISE PAYMENT STYLES - เพิ่มใน styles.css */

.enterprise-payment-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  animation: enterpriseFadeIn 0.3s ease-out;
}

.enterprise-payment-modal {
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  border-radius: 20px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.8);
  max-width: 600px;
  width: 95%;
  max-height: 90vh;
  overflow: hidden;
  animation: enterpriseSlideUp 0.4s ease-out;
}

.payment-header {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: white;
  padding: 25px;
  position: relative;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-content i {
  font-size: 1.8rem;
}

.header-content h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

.payment-id {
  margin-left: auto;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.close-enterprise-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-enterprise-modal:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.payment-body {
  padding: 0;
  overflow-y: auto;
  max-height: calc(90vh - 200px);
}

.payment-summary-card,
.bank-details-card,
.slip-upload-card {
  margin: 20px;
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.payment-summary-card h3,
.bank-details-card h3,
.slip-upload-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 1.2rem;
  font-weight: 700;
}

.items-list {
  background: #f9fafb;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.item-row:last-child {
  border-bottom: none;
}

.item-name {
  flex: 1;
  font-weight: 600;
  color: #374151;
}

.item-qty {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0 15px;
}

.item-price {
  font-weight: 700;
  color: #1f2937;
}

.total-amount {
  text-align: center;
  font-size: 1.4rem;
  color: #1e40af;
  padding: 15px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  border-radius: 10px;
  border: 2px solid #3b82f6;
}

.bank-info {
  background: #f9fafb;
  border-radius: 10px;
  padding: 20px;
}

.bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}

.bank-row:last-child {
  border-bottom: none;
}

.bank-row .label {
  font-weight: 600;
  color: #6b7280;
}

.bank-row .value {
  font-weight: 700;
  color: #1f2937;
}

.copy-account {
  font-family: 'Courier New', monospace;
  background: #e5e7eb;
  padding: 5px 10px;
  border-radius: 5px;
}

.copy-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 10px;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

/* 🔧 แก้ไข Upload Area CSS */
.upload-area {
  border: 3px dashed #d1d5db;
  border-radius: 15px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: linear-gradient(145deg, #f9fafb, #ffffff);
  position: relative; /* เพิ่ม */
  min-height: 120px; /* เพิ่ม */
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: #3b82f6;
  background: linear-gradient(145deg, #dbeafe, #f0f9ff);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2); /* เพิ่ม */
}

/* 🔧 แก้ไข File Input */
.upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1; /* เพิ่ม */
}

/* 🔧 Upload Placeholder ที่ดีขึ้น */
.upload-placeholder {
  pointer-events: none; /* เพิ่ม - ป้องกันไม่ให้บล็อค file input */
  position: relative;
  z-index: 0;
}

.upload-placeholder i {
  font-size: 3rem;
  color: #3b82f6;
  margin-bottom: 15px;
  display: block;
}

.upload-placeholder p {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin: 10px 0;
}

.upload-placeholder small {
  color: #6b7280;
  font-size: 0.9rem;
  display: block;
  margin-top: 8px;
}

/* 🔧 File Preview ที่ดีขึ้น */
.file-preview {
  margin-top: 20px;
  position: relative;
  z-index: 2; /* เพิ่ม */
}

.preview-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 15px;
  border: 2px solid #10b981; /* เพิ่ม - แสดงว่าไฟล์ถูกเลือกแล้ว */
}

.preview-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 5px 0;
  word-break: break-word; /* เพิ่ม */
}

.file-size {
  color: #6b7280;
  font-size: 0.9rem;
}

.remove-file {
  background: #ef4444;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0; /* เพิ่ม */
}

.remove-file:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* 🔧 Active State เมื่อมีไฟล์ */
.upload-area.has-file {
  border-color: #10b981;
  background: linear-gradient(145deg, #ecfdf5, #f0fdf4);
}

/* 🔧 Loading State */
.upload-area.loading {
  pointer-events: none;
  opacity: 0.7;
}

.upload-area.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.file-preview {
  margin-top: 20px;
}

.preview-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 15px;
}

.preview-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 5px 0;
}

.file-size {
  color: #6b7280;
  font-size: 0.9rem;
}

.remove-file {
  background: #ef4444;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.remove-file:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.payment-footer {
  padding: 25px;
  background: #f9fafb;
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
}

.btn-cancel,
.btn-confirm {
  padding: 15px 30px;
  border-radius: 10px;
  font-weight: 700;
  text-transform: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-cancel {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
}

.btn-cancel:hover {
  background: linear-gradient(135deg, #4b5563, #374151);
  transform: translateY(-2px);
}

.btn-confirm {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-confirm:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-confirm:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-confirm.ready {
  animation: confirmPulse 2s infinite;
}

/* 🎉 Success Modal */
.enterprise-success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000000;
  animation: enterpriseFadeIn 0.3s ease-out;
}

.enterprise-success-modal {
  background: linear-gradient(145deg, #ffffff, #f0fdf4);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  max-width: 500px;
  width: 95%;
  overflow: hidden;
  animation: enterpriseSlideUp 0.4s ease-out;
}

.success-header {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 30px;
  text-align: center;
}

.success-header i {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: successBounce 0.6s ease-out;
}

.success-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.success-body {
  padding: 30px;
}

.success-body p {
  margin: 15px 0;
  font-size: 1.1rem;
  text-align: center;
}

.next-steps {
  background: #f0fdf4;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid #bbf7d0;
}

.next-steps h3 {
  color: #059669;
  margin: 0 0 15px 0;
  font-size: 1.2rem;
}

.next-steps ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.next-steps li {
  padding: 8px 0;
  font-size: 1rem;
  color: #374151;
}

.success-footer {
  padding: 25px;
  text-align: center;
  background: #f9fafb;
}

.btn-success-ok {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-success-ok:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
}

/* 🎭 Animations */
@keyframes enterpriseFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes enterpriseSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes confirmPulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 6px 25px rgba(16, 185, 129, 0.6); }
}

@keyframes successBounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* 📱 Responsive */
@media (max-width: 768px) {
  .enterprise-payment-modal {
    margin: 10px;
    max-height: 95vh;
  }
  
  .payment-footer {
    flex-direction: column;
  }
  
  .payment-summary-card,
  .bank-details-card,
  .slip-upload-card {
    margin: 15px;
    padding: 20px;
  }
}
/* Chat UI Styles */
.chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #007bff;
  color: white;
  padding: 10px 15px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  font-family: 'Prompt', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-button i {
  font-size: 20px;
}

.chat-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  z-index: 1000;
  font-family: 'Prompt', sans-serif;
  overflow: hidden;
}

.chat-header {
  padding: 15px;
  background: #007bff;
  color: white;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

.user-message, .bot-message {
  margin-bottom: 10px;
  padding: 10px 15px;
  border-radius: 20px;
  max-width: 80%;
  word-wrap: break-word;
}

.user-message {
  margin-left: auto;
  background: #e3f2fd;
  color: #333;
}

.bot-message {
  margin-right: auto;
  background: #f0f0f0;
  color: #333;
}

.chat-input {
  padding: 10px;
  border-top: 1px solid #eee;
  display: flex;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-family: 'Prompt', sans-serif;
}

.chat-input button {
  margin-left: 10px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

@keyframes typing {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}