/* ================================================
   1. RESET & GLOBAL STYLES - ตั้งค่าพื้นฐานทั่วไป
   ================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.logo {
  font-weight: normal;
}

.logo h1 {
  font-size: 30px;
}

/* Container พื้นฐาน */
.container,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl {
  max-width: 1380px;
  padding: 0;
  overflow: hidden;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ================================================
   2. NAVIGATION BAR - เมนูหลักส่วนบน
   ================================================ */

/* พื้นหลัง navbar */
.custom-navbar {
  background-color: rgb(243, 243, 243);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  /* height: 80px; */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

/* ลิงค์ใน navbar */
.navbar-nav .nav-link {
  color: #818181 !important;
  font-weight: bolder;
  padding: 0.75rem 1.5rem !important;
  transition: all 0.3s ease;
  border-radius: 5px;
  margin: 0 0.2rem;
  font-size: 1rem;
}

/* เอฟเฟกต์ hover สำหรับลิงค์ */
.navbar-nav .nav-link:hover {
  transform: translateY(-2px);
}

/* สถานะ active ของลิงค์ */
.navbar-nav .nav-link.active {
  color: rgb(54, 54, 54) !important;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: rgb(121, 121, 121);
  text-underline-offset: 4px;
}

/* ปุ่มด้านขวา navbar */
.auth-buttons button {
  margin: 0 0.3rem;
  border-radius: 50%;
  padding: 0.75rem;
  font-weight: 500;
  border: 1px solid #5f5f5f;
  transition: all 0.3s ease;
  background-color: #dddddd;
  color: rgb(53, 53, 53);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 5px #333;
}

/* เอฟเฟกต์ hover สำหรับปุ่ม */
.auth-buttons button:hover {
  background-color: #a7a7a7;
  transform: translateY(-3px);
}

/* ================================================
   3. MOBILE MENU BOTTOM - เมนูล่างสำหรับมือถือ
   ================================================ */

/* พื้นหลัง mobile menu */
#mobile-menubar {
  left: 0;
  right: 0;
  bottom: 0;
  position: fixed;
  height: 70px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-top: 1px solid #e9ecef;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 999;
  animation: slideUpMenu 0.5s ease-out;
  backdrop-filter: blur(10px);
}

/* Animation เมื่อโหลด menu */
@keyframes slideUpMenu {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Container หลักของ menu items */
.mobile-menu-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  padding: 8px 12px;
}

/* แต่ละ item ใน menu */
.mobile-menu-item {
  flex: 1;
  text-align: center;
  position: relative;
}

/* Link ของแต่ละ menu */
.mobile-menu-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #6c757d;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 8px 4px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

/* เอฟเฟกต์ hover และ active สำหรับ mobile menu */
.mobile-menu-link:hover,
.mobile-menu-link.active {
  color: #007bff;
  background: rgba(0, 123, 255, 0.1);
  transform: translateY(-2px);
}

/* Icon container */
.menu-icon {
  font-size: 20px;
  margin-bottom: 4px;
  transition: transform 0.3s ease;
}

/* เอฟเฟกต์ icon เมื่อ hover */
.mobile-menu-link:hover .menu-icon {
  transform: scale(1.1);
}

/* ข้อความใต้ icon */
.menu-text {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

/* เอฟเฟกต์ ripple เมื่อกด */
.mobile-menu-link::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  background: rgba(0, 123, 255, 0.3);
  border-radius: 50%;
  transition: width 0.6s, height 0.6s;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

.mobile-menu-link:active::before {
  width: 100px;
  height: 100px;
}

/* เอฟเฟกต์ active state */
.mobile-menu-link.active::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: #007bff;
  border-radius: 0 0 3px 3px;
}

.mobile-menu-link:hover {
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* ================================================
   4. CART BADGE - ป้ายแสดงจำนวนในตะกร้า
   ================================================ */

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  min-width: 20px;
  height: 20px;
  line-height: 12px;
  text-align: center;
  text-transform: uppercase;
  z-index: 10;
  border: 1px solid white;
  padding: 3px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* แสดง badge เมื่อมีสินค้า */
.cart-badge.show {
  transform: scale(1);
}

/* เอฟเฟกต์กระเพื่อม */
.cart-badge.pulse {
  animation: cartPulse 0.6s ease-out;
}

@keyframes cartPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
    background: #28a745;
  }
  100% {
    transform: scale(1);
  }
}

/* เอฟเฟกต์ตะกร้าสั่น */
.mobile-menu-link:hover .fa-shopping-cart {
  animation: cartShake 0.5s ease-in-out;
}

@keyframes cartShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

/* ตะกร้าว่าง */
.cart-badge.empty {
  background: #6c757d;
  transform: scale(0);
}

/* ปรับตำแหน่ง icon container สำหรับตะกร้า */
.mobile-menu-item:nth-child(4) .menu-icon {
  position: relative;
}

/* ================================================
   5. CAROUSEL & BANNER - ส่วนสไลด์และแบนเนอร์
   ================================================ */

/* สไลด์รูป banner */
#BannerSection img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#BannerSection img:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  transition: all 0.2s ease;
}

#carousel {
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
  /* เพิ่ม cursor pointer เพื่อแสดงว่าสามารถปัดได้ */
  cursor: grab;
  /* ป้องกันการเลือกข้อความเมื่อลาก */
  user-select: none;
}

/* เปลี่ยน cursor เมื่อกำลังปัด */
#carousel:active {
  cursor: grabbing;
}

/* สไตล์ indicators ของ carousel */
#carousel .carousel-indicators [data-bs-target] {
  box-sizing: content-box;
  flex: 0 1 auto;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-right: 10px;
  margin-left: 10px;
  text-indent: -999px;
  cursor: pointer;
  background-color: var(--bs-carousel-indicator-active-bg);
  background-clip: padding-box;
  border: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-radius: 50%;
  opacity: 0.5;
  transition: opacity 0.6s ease;
}

#carousel .carousel-indicators [data-bs-target].active {
  background-color: aquamarine;
}

/* ================================================
   6. PRODUCT SECTIONS - ส่วนแสดงสินค้า
   ================================================ */

/* Countdown timer */
.countdown-box {
  min-width: 50px;
  cursor: context-menu;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.countdown-number {
  font-size: 18px;
  line-height: 1;
}

.countdown-label {
  font-size: 10px;
  line-height: 1;
}

/* การ์ดสินค้า */
.product-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card:hover {
  transform: translateY(-3px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ให้ card มีความสูงเท่ากัน */
.product-slide-item .card,
.product-grid-desktop .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-slide-item .card-body,
.product-grid-desktop .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* กำหนดความสูงคงที่สำหรับชื่อสินค้า */
.product-slide-item .card-body h6,
.product-grid-desktop .card-body h6 {
  font-size: 12px;
  line-height: 1.3;
  height: 48px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  margin-bottom: auto;
}

/* ส่วนราคาและปุ่ม */
.product-slide-item .price-section,
.product-grid-desktop .price-section {
  margin-top: auto;
}

.product-slide-item .button-section,
.product-grid-desktop .button-section {
  margin-top: 8px;
}

/* ================================================
   7. PRODUCT SLIDER MOBILE - สไลด์สินค้าสำหรับมือถือ
   ================================================ */

.product-slider-container {
  position: relative;
  overflow: hidden;
}

.product-slider-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.product-slider-wrapper::-webkit-scrollbar {
  display: none;
}

.product-slide-track {
  display: flex;
  gap: 15px;
  transition: transform 0.3s ease;
  padding: 10px 5px;
}

.product-slide-item {
  flex: 0 0 calc(50% - 7.5px);
  max-width: calc(50% - 7.5px);
}

/* ปุ่มลูกศรสำหรับสไลด์ */
.product-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-slider-btn:hover:not(.disabled) {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-50%) scale(1.1);
}

.product-slider-btn.disabled {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.8);
}

.product-slider-btn.prev {
  left: 5px;
}

.product-slider-btn.next {
  right: 5px;
}

/* จุดบอกตำแหน่ง slide */
.product-slider-dots {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 15px !important;
  width: 100% !important;
  text-align: center !important;
}

.product-slider-dot {
  display: inline-block !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #ccc !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

.product-slider-dot.active {
  background: #007bff !important;
  transform: scale(1.2) !important;
}

/* ================================================
   8. FAVORITE BUTTONS - ปุ่มหัวใจรายการโปรด
   ================================================ */

/* ไอคอนหัวใจปกติ */
.btn-favorite .bi-heart-fill {
  display: none;
}

.btn-favorite .bi-heart {
  display: inline;
}

/* เมื่อ hover */
.btn-favorite:hover .bi-heart {
  display: none;
}

.btn-favorite:hover .bi-heart-fill {
  display: inline;
  color: #dc3545;
}

/* เมื่อคลิกแล้ว (active) */
.btn-favorite.active .bi-heart {
  display: none;
}

.btn-favorite.active .bi-heart-fill {
  display: inline;
  color: #dc3545;
}

.btn-favorite.active:hover .bi-heart-fill {
  color: #c82333;
}

/* ================================================
   9. FOOTER - ส่วนท้ายเว็บไซต์
   ================================================ */

footer {
  margin-top: 0.5rem;
  margin-bottom: 0;
  position: fixed;
}

footer ul {
  padding: 0;
  margin: 0;
}

footer ul li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ================================================
   10. RESPONSIVE DESIGN - การตอบสนองหน้าจอ
   ================================================ */

/* หน้าจอมือถือ */
@media (max-width: 991.98px) {
  /* Navbar responsive */
  .auth-buttons {
    margin-top: 1rem;
    text-align: center;
  }

  .navbar-nav .nav-link {
    text-align: center;
    margin: 0.2rem 0;
  }

  /* ซ่อน carousel indicators */
  #carousel .carousel-indicators {
    display: none !important;
  }

  /* Footer spacing สำหรับ mobile menu */
  /* footer {
        margin-bottom: 80px;
    } */

  /* ซ่อน desktop grid แสดง mobile slider */
  .product-grid-desktop {
    display: none !important;
  }

  /* ซ่อน slider controls และ dots */
  .product-slider-container,
  .product-slider-btn,
  .product-slider-dots {
    display: block;
  }
}

/* หน้าจอใหญ่ */
@media (min-width: 992px) {
  /* ซ่อน mobile slider แสดง desktop grid */
  .product-slider-mobile {
    display: none !important;
  }

  .product-slider-container,
  .product-slider-btn,
  .product-slider-dots {
    display: none !important;
  }

  /* ใช้คลาสที่ครอบคลุมเนื้อหาทั้งหมดที่อยู่ถัดจากรูปภาพ */
  .articles-section {
    margin-top: 150px;
    /* เพิ่มระยะห่างด้านบนให้มากขึ้นเพื่อรองรับการ์ด */
  }
}

/* หน้าจอเล็กมาก */
@media (max-width: 375px) {
  .menu-text {
    font-size: 10px;
  }

  .menu-icon {
    font-size: 18px;
  }

  #mobile-menubar {
    height: 65px;
  }
}

.navbar-collapse {
  background-color: rgb(243, 243, 243);
  border-radius: 0.5rem;
}

/* ปุ่มเข้าสู่ระบบ */
.login-btn {
  padding: 10px;
  font-size: 16px;
  font-family: "Prompt", sans-serif;
  border: 2px solid #ddd;
  border-radius: 25px;
  background-color: white;
  color: #666;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: 0.3s;
  min-width: 120px;
  justify-content: space-between;
}

.login-icon {
  background-color: #333;
  color: white;
  border-radius: 50%;
  padding: 6px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.login-btn:hover {
  border-color: #007bff;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

/* สำหรับมือถือ - ซ่อนปุ่มในโหมดมือถือ */
@media (max-width: 991px) {
  .login-btn {
    display: none;
  }
}

/* ส่วน PresentSection */
#PresentSection {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

#PresentSection .hero-image {
  width: 100%;
  height: auto;
}

article {
  margin-top: 80px;
  /* ค่าเริ่มต้นสำหรับ desktop */
  position: relative;
  z-index: 1;
}

/* เพิ่มส่วนนี้เพื่อแก้ไขปัญหาการทับซ้อนบนหน้าจอขนาดกลาง */
@media (min-width: 768px) and (max-width: 991px) {
  .articles-section {
    margin-top: 120px;
  }
}

/* Card container - รวมทุกการตั้งค่าไว้ในที่เดียว */
.sub_text {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 90%;
  max-width: 1200px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 0.75rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 8px 15px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideUpIn 1s ease-out 0.5s both;
}

/* แอนิเมชั่นเมื่อโหลด */
@keyframes slideUpIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(100px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Service Card - รวมทุกการตั้งค่าไว้ในที่เดียว */
.service-card {
  position: relative;
  padding: 0.75rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
  height: 100%;
  /* ป้องกันการลากและเลือกข้อความ */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-context-menu: none;
  -moz-context-menu: none;
  context-menu: none;
}

.service-card * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.service-card img,
.service-card .icon-wrapper i {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.service-card .icon-wrapper {
  width: 50px;
  height: 50px;
  margin: 0 auto 0.5rem;
  background: linear-gradient(135deg, #007bff, #0056b3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.4s ease;
  animation: pulse 2s infinite;
}

.service-card .icon-wrapper i {
  font-size: 1.25rem;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.service-card h4 {
  margin: 0.5rem 0 0.25rem;
  color: #2c3e50;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.3s ease;
  line-height: 1.2;
}

.service-card p {
  color: #6c757d;
  font-size: 0.75rem;
  margin: 0;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  line-height: 1.3;
}

/* Hover Effects */
.service-card:hover {
  transform: translateY(-5px) scale(1.01);
  background: linear-gradient(
    135deg,
    rgba(0, 123, 255, 0.05),
    rgba(255, 255, 255, 0.1)
  );
  box-shadow: 0 10px 25px rgba(0, 123, 255, 0.15),
    0 5px 10px rgba(0, 0, 0, 0.08);
}

.service-card:hover .icon-wrapper {
  transform: rotate(5deg) scale(1.05);
  animation: none;
}

.service-card:hover h4 {
  color: #007bff;
}

.service-card:hover p {
  opacity: 1;
}

/* Effects */
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 123, 255, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}

.service-card:hover::before {
  left: 100%;
}

.service-card .icon-wrapper::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top: 2px solid rgba(255, 255, 255, 0.5);
  animation: spin 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card:hover .icon-wrapper::after {
  opacity: 1;
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 767px) {
  .sub_text {
    /* ทำให้ .sub_text อยู่ใน flow ของเอกสาร */
    position: static;
    transform: none;
    top: auto;
    /* ลด margin-top ให้ชิดกับรูปภาพมากขึ้น */
    margin-top: -20px;
    width: 100%;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    z-index: auto;
    animation: none;
  }

  article {
    margin-top: 2rem;
  }

  /* ปรับการ์ดให้ icon อยู่ด้านซ้ายและข้อความอยู่ด้านขวา */
  .service-card {
    display: flex;
    align-items: center;
    text-align: left;
    height: auto;
  }

  .service-card .icon-wrapper {
    margin: 0;
    margin-right: 1rem;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
  }

  .service-card h4 {
    font-size: 1rem;
    margin: 0;
  }

  .service-card p {
    font-size: 0.8rem;
    margin: 0;
  }

  .service-card:hover {
    transform: none;
  }

  .service-card::before,
  .service-card .icon-wrapper::after {
    display: none;
  }

  #content1 {
    padding: 0 20px;
  }

  #content4 {
    padding: 0 20px;
  }

  #footer1 {
    padding: 0 20px;
  }

  .articles-section {
    padding: 60px 0;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  article {
    margin-top: 2rem;
  }

  .sub_text {
    padding: 0.4rem;
    top: -50px;
  }

  .service-card .icon-wrapper {
    width: 35px;
    height: 35px;
  }

  .service-card .icon-wrapper i {
    font-size: 0.9rem;
  }

  .service-card h4 {
    font-size: 0.75rem;
  }

  .service-card p {
    font-size: 0.65rem;
  }
}

@media (min-width: 768px) {
  .sub_text {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    z-index: 100;
  }

  .service-card {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .service-card .icon-wrapper {
    width: 55px;
    height: 55px;
    margin: 0 auto 0.5rem;
  }

  .service-card .icon-wrapper i {
    font-size: 1.4rem;
  }

  .service-card h4 {
    font-size: 1rem;
  }

  .service-card p {
    font-size: 0.8rem;
  }

  /* เส้นแบ่งแนวตั้ง */
  .service-card:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 20%;
    height: 60%;
    width: 1px;
    background: linear-gradient(
      to bottom,
      transparent,
      rgba(0, 123, 255, 0.3),
      transparent
    );
  }
}

/* ========================= ARTICLES SECTION ========================= */
.articles-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.section-title p {
  font-size: 1.2rem;
  color: #6c757d;
  max-width: 600px;
  margin: 0 auto;
}

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

.article-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .article-image {
  transform: scale(1.05);
}

.article-content {
  padding: 1.5rem;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #2c3e50;
  line-height: 1.4;
}

.article-excerpt {
  font-size: 0.95rem;
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #adb5bd;
  border-top: 1px solid #e9ecef;
  padding-top: 1rem;
}

.read-more {
  background: linear-gradient(45deg, #007bff, #0056b3);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.read-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
  color: white;
}

.section-padding {
  padding: 0 20px;
}

/* login-page */

.login-page {
  margin-top: 100px; /* ปรับตามความเหมาะสม */
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.login-page .login-card {
  max-width: 500px;
  margin: auto;
  padding: 3rem;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
  background: #fff;
}

.login-page .logo-img {
  height: 50px;
}

#login-line {
  text-decoration: none; /* ลบ underline */
  display: inline-block; /* เพื่อให้ style ทำงานเต็มที่ */
}
#login-line:hover {
  text-decoration: none; /* ป้องกัน hover */
}

.login-page .login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #fff;
  color: #333;
  font-weight: 500;
  transition: 0.2s ease;
  text-decoration: none !important;
}

.login-page .login-btn:hover {
  background-color: #f2f2f2;
}

.login-page .login-btn-m i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.login-page .login-content {
  flex: 0; /* ดัน footer ลงไปล่าง */
  display: flex;
  justify-content: center;
  align-items: center;
}
