/* ==========================================================================
   HEADER CSS - Header và Navigation Styles
   ========================================================================== */

/* Desktop Header (default) */
.desktop-header {
  display: flex;
}

/* Header Base Styles */
.header {
  display: flex;
  padding: var(--Space-2-5, 10px) var(--Space-10, 40px);
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  gap: var(--space-spacer-1-rem, 16px);
  position: relative;
  z-index: 100;
  box-shadow: 0 1px 8px 10px rgba(0, 0, 0, 0.1);
}

.header a {
  text-decoration: none;
}

.header button {
  background: transparent;
  border: none;
}

.header ul,
.footer ul {
  list-style-type: none;
  margin-block-start: 0px;
  margin-block-end: 0px;
  padding-inline-start: 0px;
}

/* Main Navigation */
.header .main-nav-bar {
  display: flex;
  align-items: flex-start;
  gap: var(--sds-size-space-negative-100);
}

.header .main-nav-bar li {
  display: flex;
  padding: var(--Space-3, 12px) var(--space-spacer-1-rem, 16px);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Active Navigation Item */
.header .main-nav-bar li.active::after {
  content: "";
  display: block;
  width: 108px;
  height: 2px;
  background: var(--On-background-Brand-Default, #231f20);
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Navigation Links */
.header li a {
  color: var(--On-background-Brand-Default, #231f20);
  text-align: center;
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Medium, 18px);
  font-style: normal;
  font-weight: var(--Body-Font-Weight-Strong, 600);
  line-height: 140%;
}

/* Action Icons */
.header .action-icons {
  display: flex;
  align-items: center;
  gap: var(--space-spacer-1-rem, 16px);
}

.header .action-icons img {
  width: 24px;
  height: 24px;
}

/* Desktop Cart Count Badge */
.header .action-icons .count-item {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--Background-Brand-Primary, #520f09);
  color: var(--On-background-Brand-Primary, #fefdf9);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  z-index: 1;
}

.header .action-icons button {
  position: relative;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.header .action-icons button:hover {
  background-color: var(--Background-Global-Secondary, #faf5f0);
  transform: scale(1.1);
}

/* Mobile Header */
.mobile-header {
  display: none;
  height: 60px;
  padding: var(--Space-2, 8px) var(--Space-4, 16px);
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Mobile Header Layout - 3 columns */
.mobile-left-actions,
.mobile-right-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: var(--Space-2, 8px);
}

.mobile-header .logo {
  flex: 1;
  justify-content: center;
}

.mobile-header .logo img {
  height: 36px;
  max-width: 140px;
  object-fit: contain;
}

/* Hamburger Menu Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 4px;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--On-background-Brand-Default, #231f20);
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger Animation */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Action Buttons */
.mobile-search-btn,
.mobile-cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.mobile-search-btn:hover,
.mobile-cart-btn:hover {
  background-color: var(--Background-Global-Secondary, #faf5f0);
  transform: scale(1.1);
}

.mobile-search-btn img,
.mobile-cart-btn img {
  width: 24px;
  height: 24px;
}

/* Cart Count Badge */
.mobile-cart-btn .count-item {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--Background-Brand-Primary, #520f09);
  color: var(--On-background-Brand-Primary, #fefdf9);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  z-index: 1;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--Background-Global-Primary, #fefdf9);
  z-index: 1001;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mobile-nav-drawer.active {
  transform: translateX(100%);
}

/* Mobile Navigation Header */
.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--Space-5, 20px) var(--Space-8, 32px);
  border-bottom: 1px solid #eee;
  height: 70px;
  width: 100%;
  box-sizing: border-box;
}

/* 3-Column Layout: Back - Logo - Cart */
.mobile-nav-back,
.mobile-nav-cart {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.mobile-nav-logo {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mobile-nav-logo img {
  height: 40px;
  max-width: 160px;
  object-fit: contain;
}

/* Back Arrow Button */
.mobile-nav-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.mobile-nav-back-btn:hover {
  background-color: var(--Background-Global-Secondary, #faf5f0);
}

.mobile-nav-back-btn img {
  height: 20px;
  width: auto;
  max-width: 25px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(11%) sepia(7%) saturate(1158%)
    hue-rotate(314deg) brightness(97%) contrast(91%);
}

/* Mobile Nav Cart Button */
.mobile-nav-cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.mobile-nav-cart-btn:hover {
  background-color: var(--Background-Global-Secondary, #faf5f0);
}

.mobile-nav-cart-btn img {
  width: 24px;
  height: 24px;
}

/* Mobile Nav Cart Badge */
.mobile-nav-cart-btn .count-item {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--Background-Brand-Primary, #520f09);
  color: var(--On-background-Brand-Primary, #fefdf9);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  z-index: 1;
}

/* Mobile Navigation Menu */
.mobile-nav-menu {
  flex: 1;
  padding: var(--Space-5, 20px) 0;
  overflow-y: auto;
  width: 100%;
}

.mobile-nav-menu li {
  border-bottom: 1px solid #eee;
  width: 100%;
}

.mobile-nav-menu li:last-child {
  border-bottom: none;
}

.mobile-nav-menu a {
  display: block;
  padding: var(--Space-6, 24px) var(--Space-8, 32px);
  color: var(--On-background-Brand-Default, #231f20);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Large, 20px);
  font-weight: var(--Body-Font-Weight-Strong, 600);
  text-decoration: none;
  transition: background-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.mobile-nav-menu a:hover {
  background-color: var(--Background-Global-Secondary, #faf5f0);
}

.mobile-nav-menu li.active a {
  background-color: var(--Background-Brand-Primary, #520f09);
  color: var(--On-background-Brand-Primary, #fefdf9);
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

@media (min-width: 576px) and (max-width: 991px) {
  .desktop-header {
    display: none;
  }

  .mobile-header {
    display: flex;
  }
}

@media (min-width: 992px) {
  .desktop-header {
    display: flex;
  }

  .mobile-header {
    display: none;
  }
}

/* Mobile Responsive Adjustments */
@media (max-width: 575px) {
  .desktop-header {
    display: none;
  }

  .mobile-header {
    display: flex;
  }
  .mobile-header {
    height: 56px;
    padding: var(--Space-2, 8px) var(--Space-3, 12px);
  }

  .mobile-header .logo img {
    height: 32px;
    max-width: 120px;
  }

  .hamburger-btn,
  .mobile-search-btn,
  .mobile-cart-btn {
    width: 40px;
    height: 40px;
  }

  .mobile-nav-header {
    height: 60px;
    padding: var(--Space-4, 16px) var(--Space-5, 20px);
  }

  .mobile-nav-logo img {
    height: 32px;
    max-width: 140px;
  }

  .mobile-nav-back-btn,
  .mobile-nav-cart-btn {
    width: 40px;
    height: 40px;
  }

  .mobile-nav-back-btn img {
    height: 16px;
    width: auto;
    max-width: 20px;
    object-fit: contain;
  }

  .mobile-nav-cart-btn img {
    width: 20px;
    height: 20px;
  }

  .mobile-nav-cart-btn .count-item {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .mobile-nav-menu a {
    padding: 20px 20px 20px 40px;
    color: var(--On-background-Brand-Default, #231f20);
    text-align: start;
    font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
    font-size: var(--Body-Size-Medium, 16px);
    font-style: normal;
    font-weight: var(--Body-Font-Weight-Strong, 600);
    line-height: 140%; /* 22.4px */
  }
}
