/* CODI APP - Shortcut menu (glass style)
   ปรับเฉพาะเมนูลัดด้านบน โดยคงขนาดเดิมไว้ */

.codi-shortcut-wrap {
  flex: 1;
  min-width: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: 22px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.codi-shortcut-wrap::-webkit-scrollbar {
  display: none;
}

.codi-shortcut-link {
  position: relative;
  isolation: isolate;
  overflow: hidden;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;

  /* คงขนาดเมนูเดิม */
  min-height: 42px;
  padding: 0 15px;

  border-radius: 13px;
  border: 1px solid rgba(27, 73, 115, 0.08);

  color: #23364d;
  font-family: 'Inter', 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none !important;

  /* Glass feel แบบปุ่มด้านล่าง แต่เบากว่า */
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.74) 0%,
    rgba(250, 253, 255, 0.48) 52%,
    rgba(236, 245, 252, 0.40) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(18, 70, 115, 0.04),
    0 2px 5px rgba(26, 63, 96, 0.045);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  transition:
    color .24s ease,
    background .24s ease,
    border-color .24s ease,
    box-shadow .24s ease,
    transform .22s cubic-bezier(.25, 1, .5, 1);
}

/* แสงวิ่งเบา ๆ คล้าย Glass Button ด้านล่าง */
.codi-shortcut-link::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: -55%;
  left: -45%;
  width: 38%;
  height: 210%;
  pointer-events: none;
  opacity: 0;
  transform: rotate(18deg) translateX(-180%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.78) 48%,
    rgba(255, 255, 255, 0) 100%
  );
  transition: transform .55s cubic-bezier(.25, 1, .5, 1), opacity .22s ease;
}

.codi-shortcut-link:hover {
  color: #0b63ce;
  border-color: rgba(11, 99, 206, 0.15);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(243, 249, 255, 0.94) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 7px 15px rgba(18, 75, 124, 0.10),
    0 2px 4px rgba(18, 75, 124, 0.05);
  transform: translateY(-2px) scale(0.985);
}

.codi-shortcut-link:hover::before {
  opacity: .86;
  transform: rotate(18deg) translateX(470%);
}

.codi-shortcut-link:active {
  transform: translateY(0) scale(0.965);
  box-shadow:
    inset 0 2px 5px rgba(17, 71, 116, 0.08),
    0 2px 5px rgba(18, 75, 124, 0.05);
}

.codi-shortcut-link.active {
  color: #0866c9;
  font-weight: 600;
  border-color: rgba(11, 99, 206, 0.13);
  background: linear-gradient(
    145deg,
    #ffffff 0%,
    #f3f8fd 58%,
    #eaf4fd 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(11, 99, 206, 0.04),
    0 5px 12px rgba(17, 78, 131, 0.09);
}

/* เส้น Accent เล็ก ๆ ของเมนูที่กำลังเลือก */
.codi-shortcut-link.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, #0b63ce, #2d8fe8);
  transform: translateX(-50%);
  box-shadow: 0 1px 3px rgba(11, 99, 206, 0.22);
}

.codi-anchor-section {
  scroll-margin-top: 92px;
}

.header-area .main-nav {
  align-items: center;
  min-height: 70px;
  height: 70px;
}

@media (max-width: 1199px) {
  .codi-shortcut-wrap {
    margin-left: 10px;
    justify-content: flex-start;
  }

  .codi-shortcut-link {
    padding: 0 11px;
    font-size: 12px;
  }
}

@media (max-width: 767px) {
  .header-area {
    height: 126px;
  }

  .header-area .main-nav {
    min-height: 126px;
    display: block;
  }

  .codi-shortcut-wrap {
    position: absolute;
    left: 0;
    right: 0;
    top: 70px;
    height: 56px;
    margin-left: 0;
    padding: 6px 15px 8px;
    justify-content: flex-start;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid #eef2f6;
  }

  .codi-shortcut-link {
    min-height: 38px;
    padding: 0 13px;
    border-radius: 12px;
  }

  .codi-anchor-section {
    scroll-margin-top: 142px;
  }

  .main-banner {
    margin-top: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .codi-shortcut-link,
  .codi-shortcut-link::before {
    transition: none;
  }
}
