/*!/wp-content/themes/flatsome-child/product-style.css*/body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #fff;
  color: #222;
}

.logo-center {
  display: block;
  margin: 0 auto;
}

.container {
  max-width: 1200px;
  margin: auto;
  display: flex;
  padding: 1rem;
  gap: 1rem;
  min-height: 100vh;
  align-items: flex-start;
  flex-wrap: nowrap; /* ป้องกัน sidebar ทับ product */
}
.nobody-wrapper {
  display: flex;
  justify-content: center; /* จัดกลางแนวนอน */
  align-items: center;     /* จัดกลางแนวตั้ง */
  height: 100%;            /* ต้องให้สูงเท่ากับ container */
  min-height: 400px;       /* กันไว้ถ้าข้างในไม่มีความสูงเพียงพอ */
  position: relative;      /* รองรับการจัด layout เพิ่มเติมถ้าจำเป็น */
}

/*****************************/

.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #ddd;
  padding: 1rem;
  height: fit-content;
  box-sizing: border-box;
  /* ทำให้ child absolute ทำงานภายใน sidebar */
  position: relative;	
}

#categorySidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar img {
  width: 150px;
}

.sidebar h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.category-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
}

.category-menu li {
  margin-bottom: 0.5rem;
  font-size: 14px;
}

.category-menu li a {
  text-decoration: none;
  color: #0073aa;
  cursor: pointer;
}

.post-views-box {
  margin-top: auto;              /* ดันลงล่าง */
  text-align: right;             /* ชิดขวาในกล่อง */
  padding-top: 1rem;
  font-size: 0.85rem;
  color: #555;
}

/*****************************/

.product-grid {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.product-grid {
  margin-top: 30px; /* เว้นช่องว่างให้ sort-links ไม่ทับ */
}

.product {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 4px;
  text-align: center;
  box-sizing: border-box;
}

.product img {
  max-width: 100%;
  height: auto;
  max-height: 160px; /* ลดขนาดภาพ */
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.product h3 {
  font-size: 1rem;
  margin: 0.3rem 0 0.6rem;
}

.product p {
/*  font-weight: bold;*/
  color: #444;
  margin: 0 0 0.8rem;
}

.product a {
  display: inline-block;
  padding: 6px 12px;
  background-color: #0073aa;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
}

.product a:hover {
  background-color: #005f8d;
}

.product-detail {
  max-width: 700px;
  margin: auto;
  padding: 1rem;
}

.product-images-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์ */
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.product-image-wrapper {
  width: 100%;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}

.product-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}


/* แบบปุ่มซื้อด้านล่างหน้า product */
/*
.price-buy-wrapper {
  max-width: 420px;
  width: 100%;
  margin: 0 auto; 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 10px 30px rgba(255, 75, 43, 0.15);
  background: white;
  border-radius: 20px;
  padding: 20px 24px;
}
*/
.price-buy-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff8f7;
  padding: 12px 20px;
  border-radius: 40px;
  box-shadow: 0 4px 15px rgba(255, 75, 43, 0.3);
  margin-bottom: 20px;
}

.price-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: #ff4b2b;
  user-select: none;
}

.price-text span {
  font-weight: 800;
  font-size: 2.5rem;
}

.btn-buy-now {
  background: linear-gradient(45deg, #ff416c, #ff4b2b);
  color: #fff;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 1.2rem;
  box-shadow: 0 6px 18px rgba(255, 75, 43, 0.7);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
}

.btn-buy-now:hover,
.btn-buy-now:focus {
  background: linear-gradient(45deg, #ff4b2b, #ff416c);
  box-shadow: 0 8px 22px rgba(255, 75, 43, 0.9);
  transform: scale(1.08);
  outline: none;
}

.btn-buy-now:active {
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(255, 75, 43, 0.5);
}

.back-to-shop {
  text-align: right;
  font-size: 0.9rem;
  padding-bottom:20px;	
  margin: 0;
}
.back-to-shop-left {
  text-align: left;
  font-size: 0.9rem;
  padding-top:20px;	
  margin: 0;
}

.back-to-shop a, .back-to-shop-left a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.back-to-shop a:hover, .back-to-shop-left a:hover {
  color: #ff4b2b;
  text-decoration: underline;
}


/* ปุ่ม sort มุมบนขวา */
.heading-with-sort {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* เผื่อจอเล็ก จะแยกบรรทัดได้ */
  margin-bottom: 12px;
}

.category-heading {
  font-size: 24px;
  margin: 0;
  color: #333;
}

.sort-links {
  font-weight: 600;
  color: #666;
}

.sort-links a {
  color: #ff4b2b;
  text-decoration: none;
  margin-left: 8px;
}

.sort-links a:hover {
  text-decoration: underline;
}



.category-sort-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
  padding: 0 8px;
  font-weight: 600;
  flex-wrap: wrap;
}

.current-category {
  color: #333;
  font-size: 1.1em;
}

.sort-links a {
  margin-left: 8px;
  color: #555;
  text-decoration: none;
}

.sort-links a.active {
  color: #ff4b2b;
  text-decoration: underline;
}

  .price-old {
    color: #999;
    text-decoration: line-through;
    font-size: 1rem;
    margin-right: 10px;
  }

  .price-new {
    color: #e63946;
    font-weight: 700;
    font-size: 1.5rem;
  }

  .discount {
    margin-top: 8px;
    color: #2a9d8f;
    font-weight: 600;
    font-size: 1rem;
  }
  .btn-buy {
    background-color: green;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 300;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  .btn-buy:hover {
    background-color: #b2222e;
  }

     .product-box {
      width: 250px;
      padding: 16px;
      position: relative;
    }

    .product-name {
      font-size: 18px;
      margin-bottom: 12px;
      color: #333;
    }

    .price-box {
      position: relative;
      display: inline-block;
	  margin-top:5px;
    }

    .sale-label {
      position: absolute;
      top: -10px;
      left: -12px;
      background-color: #ff3366;
      color: white;
      font-size: 12px;
      font-weight: bold;
      padding: 4px 8px;
      border-radius: 6px;
      transform: rotate(-10deg);
      box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    }

    .price {
      font-size: 40px;
      color: #e60000;
      font-weight: bold;
      margin-top:1px;
    }
    .baht {font-size:14px;color:#444;font-weight: none;}
	.shopnow {font-size:30px;}


/******************ส่วนของ product id *****************************/
.product-detail-container {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Sidebar ด้านซ้าย (PC) */
.product-sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 1rem;
  background: #fff;
  border: 1px solid #ddd;
  padding: 1rem;
  height: fit-content;
  box-sizing: border-box;
}

.product-sidebar img {
  width: 150px;
  margin-bottom: 1rem;
}

.product-sidebar h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.product-meta {
  list-style: none;
  padding: 0;
  font-size: 14px;
}

.product-meta li {
  margin-bottom: 0.5rem;
}

/* เนื้อหาหลักด้านขวา */
.product-detail-main {
  flex-grow: 1;
}


/* star rating */
.star-rating {
  display: inline-flex;
  font-size: 1.3rem;
  gap: 2px;
  vertical-align: middle;
}

.star {
  position: relative;
  color: #ccc;
}

.star::before {
  content: '★';
}

.star.full::before {
  color: gold;
}

.star.half::after {
  content: '★';
  color: gold;
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  z-index: 1;
}

.preferred-shop-badge {
  display: inline-flex;
  align-items: center;
  background-color: #ffe066;
  color: #8c5700;
  font-weight: bold;
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 5px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}


.breadcrumb-container {
  margin-bottom: 1em;
  font-size: 0.95rem;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumb li {
  display: flex;
  align-items: center;
}
.breadcrumb li + li::before {
  content: "›";
  margin: 0 0.5em;
  color: #aaa;
}
.breadcrumb a {
  text-decoration: none;
  color: #0073aa;
}
.breadcrumb a:hover {
  text-decoration: underline;
}


/******** แชร์ Social ********************/

.social-share-icons {
  margin-top: 15px;
  display: flex;
  gap: 12px;
}

.social-share-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background-color: #f8f9fa;
  color: #7f8c8d;
  border: 1px solid #ecf0f1;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.social-share-icons a:hover {
  background-color: #3498db;
  color: #ffffff;
  transform: translateY(-2px);
}

.social-share-icons a i {
  transition: transform 0.3s ease;
}

.social-share-icons a:hover i {
  transform: scale(1.1);
}

.shared-notification {
  position: fixed;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #2ecc71;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: bottom 0.3s ease;
  z-index: 1000;
}

.shared-notification.show {
  bottom: 20px;
}
        .social-share-container {
            margin-top: 50px;
            border-top: 1px solid #ecf0f1;
            padding-top: 20px;
        }

        .share-text {
            font-size: 14px;
            color: #95a5a6;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }
        
        .share-text::before {
            content: '';
            display: inline-block;
            width: 4px;
            height: 16px;
            background-color: #3498db;
            margin-right: 8px;
            border-radius: 2px;
        }


#product-loading {
  background: linear-gradient(135deg, #ff6b6b, #f06595);
  color: white;
  padding: 25px 30px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  max-width: 480px;
  margin: 30px auto;
  box-shadow: 0 8px 20px rgba(240, 101, 149, 0.6);
  animation: pulseGlow 2.5s ease-in-out infinite;
}

#product-loading p {
  margin: 0 0 12px;
  line-height: 1.4;
}

#product-loading a {
  display: inline-block;
  background: white;
  color: #f06595;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

#product-loading a:hover,
#product-loading a:focus {
  background: #f06595;
  color: white;
  box-shadow: 0 6px 18px rgba(255, 107, 107, 0.9);
  outline: none;
  cursor: pointer;
}

/* Animation for subtle glowing effect */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 8px 20px rgba(240, 101, 149, 0.6);
  }
  50% {
    box-shadow: 0 12px 30px rgba(240, 101, 149, 0.9);
  }
}


/* 🎯 Responsive: บนมือถือซ่อน fix แล้วแสดงแบบเต็มบล็อก */
@media (max-width: 768px) {
  .product-detail-container {
    flex-direction: column;
  }

  .product-sidebar {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
  }

  .product-detail-main {
    width: 100%;
  }
}

/* ================== Responsive ================== */
@media (max-width: 480px) {
  .product-images-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 1rem;
  }

  .sidebar {
    width: 100%;
    position: relative;
    top: 0;
    border: none;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
  }

  .category-menu {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
  }

  .category-menu li {
    white-space: nowrap;
    margin: 0;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}