/* ============================================================
   CUSTOM HEADER
   ============================================================ */

#gherb-header {
  position: sticky;
  top: 0;
  z-index: 100000;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  font-family: "Kanit", sans-serif;
  transform: translateY(0);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
#gherb-header.is-hidden {
  transform: translateY(-100%);
}

.ghdr-inner {
  display: flex;
  align-items: center;
  margin: 0 auto;
  padding: 30px 48px 0;
  gap: 48px;
}

/* logo */
.ghdr-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.ghdr-logo img {
  height: 70px;
  width: auto;
  display: block;
}

/* nav — container */
.ghdr-nav { flex: 1; padding-top: 15px; }
.ghdr-nav__list {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ghdr-nav__list li a {
  font-size: 15px;
  font-weight: 400;
  color: #0e1e3f;
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
  display: inline-block;
}
.ghdr-nav__list li a:hover { color: #1b5e20; }
.ghdr-nav__list li.current-menu-item > a,
.ghdr-nav__list li.current-page-ancestor > a,
.ghdr-nav__list li.current-menu-ancestor > a {
  color: #1b5e20;
  font-weight: 600;
  border-bottom-color: #1b5e20;
}

/* cta button */
.ghdr-cta {
  flex-shrink: 0;
  display: inline-block;
  background: #1b5e20;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  font-family: "Kanit", sans-serif;
  padding: 11px 24px;
  border-radius: 999px;
  text-decoration: none !important;
  transition: opacity .2s;
  white-space: nowrap;
}
.ghdr-cta:hover { opacity: .85; }

/* hamburger */
.ghdr-hamburger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 100000;
}
.ghdr-hamburger span {
  position: absolute;
  left: 10px; right: 10px;
  height: 2px;
  background: #0e1e3f;
  border-radius: 2px;
  transition: transform .35s cubic-bezier(.65,.05,.36,1),
              opacity .25s ease,
              top .35s cubic-bezier(.65,.05,.36,1);
}
.ghdr-hamburger span:nth-child(1) { top: 14px; }
.ghdr-hamburger span:nth-child(2) { top: 21px; }
.ghdr-hamburger span:nth-child(3) { top: 28px; }

body.gherb-menu-open .ghdr-hamburger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
body.gherb-menu-open .ghdr-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.gherb-menu-open .ghdr-hamburger span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* MOBILE NAV PANEL (outside header, fixed to viewport) */
.ghdr-mobile-nav {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(82vw, 360px);
  background: #fff;
  box-shadow: -12px 0 32px rgba(0,0,0,.12);
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.65,.05,.36,1);
  z-index: 99998;
  padding: 88px 28px 32px;
  overflow-y: auto;
  flex-direction: column;
}
.ghdr-mobile-nav .ghdr-nav__list {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ghdr-mobile-nav .ghdr-nav__list li {
  width: 100%;
  border-bottom: 1px solid #eef2ee;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .3s ease, transform .3s ease;
}
.ghdr-mobile-nav .ghdr-nav__list li a {
  display: block;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 500;
  color: #0e1e3f;
  text-decoration: none;
}
.ghdr-mobile-nav .ghdr-nav__list li.current-menu-item > a {
  color: #1b5e20;
  font-weight: 600;
}
.ghdr-mobile-nav .ghdr-cta {
  margin-top: 24px;
  text-align: center;
  padding: 14px 24px;
  width: 100%;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s ease, transform .3s ease;
}

/* BACKDROP */
.ghdr-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14,30,63,.45);
  backdrop-filter: blur(2px);
  z-index: 99997;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .35s ease, visibility 0s linear .35s;
}

/* OPEN STATE — triggered by body.gherb-menu-open */
body.gherb-menu-open .ghdr-mobile-nav { transform: translateX(0); }
body.gherb-menu-open .ghdr-mobile-nav .ghdr-nav__list li {
  opacity: 1;
  transform: translateX(0);
}
body.gherb-menu-open .ghdr-mobile-nav .ghdr-nav__list li:nth-child(1) { transition-delay: .15s; }
body.gherb-menu-open .ghdr-mobile-nav .ghdr-nav__list li:nth-child(2) { transition-delay: .20s; }
body.gherb-menu-open .ghdr-mobile-nav .ghdr-nav__list li:nth-child(3) { transition-delay: .25s; }
body.gherb-menu-open .ghdr-mobile-nav .ghdr-nav__list li:nth-child(4) { transition-delay: .30s; }
body.gherb-menu-open .ghdr-mobile-nav .ghdr-nav__list li:nth-child(5) { transition-delay: .35s; }
body.gherb-menu-open .ghdr-mobile-nav .ghdr-nav__list li:nth-child(6) { transition-delay: .40s; }
body.gherb-menu-open .ghdr-mobile-nav .ghdr-cta {
  opacity: 1;
  transform: translateY(0);
  transition-delay: .45s;
}
body.gherb-menu-open .ghdr-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .35s ease, visibility 0s linear 0s;
}

/* MOBILE BREAKPOINT */
@media (max-width: 900px) {
  .ghdr-inner { padding: 16px 24px; gap: 16px; }
  .ghdr-logo img { height: 48px; }

  /* hide desktop nav + cta */
  .ghdr-nav--desktop,
  .ghdr-cta--desktop { display: none; }

  /* show hamburger + mobile panel */
  .ghdr-hamburger { display: block; }
  .ghdr-mobile-nav { display: flex; }

  /* always show header on mobile — use fixed positioning */
  #gherb-header,
  #gherb-header.is-hidden {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(0) !important;
    transition: none !important;
  }
  /* compensate for fixed header */
  #main { padding-top: 80px; }
}

@media (max-width: 480px) {
  #main { padding-top: 64px; }
}

@media (max-width: 480px) {
  .ghdr-inner { padding: 12px 16px; }
  .ghdr-logo img { height: 40px; }
  .ghdr-mobile-nav { padding: 80px 22px 28px; }
}

/* ── ACCOUNT ICON ── */
.ghdr-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 4px;
  color: #0e1e3f;
  text-decoration: none;
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.ghdr-account:hover { background: #f1f5f0; color: #1b5e20; }
.ghdr-account__icon { display: block; }
.ghdr-account.is-logged { position: relative; }
/* dot indicator when logged in */
.ghdr-account.is-logged::after {
  content: "";
  position: absolute;
  bottom: 6px; right: 6px;
  width: 8px; height: 8px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 50%;
}
@media (max-width: 768px) {
  .ghdr-account { width: 36px; height: 36px; }
  .ghdr-account__icon { width: 20px; height: 20px; }
}

/* ── CART ICON + MINI-CART DROPDOWN ── */
.ghdr-cart-wrap { position: relative; margin-left: 4px; }
.ghdr-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #0e1e3f;
  text-decoration: none;
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.ghdr-cart:hover { background: #f1f5f0; color: #1b5e20; }
.ghdr-cart__icon { display: block; }
.ghdr-cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #1b5e20;
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}
.ghdr-cart-count.is-empty { display: none; }

/* Dropdown */
.ghdr-cart-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.14);
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  z-index: 100;
}
/* invisible bridge between icon and dropdown so hover doesn't drop */
.ghdr-cart-dropdown::before {
  content: "";
  position: absolute;
  top: -10px; left: 0; right: 0; height: 10px;
}
.ghdr-cart-wrap:hover .ghdr-cart-dropdown,
.ghdr-cart-wrap:focus-within .ghdr-cart-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

/* WooCommerce mini-cart inner content */
.ghdr-cart-dropdown .woocommerce-mini-cart {
  list-style: none; margin: 0; padding: 0;
  max-height: 320px; overflow-y: auto;
}
.ghdr-cart-dropdown .woocommerce-mini-cart-item,
.ghdr-cart-dropdown .mini_cart_item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid #f0f2ef;
  position: relative; font-size: 13px; line-height: 1.4;
}
.ghdr-cart-dropdown .woocommerce-mini-cart-item:last-child,
.ghdr-cart-dropdown .mini_cart_item:last-child { border-bottom: 0; }
.ghdr-cart-dropdown .mini_cart_item img,
.ghdr-cart-dropdown .woocommerce-mini-cart-item img {
  width: 48px !important; height: 48px !important;
  object-fit: contain; border-radius: 6px;
  background: #fafaf8; flex-shrink: 0; padding: 4px; box-sizing: border-box;
  margin: 0 !important; float: none !important;
}
.ghdr-cart-dropdown .mini_cart_item a:not(.remove) {
  color: #0e1e3f; font-weight: 600; text-decoration: none; flex: 1; min-width: 0;
}
.ghdr-cart-dropdown .mini_cart_item a:not(.remove):hover { color: #1b5e20; }
.ghdr-cart-dropdown .quantity {
  display: block; color: #4b5b67; font-size: 12px; font-weight: 400; margin-top: 2px;
}
.ghdr-cart-dropdown .quantity .woocommerce-Price-amount,
.ghdr-cart-dropdown .quantity .amount { color: #1b5e20; font-weight: 700; }
.ghdr-cart-dropdown .remove,
.ghdr-cart-dropdown .remove_from_cart_button {
  position: static !important;
  order: 99;
  margin-left: auto;
  align-self: center;
  width: 22px !important; height: 22px !important;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px !important; line-height: 1 !important;
  color: #999 !important; background: transparent !important;
  border-radius: 50%; text-decoration: none;
  flex-shrink: 0;
}
.ghdr-cart-dropdown .remove:hover,
.ghdr-cart-dropdown .remove_from_cart_button:hover {
  color: #c00 !important; background: #fef2f2 !important;
}

.ghdr-cart-dropdown .woocommerce-mini-cart__total,
.ghdr-cart-dropdown .total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0 12px; margin: 0; border-top: 1px solid #e5e7eb;
  font-size: 14px;
}
.ghdr-cart-dropdown .total strong { color: #4b5b67; font-weight: 600; }
.ghdr-cart-dropdown .total .woocommerce-Price-amount,
.ghdr-cart-dropdown .total .amount {
  color: #1b5e20; font-size: 18px; font-weight: 800;
}

.ghdr-cart-dropdown .woocommerce-mini-cart__buttons,
.ghdr-cart-dropdown .buttons {
  display: flex; gap: 8px; margin: 0; padding: 0;
}
.ghdr-cart-dropdown .buttons a,
.ghdr-cart-dropdown .woocommerce-mini-cart__buttons a {
  flex: 1; display: block; text-align: center;
  padding: 10px 12px; font-size: 13px; font-weight: 600;
  text-decoration: none; border-radius: 8px;
  background: #f3f4f6; color: #0e1e3f; border: 1px solid #e5e7eb;
  transition: background .15s;
}
.ghdr-cart-dropdown .buttons a:hover { background: #e5e7eb; }
.ghdr-cart-dropdown .buttons a.checkout,
.ghdr-cart-dropdown .woocommerce-mini-cart__buttons a.checkout {
  background: #1b5e20; color: #fff; border-color: #1b5e20;
}
.ghdr-cart-dropdown .buttons a.checkout:hover { background: #154a18; }

.ghdr-cart-dropdown .woocommerce-mini-cart__empty-message {
  margin: 0; padding: 24px 0; text-align: center;
  color: #4b5b67; font-size: 14px;
}

@media (max-width: 768px) {
  .ghdr-cart { width: 36px; height: 36px; }
  .ghdr-cart-wrap { margin-left: 4px; }
  .ghdr-cart__icon { width: 20px; height: 20px; }
  /* Dropdown disabled on mobile — tap icon → /cart/ instead */
  .ghdr-cart-dropdown { display: none !important; }
}
