/* Shared storefront header — same height, width, and control sizes on every page */

#mobile-menu {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
#mobile-menu.menu-closed {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}
#mobile-menu.menu-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
#menu-overlay {
  transition: opacity 0.3s ease;
}
#menu-overlay.overlay-hidden {
  opacity: 0;
  pointer-events: none;
}
#menu-overlay.overlay-visible {
  opacity: 1;
  pointer-events: auto;
}

header.vebishop-store-header .vebishop-store-header__inner {
  min-height: 3.5rem;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

@media (min-width: 640px) {
  header.vebishop-store-header .vebishop-store-header__inner {
    min-height: 4rem;
  }
}

/* Full home header — slightly taller */
header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-light):not(.vebishop-header-mode-checkout):not(.vebishop-header-mode-account) .vebishop-store-header__inner {
  min-height: 4rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

@media (min-width: 640px) {
  header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-light):not(.vebishop-header-mode-checkout):not(.vebishop-header-mode-account) .vebishop-store-header__inner {
    min-height: 4.5rem;
  }
}

/* Focused / light / checkout — compact bar */
header.vebishop-header-mode-focused .vebishop-store-header__inner,
header.vebishop-header-mode-light .vebishop-store-header__inner,
header.vebishop-header-mode-checkout .vebishop-store-header__inner {
  min-height: 3.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

header.vebishop-header-mode-focused .vebishop-brand,
header.vebishop-header-mode-light .vebishop-brand,
header.vebishop-header-mode-checkout .vebishop-brand {
  max-width: min(12rem, 50vw);
}

header.vebishop-header-mode-account .vebishop-store-header__inner {
  min-height: 3.75rem;
}

@media (min-width: 1024px) {
  header.vebishop-store-header .vebishop-store-header__inner {
    overflow: visible;
  }
}

header.vebishop-store-header .vebishop-header-nav {
  flex-shrink: 0;
  align-items: center;
  align-self: center;
  margin-left: 0.25rem;
}

header.vebishop-store-header .vebishop-header-nav-link:not(.hidden),
header.vebishop-store-header #admin-link:not(.hidden) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  white-space: nowrap;
  line-height: 1.25rem;
}

header.vebishop-store-header #admin-link.hidden,
header.vebishop-store-header #admin-link-skeleton.hidden {
  display: none !important;
}

header.vebishop-store-header .vebishop-admin-nav-slot {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

header.vebishop-store-header .vebishop-header-tools {
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

header.vebishop-store-header .vebishop-header-search {
  position: relative;
  width: 20rem;
  max-width: 20rem;
  flex: 0 0 20rem;
}

header.vebishop-store-header .vebishop-header-search input {
  width: 100%;
  box-sizing: border-box;
  height: 2.5rem;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

header.vebishop-store-header #user-chip.flex,
header.vebishop-store-header a#user-chip.flex {
  flex-shrink: 0;
  height: 2.5rem;
  min-height: 2.5rem;
  max-height: 2.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* User chip — neutral border only (no brand-color ring/border) */
header.vebishop-store-header #user-chip,
header.vebishop-store-header #user-chip-mobile {
  border-color: #e2e8f0 !important;
  background-color: #f8fafc !important;
  box-shadow: none !important;
  outline: none !important;
}

header.vebishop-store-header #user-chip:hover,
header.vebishop-store-header #user-chip-mobile:hover,
header.vebishop-store-header #user-chip:focus,
header.vebishop-store-header #user-chip:focus-visible,
header.vebishop-store-header #user-chip-mobile:focus,
header.vebishop-store-header #user-chip-mobile:focus-visible {
  border-color: #cbd5e1 !important;
  background-color: #f1f5f9 !important;
  outline: none !important;
  box-shadow: none !important;
}

header.vebishop-store-header #user-avatar,
header.vebishop-store-header #user-avatar-mobile {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.6875rem;
}

header.vebishop-store-header #user-name {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

header.vebishop-store-header #auth-actions {
  flex-shrink: 0;
}

header.vebishop-store-header #auth-actions a {
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.5rem 0.75rem;
}

header.vebishop-store-header .vebishop-header-nav a,
header.vebishop-store-header #admin-link {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

header.vebishop-store-header #menu-open-btn,
header.vebishop-store-header #mobile-search-toggle,
header.vebishop-store-header #cart-icon-btn,
header.vebishop-store-header #cart-icon-btn-mobile,
header.vebishop-store-header #user-chip-mobile {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  flex-shrink: 0;
}

header.vebishop-store-header #cart-count,
header.vebishop-store-header #cart-count-mobile {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.625rem;
  line-height: 1;
}

/* Logo + name — fit inside header row (overrides looser defaults) */
header.vebishop-store-header .vebishop-brand {
  flex-shrink: 0;
  align-items: center;
  align-self: center;
  max-width: min(22rem, 38vw);
}

body.vebishop-legal-page header.vebishop-store-header .vebishop-brand {
  max-width: min(14rem, 28vw);
}

body.vebishop-legal-page header.vebishop-store-header .vebishop-brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

header.vebishop-store-header .vebishop-brand-name {
  font-size: 1.125rem !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 0.125rem;
}

@media (min-width: 640px) {
  header.vebishop-store-header .vebishop-brand-name {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }
}

header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
  height: 2.5rem !important;
  max-width: 10rem !important;
  border-radius: 10px !important;
}

header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell .vebishop-brand-logo {
  height: 100% !important;
  width: auto !important;
  max-width: none !important;
}

@media (min-width: 640px) {
  header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
    height: 2.75rem !important;
    max-width: 11rem !important;
    border-radius: 12px !important;
  }
}

html.vebishop-hide-store-name header.vebishop-store-header .vebishop-brand {
  max-width: min(14rem, 42vw);
}

html.vebishop-hide-store-name header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
  height: 2.75rem !important;
  max-width: 12rem !important;
}

@media (min-width: 640px) {
  html.vebishop-hide-store-name header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
    height: 3rem !important;
    max-width: 13rem !important;
  }
}

header.vebishop-store-header .vebishop-brand .vebishop-brand-mark:not(.hidden) {
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem;
  min-height: 2rem;
  font-size: 0.875rem !important;
}

@media (min-width: 640px) {
  header.vebishop-store-header .vebishop-brand .vebishop-brand-mark:not(.hidden) {
    width: 2.25rem !important;
    height: 2.25rem !important;
    min-width: 2.25rem;
    min-height: 2.25rem;
  }
}

/* Homepage — left-aligned brand lockup, slightly larger than inner pages */
body.vebishop-home-page header.vebishop-store-header .vebishop-brand {
  align-items: center;
  gap: 0.625rem;
  max-width: min(11.5rem, calc(100vw - 10.75rem));
}

body.vebishop-home-page header.vebishop-store-header .vebishop-brand-name {
  font-size: 1.0625rem !important;
  line-height: 1.35 !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.vebishop-home-page header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
  height: 2.625rem !important;
  max-width: 8.5rem !important;
  border-radius: 10px !important;
}

body.vebishop-home-page header.vebishop-store-header .vebishop-brand .vebishop-brand-mark:not(.hidden) {
  width: 2.375rem !important;
  height: 2.375rem !important;
  min-width: 2.375rem;
  min-height: 2.375rem;
  font-size: 1rem !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--vebishop-primary, #4f46e5) 22%, transparent);
}

html.vebishop-hide-store-name body.vebishop-home-page header.vebishop-store-header .vebishop-brand {
  max-width: min(12rem, calc(100vw - 10.75rem));
}

html.vebishop-hide-store-name body.vebishop-home-page header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
  height: 2.75rem !important;
  max-width: 10rem !important;
}

@media (min-width: 640px) {
  body.vebishop-home-page header.vebishop-store-header .vebishop-brand {
    max-width: min(20rem, 32vw);
    gap: 0.75rem;
  }

  body.vebishop-home-page header.vebishop-store-header .vebishop-brand-name {
    font-size: 1.3125rem !important;
    line-height: 1.35 !important;
    white-space: normal;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-bottom: 0.125rem;
  }

  body.vebishop-home-page header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
    height: 3.125rem !important;
    max-width: 12rem !important;
    border-radius: 12px !important;
  }

  body.vebishop-home-page header.vebishop-store-header .vebishop-brand .vebishop-brand-mark:not(.hidden) {
    width: 2.75rem !important;
    height: 2.75rem !important;
    min-width: 2.75rem;
    min-height: 2.75rem;
    font-size: 1.125rem !important;
    border-radius: 0.875rem !important;
  }

  html.vebishop-hide-store-name body.vebishop-home-page header.vebishop-store-header .vebishop-brand {
    max-width: min(14rem, 36vw);
  }

  html.vebishop-hide-store-name body.vebishop-home-page header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
    height: 3.25rem !important;
    max-width: 13.5rem !important;
  }
}

@media (min-width: 1024px) {
  body.vebishop-home-page header.vebishop-store-header .vebishop-brand {
    max-width: 22rem;
  }

  body.vebishop-home-page header.vebishop-store-header .vebishop-brand-name {
    font-size: 1.4375rem !important;
    line-height: 1.3 !important;
    -webkit-line-clamp: 1;
    padding-bottom: 0.125rem;
  }

  body.vebishop-home-page header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
    height: 3.375rem !important;
    max-width: 13rem !important;
  }
}

/* ── Storefront mobile header (main shop pages) — left-aligned lockup ── */
@media (max-width: 639px) {
  header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-checkout)
    .vebishop-store-header__inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-height: 3.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    min-width: 0;
    overflow: hidden;
  }

  header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-checkout)
    #menu-open-btn {
    flex-shrink: 0;
  }

  header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-checkout)
    .vebishop-brand {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    transform: none !important;
    flex: 1 1 auto;
    min-width: 0;
    box-sizing: border-box;
  }

  header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-checkout)
    #vebishop-header-mobile-tools {
    flex-shrink: 0;
    margin-left: auto;
  }

  header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-checkout)
    .vebishop-brand .vebishop-brand-mark:not(.hidden),
  header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-checkout)
    .vebishop-brand .vebishop-brand-logo-shell:not(.hidden) {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 !important;
    flex-shrink: 0;
  }

  header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-checkout)
    .vebishop-brand-name:not(.hidden) {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    text-align: left;
    font-size: 1.3125rem !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-bottom: 0.125rem;
  }

  body.vebishop-home-page
    header.vebishop-store-header:not(.vebishop-header-mode-focused):not(.vebishop-header-mode-checkout)
    .vebishop-brand-name:not(.hidden) {
    font-size: 1.375rem !important;
  }

  header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
    height: 2.25rem !important;
    max-width: 6.5rem !important;
  }

  html.vebishop-hide-store-name header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell {
    max-width: 8rem !important;
  }

  header.vebishop-store-header .vebishop-brand .vebishop-brand-logo-shell .vebishop-brand-logo {
    object-position: center center !important;
  }

  header.vebishop-store-header .vebishop-brand .vebishop-brand-mark:not(.hidden) {
    width: 2.125rem !important;
    height: 2.125rem !important;
    min-width: 2.125rem;
    min-height: 2.125rem;
    font-size: 0.875rem !important;
  }

  #mobile-menu > div > .flex.items-center .vebishop-brand {
    position: static !important;
    display: flex !important;
    padding: 0 !important;
    width: auto !important;
    justify-content: flex-start !important;
  }

  #mobile-menu .vebishop-brand .vebishop-brand-mark:not(.hidden),
  #mobile-menu .vebishop-brand .vebishop-brand-logo-shell:not(.hidden) {
    position: static !important;
    transform: none !important;
  }

  #mobile-menu .vebishop-brand .vebishop-brand-logo-shell .vebishop-brand-logo {
    object-position: center center !important;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  header.vebishop-store-header .vebishop-header-search {
    width: 14rem;
    max-width: 14rem;
    flex: 0 0 14rem;
  }

  header.vebishop-store-header .vebishop-brand {
    max-width: min(14rem, 32vw);
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  header.vebishop-store-header .vebishop-header-search {
    width: 16rem;
    max-width: 16rem;
    flex: 0 0 16rem;
  }

  body.vebishop-legal-page header.vebishop-store-header .vebishop-brand {
    max-width: min(12rem, 22vw);
  }
}

/* ── Admin header (compact logo — not storefront bar) ── */
header.vebishop-admin-header .vebishop-admin-header__inner {
  min-height: 3.5rem;
  align-items: center;
}

header.vebishop-admin-header .vebishop-brand {
  align-items: center;
  max-width: min(15rem, 58vw);
  min-width: 0;
}

header.vebishop-admin-header .vebishop-brand .vebishop-brand-logo-shell {
  height: 2rem !important;
  max-width: 7.5rem !important;
  border-radius: 8px !important;
  flex-shrink: 0;
}

header.vebishop-admin-header .vebishop-brand .vebishop-brand-logo-shell .vebishop-brand-logo {
  display: block !important;
  height: 100% !important;
  width: auto !important;
  max-width: none !important;
  object-fit: contain !important;
  object-position: left center;
}

@media (min-width: 640px) {
  header.vebishop-admin-header .vebishop-brand .vebishop-brand-logo-shell {
    height: 2.25rem !important;
    max-width: 9rem !important;
    border-radius: 10px !important;
  }
}

header.vebishop-admin-header .vebishop-brand .vebishop-brand-mark:not(.hidden) {
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem !important;
  min-height: 2rem !important;
  flex-shrink: 0;
  font-size: 0.875rem !important;
}

header.vebishop-admin-header .vebishop-brand-name {
  font-size: 1rem !important;
  line-height: 1.25rem !important;
}

/* Fallback: any other page header with brand logo */
header:not(.vebishop-store-header):not(.vebishop-admin-header) .vebishop-brand .vebishop-brand-logo-shell {
  height: 2.25rem !important;
  max-width: 9rem !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

header:not(.vebishop-store-header):not(.vebishop-admin-header) .vebishop-brand .vebishop-brand-logo-shell .vebishop-brand-logo {
  height: 100% !important;
  width: auto !important;
  max-width: none !important;
  object-fit: contain !important;
}

/* ── Mobile layout fixes (storefront) ── */
@media (max-width: 639px) {
  header.vebishop-store-header .vebishop-store-header__inner {
    min-width: 0;
    overflow: hidden;
  }

  header.vebishop-header-mode-focused .vebishop-store-header__inner,
  header.vebishop-header-mode-checkout .vebishop-store-header__inner,
  header.vebishop-header-mode-light .vebishop-store-header__inner {
    display: flex;
    justify-content: flex-start;
  }

  header.vebishop-header-mode-focused .vebishop-brand,
  header.vebishop-header-mode-checkout .vebishop-brand,
  header.vebishop-header-mode-light .vebishop-brand {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    flex: 1 1 auto !important;
    min-width: 0;
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    justify-content: center !important;
  }

  header.vebishop-header-mode-focused .vebishop-brand {
    max-width: min(9.5rem, 42vw);
  }

  header.vebishop-header-mode-focused .vebishop-header-back {
    flex-shrink: 0;
  }

  header.vebishop-header-mode-checkout .vebishop-brand {
    max-width: min(10.5rem, 46vw);
  }

  header.vebishop-store-header .vebishop-header-tools {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
    overflow: hidden;
  }

  #vebishop-header-mobile-tools {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
    min-width: 0;
  }
}

/* Store Management nav — loading skeleton */
@keyframes vebishop-admin-nav-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.admin-nav-skeleton {
  display: inline-block;
  vertical-align: middle;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 45%, #e2e8f0 90%);
  background-size: 200% 100%;
  animation: vebishop-admin-nav-shimmer 1.35s ease-in-out infinite;
  pointer-events: none;
}

#admin-link-skeleton.admin-nav-skeleton:not(.hidden) {
  display: inline-block;
  vertical-align: middle;
  width: 8.75rem;
  height: 2.25rem;
}

.admin-nav-skeleton--menu-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  background: transparent;
  animation: none;
}

.admin-nav-skeleton--menu-row::before {
  content: "";
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 45%, #e2e8f0 90%);
  background-size: 200% 100%;
  animation: vebishop-admin-nav-shimmer 1.35s ease-in-out infinite;
}

.admin-nav-skeleton--menu-row::after {
  content: "";
  flex: 1;
  max-width: 9rem;
  height: 0.875rem;
  border-radius: 0.375rem;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 45%, #e2e8f0 90%);
  background-size: 200% 100%;
  animation: vebishop-admin-nav-shimmer 1.35s ease-in-out infinite;
}

.admin-nav-skeleton--footer {
  display: inline-block;
  width: 7.5rem;
  height: 0.875rem;
  border-radius: 0.375rem;
}

@media (prefers-reduced-motion: reduce) {
  .admin-nav-skeleton,
  .admin-nav-skeleton--menu-row::before,
  .admin-nav-skeleton--menu-row::after {
    animation: none;
  }
}
