@import url("https://fonts.googleapis.com/css?family=Athiti&display=swap");
@import url("https://fonts.googleapis.com/css?family=Roboto+Condensed&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Athiti", sans-serif;
}
html,
body {
  overflow-x: hidden;
}

/*----------root values ----------*/
:root {
  --green: #a0cf4f;
  --white: #fff;
  --black: #000;
  --darkbrown: #363636;
  --darkorange: darkorange;
  --gray: #808080;
  --red: #ff3131;
  --blue: #1535ea;
  --darkblue: #254558;
}

/*-------------------------------
        Header Navbar
--------------------------------*/
header {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  padding: 0;
  margin: 0;
}

header .nav {
  max-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: 0.2s;
}

/* ===== แถวบน: โลโก้ + ชื่อภาควิชา ===== */
header .top-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 100px;
  justify-content: flex-start;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* โลโก้ */
header .top-bar .logo img {
  width: 100px;
  height: auto;
  display: block;
  object-fit: contain;
}

/* ชื่อภาควิชา */
header .top-bar .site-title h1 {
  font-size: 18px;
  color: #222;
}
header .bottom-bar .site-title-en {
  display: none;
}

/* ปุ่ม toggle */
header .top-bar .toggle_btn {
  display: none;
}

/* ===== แถวล่าง: เมนู ===== */
header .bottom-bar {
  display: flex;
  align-items: center;
  justify-content: start;
  padding: 0 60px;
  height: 60px;
  font-weight: 500;
}

/* เมนูใน bottom-bar */
header .bottom-bar .links {
  list-style: none;
  display: flex;
  gap: 1rem;
  flex-direction: row;
  margin: 0;
  padding: 0 40px;
}
header .bottom-bar .links li {
  list-style: none;
  display: flex;
  align-items: center;
}
header .bottom-bar .links a {
  color: #222;
  font-size: 1rem;
  padding: 5px 10px;
  transition: 0.2s;
  text-decoration: none;
}
header .bottom-bar .links a:hover {
  background: #f37737;
  border-radius: 5px;
  color: #fff;
}

/* ปุ่ม EN */
header .bottom-bar .action_btn {
  background: #f37737;
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 10px;
  font-weight: bold;
  transition: transform 0.2s ease;
}

/* ===============================
   Navbar Icons
================================ */
.nav-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-left: auto;
}
.nav-icons a {
  font-size: 24px;
  color: #d62976;
  transition: 0.3s;
}
.nav-icons a:hover {
  color: #363636;
}
/* Cart */
.cart-icon i {
  color: #333;
}

/* ===== Header Responsive ===== */
@media screen and (max-width: 1199px) {
  @media screen and (max-width: 768px) {
    header {
      padding: 0;
    }
    header .top-bar .site-title {
      display: none;
    }
    header .bottom-bar {
      padding: 0px;
    }
    header .bottom-bar .site-title-en {
      display: flex;
      justify-content: center;
      align-items: center;
      text-align: center;
      flex-grow: 1;
      width: 100%;
      font-weight: 500;
      color: #333;
      margin-top: 5px;
      line-height: 1.4;
      word-wrap: break-word;
      white-space: normal;
    }
    header .bottom-bar .site-title-en h1 {
      font-size: 14px;
    }
    header .top-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 20px;
      border-bottom: none;
    }
    header .top-bar .logo img {
      width: 65px;
    }

    header .top-bar .toggle_btn {
      display: block;
      border: 1px solid #ddd;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.1);
      font-size: 20px;
      padding: 6px 8px;
      color: #222;
      cursor: pointer;
      transition:
        color 0.2s ease,
        transform 0.2s ease;
    }

    header .top-bar .toggle_btn:hover {
      color: #f37737;
      transform: scale(1.05);
    }

    header .bottom-bar .links {
      display: flex;
      flex-direction: column;
      background: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(15px);
      position: absolute;
      top: 70px;
      left: 5%;
      width: 90%;
      border-radius: 10px;
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      z-index: 1100;
    }

    header .bottom-bar .links.open {
      display: flex;
      max-height: 800px;
      overflow-y: auto;
    }

    header .bottom-bar .links li {
      text-align: center;
      padding: 0.5rem 0;
    }

    header .bottom-bar .links li a {
      width: 100%;
      display: block;
      text-align: center;
      color: #222;
      font-size: 1rem;
      padding: 8px 0;
    }

    header .bottom-bar .links li a:hover {
      background: #f37737;
      color: #fff;
    }

    header .bottom-bar .links li a.action_btn {
      font-size: 18px;
      padding: 6px 12px;
      border-radius: 6px;
      display: inline-block;
    }
  }
}

/*----------------------------------------------
                Banner Hero
-----------------------------------------------*/
.myCarousel {
  width: 100%;
  height: 100vh;
  min-height: 600px;
  margin-top: -60px;
  overflow: hidden;
  position: relative;
}
.myList {
  width: 100%;
  height: 100%;
}
.myItem {
  width: 100%;
  height: 100%;
  position: relative;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.myItem::before {
  content: "";
  position: absolute;
  inset: 0;
}

.myItem .content {
  position: absolute;
  top: auto;
  bottom: 18%;
  left: 60px;
  transform: none;
  width: 380px;
  max-width: 90%;
  color: #fff;
  z-index: 2;
  text-align: left;
}

.content .title {
  font-size: 45px;
  color: #d63384;
  font-weight: bold;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 8px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.content .name {
  font-size: 28px;
  font-weight: bold;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.35);
  color: #353535;
}

.content .des {
  margin-top: 10px;
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.5;
  color: #353535;
}

/* ======== Banner Hero Responsive Settings ========= */
@media (max-width: 1400px) {
  .myItem .content {
    left: 40px;
    bottom: 12%;
    width: 340px;
  }
  .content .title {
    font-size: 36px;
  }
  .content .name {
    font-size: 24px;
  }
  .content .des {
    font-size: 14px;
  }
}

@media (max-width: 1199px) {
  .myCarousel {
    height: 85vh;
  }
  .myItem .content {
    left: 30px;
    bottom: 8%;
    width: 320px;
  }
  .content .title {
    font-size: 32px;
  }
  .content .name {
    font-size: 22px;
  }
  .content .des {
    font-size: 13.5px;
    margin-top: 10px;
    margin-bottom: 15px;
  }
}

/* ===================================================
   iPad & Tablet ทั้งหมด (576px ถึง 1199px): 
   - รวม iPad mini (768px) และ iPad Pro 
   - แสดงภาพสไตล์ Desktop ไม่โดนตัดขอบ และไม่มีกรอบบัง
=================================================== */
@media screen and (min-width: 576px) and (max-width: 1199px) {
  .myCarousel {
    height: auto !important;
    min-height: unset !important;
    margin-top: 0;
  }

  .myItem {
    height: auto !important;
    min-height: unset !important;
    aspect-ratio: 16 / 9;
    background-size: contain !important;
    background-position: center top !important;
    background-repeat: no-repeat;
  }

  /* ข้อความลอยสไตล์ Desktop (ลบกรอบทิ้ง) */
  .myItem .content {
    display: block !important;
    position: absolute !important;
    top: auto !important;
    bottom: 8% !important;
    left: 4% !important;
    width: 320px !important;
    max-width: 40% !important;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    text-align: left !important;
    z-index: 10 !important;
  }

  .content .title {
    font-size: 22px !important;
    color: #d63384 !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 2px !important;
  }

  .content .name {
    font-size: 16px !important;
    color: #353535 !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2) !important;
    margin-bottom: 4px !important;
  }

  .content .des {
    font-size: 11.5px !important;
    color: #444444 !important;
    line-height: 1.35 !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
  }

  /* ปุ่มบน iPad ปรับให้กะทัดรัดแต่คงสีไล่เฉดไว้อย่างถูกต้อง */
  .content .myBtn1 button {
    padding: 6px 16px !important;
    font-size: 12.5px !important;
    background: linear-gradient(135deg, #ff2a6d, #ff9f43) !important;
    color: #ffffff !important;
  }

  .content .myBtn1 button i {
    font-size: 11px !important;
    color: #ffd700 !important;
  }
}
/* ===================================================
   Mobile Screens (575px ลงมา): ปรับกรอบให้พอดี + ดึงจุดกลับเข้าภาพ
=================================================== */
@media (max-width: 575px) {
  /* ลดความสูงรวมลง เพื่อปิดพื้นที่สีขาวด้านล่าง */
  .myCarousel {
    height: auto;
    min-height: 400px !important;
    margin-top: 0;
  }

  /* ปรับความสูงรูปภาพให้พอดี ไม่ยืดเกินภาพจริง */
  .myItem {
    background-image: var(--bg-mobile) !important;
    min-height: 400px !important;
    background-size: cover;
    background-position: center top;
    position: relative;
  }

  /* ปรับกรอบข้อความให้กะทัดรัด ไม่บังหน้าคนในภาพ */
  .myItem .content {
    position: absolute;
    top: auto;
    bottom: 35px !important; /* ดึงกรอบลงมาใกล้ขอบล่างของภาพ */
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 300px;
    padding: 8px 12px !important; /* ลด padding ให้กรอบเตี้ยลง */
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  }

  /* ย่อขนาดตัวหนังสือในกรอบ */
  .content .title {
    font-size: 14px !important;
    margin-bottom: 2px !important;
  }

  .content .name {
    font-size: 12px !important;
    margin-bottom: 2px !important;
  }

  .content .des {
    font-size: 10px !important;
    line-height: 1.2 !important;
    margin-top: 2px !important;
    margin-bottom: 6px !important;
  }

  .content .myBtn1 button {
    padding: 4px 12px !important;
    font-size: 11px !important;
    background: linear-gradient(135deg, #ff2a6d, #ff9f43) !important;
    color: #ffffff !important;
  }

  .content .myBtn1 button i {
    font-size: 9px !important;
    color: #ffd700 !important;
  }

  /* ดึงจุดไข่ปลากลับเข้ามาอยู่ในรูปภาพพอดี */
  .carousel-indicators {
    position: absolute !important;
    bottom: 8px !important; /* ตำแหน่งจุดไข่ปลาชิดขอบล่างของรูปภาพ */
    margin: 0 !important;
    left: 0;
    right: 0;
    z-index: 10 !important;
  }
}

/*---------------------------------------------------
           Banner-Hero Button Design (myBtn1)
----------------------------------------------------*/
.content .myBtn1 button {
  position: relative;
  padding: 15px 25px;
  border: none !important;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  /* สีส้ม-ชมพูไล่เฉด สั่ง !important ป้องกันโดนเขียนทับ */
  background: linear-gradient(135deg, #ff2a6d, #ff9f43) !important;
  color: #ffffff !important;
  box-shadow:
    0 6px 18px rgba(255, 42, 109, 0.4),
    inset 0 1px 3px rgba(255, 255, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.content .myBtn1 button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: 0.5s;
}

.content .myBtn1 button:hover::before {
  left: 100%;
}

.content .myBtn1 button:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 10px 22px rgba(255, 42, 109, 0.6),
    0 0 15px rgba(255, 159, 67, 0.7);
  color: #ffffff !important;
}

.content .myBtn1 button i {
  color: #ffd700 !important;
  font-size: 15px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.2);
  }
  30% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.15);
  }
  60% {
    transform: scale(1);
  }
}

/* ตกแต่งปุ่มลูกศรเลื่อน ซ้าย-ขวา */
.carousel-control-prev,
.carousel-control-next {
  width: 48px;
  height: 48px;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  margin: 0 15px;
  z-index: 10;
  transition: all 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background-color: rgba(0, 0, 0, 0.75);
}

/* ปรับจุดบอกตำแหน่งสไลด์ (Indicators) */
.carousel-indicators {
  margin-bottom: 1.5rem;
  z-index: 10;
}

.carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 4px;
  background-color: #fff;
  opacity: 0.5;
}

.carousel-indicators .active {
  opacity: 1;
  background-color: #ff2a6d;
}

/*-----------------------------------------
            All-product Page
-----------------------------------------*/
.card-body .myBtn {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  margin-top: 10px !important;
}

.card-body .myBtn button {
  background-color: #e83e8c !important;
  color: #ffffff !important;
  border: none !important;
  outline: none !important;
  padding: 6px 16px !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  border-radius: 50px !important;
  box-shadow: 0 4px 10px rgba(232, 62, 140, 0.3) !important;
  width: auto !important;
  max-width: 200px !important;
  min-width: 170px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease-in-out !important;
}

.card-body .myBtn button:hover {
  background-color: #d63384 !important;
  color: #ffffff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 14px rgba(232, 62, 140, 0.4) !important;
}

.badge-category {
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  display: inline-block;
}

.badge-polo {
  background-color: #fff3e6 !important;
  color: #e67e22 !important;
  border: 1px solid #ffd8b3 !important;
}

.badge-tshirt {
  background-color: #e8f4fd !important;
  color: #0d6efd !important;
  border: 1px solid #b6d4fe !important;
}

@media (max-width: 768px) {
  .myBtn button,
  .card-body .myBtn button {
    padding: 5px 12px !important;
    font-size: 0.75rem !important;
    max-width: 85% !important;
    min-width: 140px !important;
  }

  .myBtn button i,
  .card-body .myBtn button i {
    font-size: 0.75rem !important;
    margin-right: 4px !important;
  }
}

/*-----------------------------------------
            Facebook Page
-----------------------------------------*/
.fb-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.fb-page {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  overflow: hidden;
}

/*---------------------------------------------------
                    Map
----------------------------------------------------*/
.map {
  background-color: #eee;
}

.contact-text a {
  text-decoration: none;
  color: #000;
}

.contact-text a:hover {
  font-weight: bolder;
  color: #f37737;
}
.map-responsive {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
}

.map-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/*---------------------------------------------------
                    Footer
----------------------------------------------------*/
.footer {
  background: #d62976;
  width: 100%;
  height: 5%;
  padding: 1rem;
}
.footer .copyright {
  color: #fff;
  text-align: center;
}

/*-----------------------------------------
      All-product Page (Product Card)
-----------------------------------------*/
.product-card-item {
  background: #ffffff;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.product-card-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

.product-img-wrapper {
  background-color: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 280px;
  overflow: hidden;
}

.product-img-wrapper img {
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card-item:hover .product-img-wrapper img {
  transform: scale(1.05);
}

.product-card-item .card-body .d-flex.align-items-center {
  width: 100% !important;
}

.product-card-item .myBtn {
  margin-left: auto !important;
  text-align: right !important;
  display: block !important;
  width: auto !important;
}

.product-card-item .myBtn button.btn-product-action {
  position: relative;
  padding: 10px 22px !important;
  border: none !important;
  border-radius: 10px !important;
  cursor: pointer;
  font-size: 0.9rem !important;
  font-weight: bold;
  background: linear-gradient(135deg, #ff2a6d, #ff9f43) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 15px rgba(255, 42, 109, 0.3) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
  width: auto !important;
  max-width: none !important;
}

.product-card-item .myBtn button.btn-product-action::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: 0.5s;
}

.product-card-item .myBtn button.btn-product-action:hover::before {
  left: 100%;
}

.product-card-item .myBtn button.btn-product-action:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 10px 20px rgba(255, 42, 109, 0.45),
    0 0 12px rgba(255, 159, 67, 0.5) !important;
  color: #ffffff !important;
}

@media (max-width: 768px) {
  .product-img-wrapper {
    height: 220px;
  }

  .product-card-item .myBtn button.btn-product-action {
    padding: 8px 16px !important;
    font-size: 0.8rem !important;
  }
}
