/* =============================================================
   LoopGarden — Global Styles
   /wp-content/themes/astra-child/assets/css/global.css

   Loaded site-wide. Provides ONLY:
   - Shared header (.lg-header)
   - Shared footer (.lg-footer)
   - Minimal infrastructure: hides Astra/Elementor default
     header/footer chrome, adds top padding so fixed header
     doesn't overlap content on Astra-rendered pages.

   ALL design overrides for WooCommerce / Astra pages have been
   removed so those pages can be styled in Elementor without
   fighting global !important rules. Use the design tokens in
   /docs/DESIGN-TOKENS.md to keep Elementor consistent with the
   custom-templated pages.
   ============================================================= */


/* ——— 0. Hide Astra / Elementor default chrome on themed pages ——— */

body.lg-themed .ast-mobile-header-wrap,
body.lg-themed #ast-mobile-header,
body.lg-themed .ast-above-header-wrap,
body.lg-themed .ast-below-header-wrap,
body.lg-themed .ast-desktop-header-content,
body.lg-themed .site-header,
body.lg-themed .site-footer,
body.lg-themed .ast-footer-overlay,
body.lg-themed #ast-scroll-top {
  display: none !important;
}

body.lg-themed .elementor-location-header,
body.lg-themed .elementor-location-footer,
body.lg-themed [data-elementor-type="header"],
body.lg-themed [data-elementor-type="footer"],
body.lg-themed .elementor-header,
body.lg-themed .elementor-footer {
  display: none !important;
}

/* Top padding so fixed header doesn't overlap Astra page content */
body.lg-themed.lg-astra-page #page,
body.lg-themed.lg-astra-page .site-content {
  padding-top: 64px;
}


/* ============================================================
   1. SHARED HEADER (.lg-header)
   Used on all custom templates AND Astra-rendered pages.
   ============================================================ */

#lg-header,
.lg-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #000000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lg-header-inner {
  display: flex;
  align-items: center;
  height: 64px;
  width: 100%;
  padding: 0 40px;
}

.lg-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-right: 24px;
  max-height: 46px;
  line-height: 0;
}

/* High specificity + !important to beat Astra/WooCommerce rules
   that target .custom-logo, .site-logo-img img, etc. */
.lg-header .lg-logo .lg-logo-img,
.lg-header .lg-logo img {
  height: 46px !important;
  width: auto !important;
  max-width: none !important;
  max-height: 46px !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.lg-logo-text {
  color: #e0ddd8;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.lg-nav {
  flex-shrink: 0;
}

.lg-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.lg-menu li a {
  color: rgba(255, 255, 255, 0.40);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  transition: color 0.2s;
  white-space: nowrap;
}

.lg-menu li a:hover,
.lg-menu li.current-menu-item a,
.lg-menu li.current_page_item a {
  color: #002aff;
}

/* Vault search bar — injected via lg_header_center hook */
.lg-header #vault-header-search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 36px;
  width: 240px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: width 0.25s ease, border-color 0.25s ease;
}

.lg-header #vault-header-search:focus-within {
  width: 320px;
  border-color: rgba(255, 255, 255, 0.12);
}

.lg-header .vault-search-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.30);
  width: 14px;
  height: 14px;
}

.lg-header #vault-header-search #dropbox-search {
  flex: 1;
  background: transparent !important;
  border: none !important;
  color: #e0ddd8 !important;
  font-size: 13px !important;
  outline: none;
  padding: 0 !important;
  width: 100%;
  height: auto !important;
  border-radius: 0 !important;
}

.lg-header #vault-header-search #dropbox-search::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

/* Credit badge — only on Session Room pages */
.lg-credit-badge {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: #002aff;
  padding: 5px 12px;
  border: none;
  border-radius: 50px;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 12px;
}

.lg-account-btn {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.40);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 0;
  background: none;
  border: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.lg-account-btn:hover {
  color: #002aff;
}

/* When credit badge is shown, account button no longer needs auto margin */
.lg-credit-badge + .lg-account-btn {
  margin-left: 0;
}

/* ─── Cart button (right of My Account, only visible when cart has items) ─── */
.lg-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-left: 16px;
  padding: 6px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.lg-cart-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
}

.lg-cart-btn--empty {
  display: none;
}

.lg-cart-fragment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lg-cart-icon {
  flex-shrink: 0;
}

.lg-cart-count {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: #002aff;
  border-radius: 50px;
  padding: 1px 7px;
  line-height: 1.4;
  min-width: 18px;
  text-align: center;
}

/* Hamburger toggle (hidden on desktop) */
.lg-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.lg-menu-toggle:hover,
.lg-menu-toggle:focus,
.lg-menu-toggle:focus-visible,
.lg-menu-toggle:active {
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.lg-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #e0ddd8;
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.lg-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.lg-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.lg-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.lg-mobile-menu {
  display: none;
  padding: 12px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #000000;
}

.lg-mobile-menu.open {
  display: block;
}

.lg-mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lg-mobile-menu-list li a {
  display: block;
  color: #e0ddd8;
  text-decoration: none;
  font-size: 15px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lg-mobile-account-btn {
  display: block;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  font-size: 14px;
  padding: 12px 0 0;
}


/* ============================================================
   2. SHARED FOOTER (.lg-footer)
   ============================================================ */

.lg-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 60px 40px 32px;
  background: #060606;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

.lg-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.lg-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  margin-bottom: 28px;
}

.lg-footer-brand {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.lg-footer-social {
  display: flex;
  gap: 18px;
  flex-shrink: 0;
}

.lg-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.2s ease;
}

.lg-footer-social a:hover {
  color: #ffffff;
}

.lg-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.lg-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.lg-footer-links a {
  color: rgba(255, 255, 255, 0.50);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease;
}

.lg-footer-links a:hover {
  color: #002aff;
}

.lg-footer-copy {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.30);
}


/* ============================================================
   3. RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {

  /* Header */
  .lg-nav,
  .lg-account-btn {
    display: none;
  }

  .lg-menu-toggle {
    display: flex;
    margin-left: 8px;
  }

  /* When account is hidden, push the cart button to the right edge */
  .lg-cart-btn {
    margin-left: auto;
  }

  /* When the cart button is empty (display:none), there's nothing left
     to anchor the right side — push the hamburger over instead. */
  .lg-cart-btn--empty + .lg-menu-toggle {
    margin-left: auto;
  }

  .lg-header-inner {
    padding: 0 20px;
    height: 56px;
  }

  .lg-logo {
    margin-right: 10px;
    max-height: 38px;
  }

  .lg-header .lg-logo .lg-logo-img,
  .lg-header .lg-logo img {
    height: 38px !important;
    max-height: 38px !important;
  }

  /* Vault search bar — static on mobile */
  .lg-header #vault-header-search {
    position: static;
    transform: none;
    flex: 1;
    width: auto;
  }

  .lg-header #vault-header-search:focus-within {
    width: auto;
  }

  /* Body padding for fixed header on Astra pages */
  body.lg-themed.lg-astra-page #page,
  body.lg-themed.lg-astra-page .site-content {
    padding-top: 56px;
  }

  /* Footer */
  .lg-footer {
    padding: 40px 20px 28px;
  }

  .lg-footer-top {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }

  .lg-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .lg-footer-links {
    gap: 14px 20px;
  }
}
