@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai+Looped:wght@400;700&display=swap');

:root {
  --default-font: "IBM Plex Sans Thai Looped",  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --heading-font: "IBM Plex Sans Thai Looped",  sans-serif;
  --nav-font: "IBM Plex Sans Thai Looped",  sans-serif;
}

:root { 
  --background-color: #ffffff; 
  --default-color: #19233e; 
  --heading-color: #19233e; 
  --accent-color: #19233e; 
  --surface-color: #ffffff; 
  --contrast-color: #ffffff; 
}

:root {
  --nav-color: #19233e;  
  --nav-hover-color: #19233e; 
  --nav-mobile-background-color: #ffffff; 
  --nav-dropdown-background-color: #ffffff; 
  --nav-dropdown-color: #19233e; 
  --nav-dropdown-hover-color: #19233e; 
}

.light-background {
  --background-color: #f9f9f9;
  --surface-color: #ffffff;
}

.dark-background {
  --background-color: #2a2c39;
  --default-color: #ffffff;
  --heading-color: #ffffff;
  --surface-color: #404356;
  --contrast-color: #ffffff;
}

:root {
  scroll-behavior: smooth;
}
  
  /*Hello Polo CSS*/

        body {
          font-family: "IBM Plex Sans Thai Looped",  sans-serif;
          /* display: flex;
          align-items: center;
          justify-content: center; */
          font-family: var(--default-font) !important;
          margin: 0;
          overflow-x: hidden;
        }

        /*--------------------------------------------------------------
        # Preloader
        --------------------------------------------------------------*/
        #preloader {
          position: fixed;
          inset: 0;
          z-index: 9999;
          overflow: hidden;
          background-color: var(--background-color);
          transition: all 0.6s ease-out;
          width: 100%;
          height: 100vh;
        }

        #preloader:before,
        #preloader:after {
          content: "";
          position: absolute;
          border: 4px solid var(--accent-color);
          border-radius: 50%;
          animation: animate-preloader 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
        }

        #preloader:after {
          animation-delay: -0.5s;
        }

        @keyframes animate-preloader {
          0% {
            width: 10px;
            height: 10px;
            top: calc(50% - 5px);
            left: calc(50% - 5px);
            opacity: 1;
          }

          100% {
            width: 72px;
            height: 72px;
            top: calc(50% - 36px);
            left: calc(50% - 36px);
            opacity: 0;
          }
        }

        /*--------------------------------------------------------------
        # Global Header
        --------------------------------------------------------------*/
        .header {
          --background-color: rgba(255, 255, 255, 0);
          --heading-color: #ffffff;
          color: var(--default-color);
          background: rgba(255, 255, 255, 0.75);
          /* padding: 10px; */
          /* width: 85% !important; */
          /* margin: 0 auto; */
          font-size: 1rem;
          color: #000000;
          border-bottom-left-radius: 0px;
          border-bottom-right-radius: 0px;
          padding: 5px 0;
          transition: opacity 0.3s ease, transform 0.3s ease;
          z-index: 1005;
          backdrop-filter: blur(10px) !important;
        }

        .header .logo {
          line-height: 1;
        }

        .header .logo img {
          max-height: 60px;
          margin-right: 8px;
        }

        .header .logo h1 {
          font-size: 30px;
          margin: 0;
          font-weight: 700;
          color: var(--heading-color);
        }

        .scrolled .header {
          box-shadow: 0px 0 18px rgba(0, 0, 0, 0.1);
        }

        /* Global Header on Scroll
        ------------------------------*/
        .scrolled .header {
          --background-color: rgba(255, 255, 255, 9);
          /* box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); */
        }

        .container {
          display: flex;
          width: 90vw;
          margin-top:15vh;
        }

        .nav-link {
          color: #000 !important;
        }

        .nav-link:hover {
          color: #2c2b2b !important;
        }

          .nav-link-underline {
            position: relative;
            display: inline-block;
            color: #000000;
            text-decoration: none;
            transition: color 0.3s ease;
          }

          .nav-link-underline::after {
            content: "";
            position: absolute;
            width: 0;
            height: 2px;
            left: 0;
            bottom: -2px;
            background-color: #000000;
            transition: width 0.3s ease;
          }

          .nav-link-underline:hover {
            color: #6c757d; 
          }
          
          .nav-link-underline:hover::after {
            width: 100%;
          }
          
            .carousel-inner {
            max-height: 500px;
          }

          .carousel-inner img {
            height: 500px;
            object-fit: cover;
            width: 100%;
          }

        .hover-container {
          position: relative;
          width: 100%;
          overflow: hidden; 
        }

        .hover-container img {
          width: 100%;
          height: auto;
          display: block;
          border-radius: 0px;
        }

        .hover-content {
          position: absolute;
          bottom: 0;
          left: 0;
          right: 0;
          background: rgba(255, 255, 255, 0.95);
          padding: 10px;
          font-size: 14px;
          color: #000;
          border-bottom-left-radius: 0px;
          border-bottom-right-radius: 0px;
          opacity: 0;
          transform: translateY(10px);
          transition: opacity 0.3s ease, transform 0.3s ease;
          pointer-events: none;
        }

        .hover-container:hover .hover-content {
          opacity: 1;
          transform: translateY(0);
          pointer-events: auto;
        }

        .img-fluid {
          box-shadow: none;
        }

        /* .text-logo {
          padding-top: 10px;
        } */

        html, body {
      scroll-behavior: auto !important;
    }

    body {
      /* padding-top: 80px; */
      background-color: #fefefe;
      font-family: var(--default-font);
      opacity: 0;
      transition: opacity 0.5s ease-in-out;
      background-color: #fefefe;
    }

    .footer {
      font-family: "IBM Plex Sans Thai Looped",  sans-serif;
    }

    body.loaded {
      opacity: 1;
    }

    .video-div {
      width: 100%;
      height: auto;
    }

    .product-card {
      transition: transform 0.3s ease-in-out;
      cursor: pointer;
      border: none;
      /* flex: 1 0 21%; */
      width: calc((100% - 36px) / 4);
      margin-bottom: 20px;
    }

    .product-image-wrapper {
      position: relative;
      overflow: hidden;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .product-image-wrapper img {
      width: 100%;
      transition: opacity 0.3s ease-in-out;
    }

    .product-image-wrapper img.human-view {
      position: absolute;
      top: 0;
      left: 0;
      opacity: 0;
    }

    .product-image-wrapper:hover img.human-view {
      opacity: 1;
    }

    .card-body {
      text-align: left;
    }

    .card-title {
      font-size: 1.2rem;
      margin-left:-14px;
    }

    .size {
      font-size: 0.8rem;
      margin-left:-14px;
      margin-top:-7px;
    }

    .note {
      font-size: 0.8rem;
      margin-left:-14px;
      margin-top:-15px;
      color:#a67c00; 
    }

    .badge-price {
      position: absolute;
      bottom: 10px;
      right: 10px;
      background:rgb(228, 163, 13);
      color: white;
      padding: 4px 8px;
      font-size: 0.9rem;
      border-radius: 5px;
      z-index: 10;
    }

    .badge-new {
      position: absolute;
      top: 10px;
      left: 10px;
      background: #dc3545;
      color: white;
      padding: 4px 8px;
      font-size: 0.9rem;
      border-radius: 5px;
      z-index: 10;
    }

    .color-select {
      margin-left:-14px;
      margin-top:-7px;
    }

    .color-dot {
      width: 15px;
      height: 15px;
      display: inline-block;
      margin-right: 2px;
      cursor: pointer;
      border: 1px solid #ccc;
      
    }

    .color-dot.active {
      outline: 1px solid #19233e;
      outline-offset: 1px;
    }

    .container-fluid {
      width: 80% !important;
      padding-top: 0;
    }

    .filter-menu {
      position: absolute;
      top: 0px;
      left: -300px; /* Filter initially out of view */
      background: white;
      padding: 10px;
      width: 200px;
      visibility: hidden;
      display: block;
      border-radius: 5px;
      z-index: 10;
      transition: left 0.4s ease-in-out; /* แอนิเมชันเมื่อเปิด */
    }

    .filter-menu.no-transition {
      transition: none; /* ไม่มีแอนิเมชันในกรณีโหลดหรือรีเฟรชหน้า */
    }

    .filter-menu.active {
      opacity: 1;
      visibility: visible;
      left: 0; /* Move filter into view */
      transition: left 0.4s ease-in-out;
    }

    .product-container {
      display: flex;
      justify-content: flex-start;
      gap: 12px;
      flex-wrap: wrap;
      transition: all 0.4s ease-in-out;
      font-size: 1rem;
    }

    .product-container.shrink {
      transform: scale(0.95) translate(20px, -20px); 
      margin-left: 210px; 
    }

    .product-container.shrink .card-body {
      font-size: 0.9rem; 
      transition: font-size 0.3s ease; 
    }

    .product-container.shrink .color-dot {
      width: 13px; 
      height: 13px; 
      transition: width 0.3s ease, height 0.3s ease; 
    }

    .product-container.shrink .badge-new {
      font-size:0.7rem;
      transition: width 0.3s ease, height 0.3s ease; 
    }

    .product-container.shrink .badge-price {
      font-size:0.7rem;
      transition: width 0.3s ease, height 0.3s ease; 
    }

    .sort-dropdown {
        font-size: 0.95rem;
        display: inline-block;
      }

      .sort-toggle {
        background: none;
        border: none;
        color: #000;
        font-weight: 500;
        padding: 0;
        cursor: pointer;
        text-decoration: none;
      }

      .sort-toggle:hover {
        text-decoration: none;
      }

      .sort-menu {
        width: 160px;
        position: absolute;
        top: 100%;
        right: 0;
        z-index: 1050;
        text-align: right !important;
      }

      .sort-item {
        padding: 6px 10px;
        cursor: pointer;
        white-space: nowrap;
      }

      .sort-item:hover {
        background-color: #f1f1f1;
      }

      .sort-item.text-muted {
        pointer-events: none;
        color: #999;
      }

      .d-none {
        display: none !important;
      }

      .dropdown-item.sort-item:hover {
        background-color: transparent !important;
        color: inherit !important;
      }

    .re-filter {
      margin-top:5px;
    }

    .product-container.fade-out {
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.5s ease;
    }

    .product-container.fade-in {
      opacity: 1;
      pointer-events: auto;
      transition: opacity 0.5s ease;
    }

    .filter-menu.fade-out,
    .sort-menu.fade-out {
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }

    .filter-menu.fade-in,
    .sort-menu.fade-in {
      opacity: 1;
      pointer-events: auto;
      transition: opacity 0.3s ease;
    }

    .search-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0, 0, 0, 0.3);
      backdrop-filter: blur(10px);
      z-index: 9999;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      padding-top: 20px;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.4s ease, visibility 0.4s ease;
    }

    /* เมื่อเปิดใช้งาน */
    .search-overlay.active {
      opacity: 1;
      visibility: visible;
    }

    /* กล่องค้นหา */
    .search-bar {
      display: flex;
      align-items: center;
      width: 90%;
      max-width: 800px;
      background: #ffffff;
      border-radius: 8px;
      padding: 12px 20px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    /* ช่อง input */
    .search-bar input {
      flex: 1;
      font-size: 18px;
      border: none;
      outline: none;
      background: transparent;
    }

    /* ปุ่มปิด */
    .btn-close-search {
      background: none;
      border: none;
      font-size: 24px;
      margin-left: 16px;
      cursor: pointer;
    }

    /* ป้องกัน scroll เมื่อเปิด search */
    body.no-scroll {
      overflow: hidden;
    }
    .search-input {
      border: none;
      outline: none;
      font-size: 18px;
      background: transparent;
    }
    input.form-control:focus {
      outline: none;
      box-shadow: none;
      border-color: #ccc;
    }

    .navone {
      top: 0; 
    }

    .navbar-brand {
      position: relative;
      left: -5vw;
    }

    .texthead {
      margin-top:5vh;
      
    }

    .texthead {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding: 20px;
      gap: 40px;
    }

    .texthead-left {
      flex: 1;
    }

    .texthead-right {
      flex: 1.2;
      font-size: 1rem;
      line-height: 1.7;
      word-break: keep-all;
      text-align: justify;
      hyphens: auto;
      margin: auto;
    }

    .texthead h4 {
      font-size: 1.5rem;
      font-weight: bold;
      margin: 0;
    }

    .texthead a {
      display: inline-block;
      margin-top: 10px;
      text-decoration: none;
      color: #333;
    }

    .texthead a:hover {
      text-decoration: underline;
    }

    @media (max-width: 768px) {
      .texthead {
        flex-direction: column;
      }
    }

    #product {
      scroll-margin-top: 160px; 
    }

    .copyright {
      width: 100%;
      text-align: center;
      padding-top: 15px;
      padding-top: 25px;
      border-top: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
      font-size: 13px;
    }

    .footer {
        background: #f8f9fa;
        padding: 40px 0 20px;
        border-top: 1px solid #eee;
    }

    .footer-brand {
        font-size: 1.5rem;
        font-weight: 600;
        color: #333;
        margin-bottom: 15px;
    }

    .footer-text {
        color: #6c757d;
        font-size: 0.9rem;
        max-width: 300px;
    }

    .social-links {
        margin: 20px 0;
    }

    .social-link {
        color: #6c757d;
        margin-right: 20px;
        font-size: 1.2rem;
        transition: color 0.3s ease;
    }
    
    .social-link img {
        margin-top: -5px;
        height: 20px;
        content: url("../img/lazada-g.png");
    }

    .social-link:hover img {
        filter: grayscale(0%);
        content: url("../img/lazada-b.png");
    }

    .social-link:hover {
        color: #19233e;
    }

    .footer-links {
        display: flex;
        gap: 20px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .footer-links a {
        color: #6c757d;
        text-decoration: none;
        font-size: 0.9rem;
        transition: color 0.3s ease;
    }

    .footer-links a:hover {
        color: #19233e;
    }

    .copyright {
        color: #6c757d;
        font-size: 0.85rem;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid #eee;
    }

    .nav-item a {
        text-decoration: none;
        color: inherit; 
      }

      .nav-item a:hover {
        text-decoration: none;
        color: #19233e; 
      }

      .custom-pagination .page-item {
        margin: 0 4px;
      }

      .custom-pagination .page-link {
        border-radius: 50%;
        width: 42px;
        height: 42px;
        padding: 0;
        line-height: 42px;
        text-align: center;
        background-color: #f8f9fa;
        color: #007bff;
        font-weight: 500;
        border: 1px solid #dee2e6;
        transition: all 0.2s ease-in-out;
      }

      .custom-pagination .page-link:hover {
        background-color: #19233e;
        color: white;
        border-color: #19233e;
      }

      .custom-pagination .page-item.active .page-link {
        background: linear-gradient(135deg, #19233e,rgb(65, 82, 129));
        color: white;
        font-weight: bold;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
      }

      .pagination .page-item.active .page-link {
        background-color: #19233e;
        border-color: #19233e;
        color: #fff;
      }
      .pagination .page-link {
        color: #19233e;
        cursor: pointer;
        user-select: none;
      }
      .page-dot:hover {
        background-color: #e9ecef;
        border-radius: 0.25rem;
        color: #19233e;
      }
/*--------------------------------------------------------------
# Chatbox
--------------------------------------------------------------*/
/* สไตล์สำหรับ chatbox */
.chatbox {
  position: fixed;
  bottom: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  background-color: var(--accent-color);
  border-radius: 50px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 9998;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  color: var(--contrast-color);
}

.chatbox .chat-toggle-content {
  font-size: 24px;
  pointer-events: none;
}

/* ซ่อน icon แล้วแสดงข้อความ "แชท" เมื่อ expanded */
.chatbox.expanded .chat-toggle-content {
  display: none;  /* ซ่อน icon เมื่อ expanded */
}

.chatbox.expanded {
  width: 320px;
  height: 400px;
  border-radius: 16px;
  background-color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  color: black;
  padding: 0;
  overflow: hidden;
  flex-direction: column;
  align-items: stretch;
}

/* ส่วนหัวของ chatbox */
.chatbox-header {
  background-color: var(--accent-color);
  color: white;
  padding: 10px;
  font-weight: bold;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px 16px 0 0;
  display: none;
}

.chatbox.open .chatbox-header {
  display: flex;  /* แสดง header เมื่อแชทเปิด */
}

/* ส่วนของข้อความใน chatbox */
.chatbox-body {
  display: none;
  flex-direction: column;
  background-color: white;
  height: 300px;
  overflow-y: auto;
}

/* ส่วนของ footer */
.chatbox-footer {
  display: none;
  background-color: #f1f1f1;
  padding: 10px;
  border-top: 1px solid #ccc;
  border-radius: 0 0 16px 16px;
}

/* ปุ่มปิด */
.chatbox-close {
  background: none;
  border: none;
  font-size: 20px;
  color: white;
  cursor: pointer;
  margin-left: auto;
  padding: 0 5px;
  transition: color 0.2s;
}

.chatbox-close:hover {
  color: #ffcccc;
}

/* กรอบข้อความ */
.message {
  margin: 10px;
  padding: 10px;
  border-radius: 5px;
}

.message.user {
  background-color: var(--accent-color);
  color: white;
  align-self: flex-end;
}

.message.admin {
  background-color: #f1f1f1;
  align-self: flex-start;
}

/* กรอบสำหรับกล่องข้อความ */
.input-box {
  display: flex;
  gap: 8px;
  width: 100%;
}

.input-box input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

.input-box button {
  padding: 10px 16px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.input-box button:hover {
  background-color: color-mix(in srgb, var(--accent-color), white 20%);
}

/* กำหนดว่าเมื่อ chatbox เปิดแล้วจะแสดง header, body, และ footer */
.chatbox.open .chatbox-header,
.chatbox.open .chatbox-body,
.chatbox.open .chatbox-footer {
  display: flex;
}

@media (max-width: 768px) {
  .chatbox {
    display: none !important;
  }
}

/*--------------------------------------------------------------
# Scroll Top Button
--------------------------------------------------------------*/
.scroll-top {
  position: fixed;
  bottom: 70px; /* เดิม 15px, เพิ่มให้ขยับขึ้น */
  right: 15px;
  width: 44px;
  height: 44px;
  background-color: var(--accent-color);
  color: var(--contrast-color);
  border-radius: 50px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top i {
  font-size: 24px;
}

.scroll-top.active.above-chat {
  bottom: 420px; /* เมื่อ chatbox เปิด เลื่อนขึ้นไป */
}

.scroll-top i {
  font-size: 24px;
  color: var(--contrast-color);
  line-height: 0;
}

.scroll-top:hover {
  background-color: color-mix(in srgb, var(--accent-color), transparent 20%);
  color: var(--contrast-color);
}

.scroll-top.active {
  visibility: visible;
  opacity: 1;
  bottom: 80px;
}
        
      @media (max-width: 768px) {

  .header {
    padding: 10px;
    text-align: center;
  }

  .header .logo img {
    max-height: 40px;
  }

  .header .logo h1 {
    font-size: 22px;
  }

  .navbar-brand {
    left: 0;
  }

  .container {
    flex-direction: column;
    margin-top: 10vh;
    width: 95vw;
  }

  .product-container {
    justify-content: center;
    gap: 8px;
  }

  .product-card {
    width: 100%;
  }

  .card-title,
  .size,
  .note,
  .color-select {
    margin-left: 0;
  }

  .badge-new,
  .badge-price {
    font-size: 0.75rem;
    padding: 2px 6px;
  }

  .texthead {
    flex-direction: column;
    padding: 10px;
    gap: 20px;
  }

  .texthead h4 {
    font-size: 1.2rem;
  }

  .texthead-right {
    font-size: 0.95rem;
  }

  .search-bar {
    width: 95%;
    flex-direction: column;
    padding: 10px;
  }

  .search-bar input {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .btn-close-search {
    font-size: 20px;
    margin-left: 0;
    align-self: flex-end;
  }

  .sort-menu {
    right: auto;
    left: 0;
  }

  .filter-menu {
    width: 100%;
    position: relative;
    left: 0;
    margin-bottom: 15px;
  }

  .product-container.shrink {
    margin-left: 0;
    transform: none;
  }

  .product-container.shrink .card-body {
    font-size: 1rem;
  }

  .product-container.shrink .color-dot {
    width: 14px;
    height: 14px;
  }

  .carousel-inner,
  .carousel-inner img {
    max-height: 250px;
    height: 250px;
  }

  .footer {
    padding: 20px 10px;
    text-align: center;
  }

  .copyright {
    font-size: 12px;
  }

  .scroll-top {
    display: none !important;
  }
}
 