﻿/* =========================================
   1. HEADER BASE & LAYOUT (永�??�康風格 - ?��?浮�?導覽??
   ========================================= */
header {
  position: relative;
  width: 100%;
  height: 60px;
  background: var(--ns-blue);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(14, 86, 194, 0.08);
  z-index: 9;
  transition: 0.4s ease-in-out;
  margin: 0 auto;
}

header.bg {
  position: fixed;
  background: var(--ns-blue);
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 30px rgba(14, 86, 194, 0.12);
}

header .content {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
}

/* =========================================
   2. LOGO & RIGHT LINKS
   ========================================= */
header .logo {
  width: 100%;
  max-width: 180px;
  transition: all 0.3s;
  z-index: 3;
  flex: 4;
  font-family: 'Roboto', sans-serif;
}

header .logo img {
  width: 100%;
  min-width: 120px;
  max-width: 120px;
  filter: brightness(0) invert(1);
}

header .right-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-around;
  z-index: 10;
  gap: 10px;
}

header .right-link a {
  display: flex;
  align-items: center;
  justify-content: center;
}

header .right-link a img {
  width: auto;
  height: 36px;
  transition: transform 0.3s ease;
}

header .right-link a img:hover {
  transform: translateY(-2px);
}

header .right-link a:first-child img {
  margin-left: 0;
}

header .right-link .line {
  width: 1px;
  height: 24px;
  background: #e0e0e0;
  margin: 0 10px 0 0;
}

/* =========================================
   3. BUTTONS & UTILITIES
   ========================================= */
.for-home {
  display: none;
}

.for-home a.button-pulse {
  display: none;
}

header ul.menu>li.mobile a.button-pulse,
header .right-link a.button-pulse {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 102px;
  height: 38px;
  background: #0e56c2;
  color: #ffffff;
  font-weight: 700;
  font-family: 'Roboto', sans-serif;
  font-size: .875rem;
  gap: 6px;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(14, 86, 194, 0.2);
  transition: all 0.3s ease;
}

header ul.menu>li.mobile a.button-pulse:hover,
header .right-link a.button-pulse:hover {
  background: #004d8c;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(14, 86, 194, 0.3);
}

header ul.menu>li.mobile a.button-pulse {
  width: 100%;
}

header ul.menu>li.mobile a.button-pulse em,
header .right-link a.button-pulse em {
  font-size: .8rem;
  display: none;
}

header ul.menu>li.mobile a.button-pulse img,
header .right-link a.button-pulse img {
  width: 20px !important;
  min-width: 20px !important;
  display: block;
  filter: brightness(0) invert(1);
}

header ul.menu>li.mobile a.button-pulse.buy,
header .right-link a.button-pulse.buy {
  background: #85c134;
  box-shadow: 0 4px 12px rgba(127, 190, 38, 0.2);
}

header ul.menu>li.mobile a.button-pulse.buy:hover,
header .right-link a.button-pulse.buy:hover {
  background: #6ba31f;
  box-shadow: 0 6px 16px rgba(127, 190, 38, 0.3);
}

.button {
  border: none !important;
  border-radius: 30px !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1) !important;
  font-weight: 700 !important;
  font-family: 'Roboto', sans-serif;
  transition: all 0.2s ease-in-out !important;
}

.button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

/* =========================================
   4. DESKTOP MENU
   ========================================= */
header #memu_mask {
  position: fixed;
  display: none;
  top: 100px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

header #menu {
  display: flex;
  align-items: center;
  height: 100%;
  flex: 6;
}

header ul.menu {
  flex: 1;
  display: flex;
  width: auto;
  height: 100%;
  font-size: 1rem;
  justify-content: flex-end;
  gap: 2px;
}

header ul.menu>li {
  position: relative;
  flex: none;
  text-align: center;
  padding: 0 10px;
  line-height: 1.8;
}

header ul.menu>li:last-child::after {
  display: none;
}

header ul.menu>li.mobile {
  display: none;
}

header ul.menu>li>a,
header ul.menu>li>span {
  display: flex;
  cursor: pointer;
  height: 100%;
  align-items: center;
  transition: color 0.3s;
  font-weight: 600;
  color: #ffffff;
}

header ul.menu>li>span>label {
  position: relative;
  display: block;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  color: #ffffff;
  transition: color 0.3s;
}

header ul.menu>li>a:hover,
header ul.menu>li.active>a,
header ul.menu>li>span:hover>label,
header ul.menu>li>span.on>label {
  color: #ffff00;
  font-weight: bold;
}

header ul.menu>li>a:hover {
  color: #ffff00;
}

header ul.menu>li.active>span>label {
  color: #ffff00;
}

header ul.menu>li>span input {
  display: none;
}

header ul.menu>li>span:hover ol.sub {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

header ul.menu>li>span ol.sub {
  display: none;
  position: absolute;
  min-width: 180px;
  top: 80%;
  left: 50%;
  text-align: center;
  padding: 8px 0;
  font-size: 1rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform: translateX(-50%) translateY(10px);
  transition: all 0.3s ease;
}

header ul.menu>li>span ol.sub li {
  display: block;
}

header ul.menu>li>span ol.sub li>a {
  display: block;
  padding: 10px 20px;
  color: #555;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

header ul.menu>li>span ol.sub li>a:hover {
  color: #0e56c2;
  background: #f4f9fd;
}

/* =========================================
   5. HAMBURGER ICON LOGIC
   ========================================= */
header #menu-ck {
  display: none;
}

header #menu-ck~label {
  display: none;
  position: relative;
  width: 32px;
  min-width: 32px;
  height: 32px;
  right: 0;
  z-index: 3;
  cursor: pointer;
}

header #menu-ck~label i,
header #menu-ck~label o,
header #menu-ck~label u {
  position: absolute;
  width: 24px;
  height: 2px;
  background: #ffffff;
  opacity: 1;
  transform: rotate(0deg);
  transition: all 0.3s;
}

header #menu-ck~label i {
  top: 8px;
  left: 4px;
}

header #menu-ck~label o {
  top: 15px;
  left: 4px;
}

header #menu-ck~label u {
  top: 22px;
  left: 4px;
}

header #menu-ck:checked~#memu_mask {
  opacity: 1;
  pointer-events: auto;
}

header #menu-ck:checked~label i {
  top: 15px;
  transform: rotate(45deg);
}

header #menu-ck:checked~label o {
  top: 15px;
  opacity: 0;
}

header #menu-ck:checked~label u {
  top: 15px;
  transform: rotate(-45deg);
}

/* =========================================
   6. MISC & UTILITIES
   ========================================= */
header ul.menu>li:last-child a {
  position: relative;
}

.select-dropdown {
  font-size: 1rem;
}

.select-dropdown select {
  background: #f7f7f7;
}

.for-home a.button-pulse.buy,
header .right-link a.button-pulse.buy,
header ul.menu>li.mobile a.button-pulse.buy {
  display: none !important;
}

/* =========================================
   7. MEDIA QUERIES
   ========================================= */
@media (max-width: 1500px) {
  header ul.menu>li {
    padding: 0 .8vw;
  }
}

@media (max-width: 1450px) {
  header .content {
    padding: 0 3.4vw;
    gap: 12px;
  }
}

@media (max-width: 1024px) {
  header:after {
    display: none;
  }

  header #menu-ck~label {
    display: block;
  }

  header #menu {
    position: fixed;
    width: 100%;
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
    top: 80px;
    left: 0;
    right: 0;
    padding: 16px;
    background: rgba(14, 86, 194, 1);
    backdrop-filter: blur(15px);
    flex-direction: column-reverse;
    overflow: auto;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 0 0 30px 30px;
  }

  header #menu-ck:checked~#menu {
    display: flex;
    pointer-events: auto;
    opacity: 1;
    transform: translateX(0);
  }

  header ul.menu {
    flex: none;
    font-size: 1.1rem !important;
    display: block;
    width: 100%;
  }

  header ul.menu>li {
    display: block;
    padding: 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  header ul.menu>li:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
  }

  header ul.menu>li>a {
    display: block;
    margin: 16px 0;
    text-align: left;
    font-size: 1rem;
    color: #ffffff !important;
  }

  header ul.menu>li>span {
    display: block;
    margin: 16px 0;
  }

  header ul.menu>li>span:hover ol.sub {
    display: none;
  }

  header ul.menu>li>span>label {
    color: #ffffff !important;
  }

  header ul.menu>li>span>label:after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0rem;
    width: 8px;
    height: 8px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: translateY(-70%) rotate(45deg);
    transition: all 0.3s;
  }

  header ul.menu>li>span input:checked~ol.sub {
    display: flex !important;
    min-width: auto;
    max-width: unset;
    border: 0px;
    box-shadow: none;
    background: transparent;
    padding: 0;
    transform: unset;
  }

  header ul.menu>li>span input:checked~label:after {
    transform: translateY(-30%) rotate(225deg);
  }

  header ul.menu>li>span ol.sub {
    position: relative;
    margin-top: 10px;
    flex-wrap: wrap;
    transform: none;
    left: 0;
  }

  header ul.menu>li>span ol.sub li {
    width: 100%;
  }

  header ul.menu>li>span ol.sub li>a {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: rgba(255, 255, 255, 0.8);
    color: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 4px;
  }

  header ul.menu>li>span ol.sub li>a:hover {
    background: rgba(255, 255, 255, 1);
    color: #0e56c2;
  }

  header .logo {
    max-width: unset;
  }

  header .right-link {
    gap: 8px;
    justify-content: flex-end;
  }

  header .right-link a.button-pulse img {
    width: 18px !important;
  }

  header .right-link .line {
    display: none;
  }
}

@media(max-width:768px) {
  .for-home {
    display: grid;
    grid-template-columns: 1fr;
  }

  .for-home a.button-pulse {
    width: 100%;
    height: 48px;
    color: #ffffff;
    background: #0e56c2;
    font-size: 1.125rem;
    font-family: 'Roboto', sans-serif;
    border-radius: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0px auto;
    border: none;
  }

  .for-home a.button-pulse em {
    display: none;
  }

  .for-home a.button-pulse.buy {
    background: #85c134;
  }

  .for-home a.button-pulse img {
    width: 24px !important;
    filter: brightness(0) invert(1);
  }
}

@media (max-width: 767px) {
  header ul.menu {
    font-size: 1rem !important;
  }

  header ul.menu>li.mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
    border: none;
  }

  header .right-link a.button-pulse {
    display: none;
  }

  header ul.menu>li>span ol.sub {
    font-size: 1rem;
  }

  header #menu {
    top: 60px;
  }

  header .right-link a img {
    margin-left: 0px;
  }
}

@media (max-width:500px) {
  header .logo img {
    min-width: 112px;
    max-width: 112px;
  }
}