/**
 * Bosaname Header Styles
 *
 * Header, admin bar, cart, mini-cart, toast, hamburger, mobile nav.
 * Loaded on ALL pages.
 */

/* ── Global reset for WP overrides ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  hanging-punctuation: first allow-end last;
}

body {
  overflow-x: hidden;
  font-family: "Urbanist", sans-serif;
  color: var(--bosa-ink);
}

/* ── Header (WP override) ── */
#page.hfeed.site {
  display: block;
}

.bosa-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* WP admin bar overlap fix — desktop only */
@media (min-width: 782px) {
  body.admin-bar .bosa-header {
    top: 32px;
  }
}

.bosa-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px;
  position: relative;
}

/* Header cart wrapper */
.bosa-header-cart-wrap {
  position: relative;
  display: none;
}

.bosa-header-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--bosa-ink);
  cursor: pointer;
  transition: color 0.2s;
}

.bosa-header-cart svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bosa-header-cart:hover {
  color: var(--bosa-muted);
  background: transparent;
}

.bosa-header-cart-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--rounded-full);
  background: var(--bosa-primary);
  color: var(--bosa-on-primary);
  font-size: var(--fs-micro);
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.bosa-mobile-cart {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--bosa-ink);
  text-decoration: none;
}

.bosa-mobile-cart:hover {
  color: var(--bosa-primary);
}

/* Mini-cart dropdown */
.bosa-mini-cart {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: -8px;
  width: 360px;
  max-height: 480px;
  background: #fff;
  border: 1px solid var(--bosa-border);
  border-radius: var(--rounded-lg);
  box-shadow: var(--shadow-mockup);
  z-index: 1000;
  overflow: hidden;
}

.bosa-mini-cart.is-open {
  display: flex;
  flex-direction: column;
}

.bosa-mini-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bosa-border);
}

.bosa-mini-cart-header h4 {
  font-size: var(--fs-body-md);
  font-weight: 600;
  margin: 0;
}

.bosa-mini-cart-badge {
  background: var(--bosa-primary);
  color: var(--bosa-on-primary);
  font-size: var(--fs-micro);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--rounded-full);
  line-height: 1.4;
}

.bosa-mini-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--bosa-muted);
  gap: 12px;
  text-align: center;
}

.bosa-mini-cart-empty svg {
  opacity: 0.4;
}

.bosa-mini-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  max-height: 300px;
}

.bosa-mini-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  transition: background 0.15s;
}

.bosa-mini-cart-item:hover {
  background: var(--bosa-surface);
}

.bosa-mini-cart-item img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--rounded-md);
  flex-shrink: 0;
}

.bosa-mini-cart-item-info {
  flex: 1;
  min-width: 0;
}

.bosa-mini-cart-item-name {
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--bosa-ink);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bosa-mini-cart-item-qty {
  font-size: var(--fs-caption);
  color: var(--bosa-muted);
}

.bosa-mini-cart-item-price {
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--bosa-ink);
  white-space: nowrap;
}

.bosa-mini-cart-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--bosa-muted);
  cursor: pointer;
  border-radius: var(--rounded-full);
  transition:
    color 0.15s,
    background 0.15s;
  margin-left: auto;
}
.bosa-mini-cart-remove:hover {
  color: var(--bosa-energy);
  background: rgba(244, 63, 94, 0.08);
}
.bosa-mini-cart-remove svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bosa-mini-cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--bosa-border);
  background: var(--bosa-surface);
}

.bosa-mini-cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bosa-mini-cart-subtotal span:first-child {
  font-size: var(--fs-body-sm);
  color: var(--bosa-muted);
  font-weight: 500;
}

.bosa-mini-cart-subtotal span:last-child {
  font-size: var(--fs-body-md);
  font-weight: 700;
  color: var(--bosa-ink);
}

.bosa-mini-cart-footer .bosa-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* Toast Notification */
.bosa-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bosa-primary-dark);
  color: #fff;
  border-radius: var(--rounded-lg);
  box-shadow: var(--shadow-mockup);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  transform: translateY(120%);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  pointer-events: none;
}
.bosa-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.bosa-toast svg {
  flex-shrink: 0;
}

.bosa-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.bosa-logo svg,
.bosa-logo .bosa-custom-logo {
  height: 40px;
  width: auto;
  max-width: 100%;
  display: block;
}

.bosa-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 0;
  list-style: none;
}

.bosa-nav .menu-item {
  list-style: none;
  position: relative;
}

.bosa-nav .menu-item > a {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bosa-ink);
  text-decoration: none;
  padding: 8px 16px;
  transition: color 0.2s;
}

.bosa-nav .menu-item > a:hover {
  color: var(--bosa-primary);
}

.bosa-nav .current-menu-item > a {
  color: var(--bosa-primary);
  border-bottom: 2px solid var(--bosa-primary);
  padding-bottom: 6px;
}

.bosa-nav .menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-left: 4px;
  vertical-align: middle;
}

.bosa-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  z-index: 100;
  list-style: none;
}

.bosa-nav .menu-item-has-children:hover > .sub-menu {
  display: block;
}

.bosa-nav .sub-menu .menu-item > a {
  padding: 8px 20px;
  font-size: 13px;
  white-space: nowrap;
}

/* ── Hamburger ── */
.bosa-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1010;
  margin: 0;
  box-shadow: none;
  outline: none;
  border-radius: 0;
}

.bosa-hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--bosa-ink);
  border-radius: 2px;
  transition:
    transform 0.3s,
    opacity 0.3s;
}

.bosa-hamburger.is-active .bosa-hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.bosa-hamburger.is-active .bosa-hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile nav panel ── */
.bosa-mobile-nav {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 1005;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s;
}

.bosa-mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
}

.bosa-mobile-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 80px 24px 40px;
}

.bosa-mobile-nav .menu-item {
  list-style: none;
  border-bottom: 1px solid var(--bosa-border);
}

.bosa-mobile-nav .menu-item > a {
  display: block;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--bosa-ink);
  text-decoration: none;
}

.bosa-mobile-nav .menu-item > a:hover,
.bosa-mobile-nav .current-menu-item > a {
  color: var(--bosa-primary);
}

.bosa-mobile-nav .sub-menu {
  list-style: none;
  padding: 0 0 8px 16px;
}

.bosa-mobile-nav .sub-menu .menu-item > a {
  font-size: 14px;
  padding: 10px 0;
  color: var(--bosa-muted);
}

.bosa-mobile-cta {
  margin-top: 24px;
  text-align: center;
  justify-content: center;
}
