/* ARTeefy Maker — Header Bar (Maker Pop style) v1.0
   Scope: styles the top brand/header area only.
   Safe: purely CSS; no layout dependency. Prefer adding id="maker-header" on the outer header.
   Fallbacks apply to: #maker-header, header.site-header, body > header:first-of-type
*/

:root {
  --hdr-ink: #111827;
  --hdr-bg: #fff;
  --hdr-radius: 24px;
  --hdr-shadow: 6px 6px 0 var(--hdr-ink);
  --brand-grad: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ===== Container ===== */
#maker-header,
header.site-header,
.header-container {
  position: relative;
  background: var(--hdr-bg);
  border: 4px solid var(--hdr-ink);
  border-radius: var(--hdr-radius);
  box-shadow: var(--hdr-shadow);
  padding: 16px 24px;
  margin: 20px auto 24px;
  max-width: 1400px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
}

/* Ensure side gutters on small screens (some Android browsers ignore container margins) */
#maker-header,
header.site-header,
.header-container {
  box-sizing: border-box;
  width: auto;
  /* 12px gutters on both sides; also respect safe areas */
  max-width: min(1400px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))) !important;
}

#maker-header:hover,
header.site-header:hover,
.header-container:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--hdr-ink);
}

/* Pop bubbles background (subtle) */
#maker-header::before,
header.site-header::before,
.header-container::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(150px 150px at 10% 45%, rgba(240, 147, 251, 0.08), transparent 60%),
    radial-gradient(150px 150px at 35% 80%, rgba(245, 87, 108, 0.08), transparent 60%),
    radial-gradient(120px 120px at 80% 20%, rgba(34, 211, 238, 0.08), transparent 60%);
  mix-blend-mode: multiply;
}

/* ===== Brand block ===== */
.brand-section,
#maker-header .brand,
header.site-header .brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Logo badge with rotation */
.logo-badge,
#maker-header .logo-badge,
header.site-header .logo-badge {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: white;
  display: grid;
  place-items: center;
  border: 3px solid var(--hdr-ink);
  box-shadow: 4px 4px 0 var(--hdr-ink);
  transform: rotate(-5deg);
  transition: transform 0.3s ease;
}

.logo-badge:hover {
  transform: rotate(0deg) scale(1.1);
}

/* Logo image */
.logo-badge img,
#maker-header .logo-badge img,
header.site-header .logo-badge img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Title + subtitle */
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title,
#maker-header .brand-title,
header.site-header .brand-title {
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.5px;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.brand-subtitle,
#maker-header .brand-subtitle,
header.site-header .brand-subtitle {
  font-size: 14px;
  color: #64748B;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ===== Right action buttons ===== */
.header-actions,
#maker-header .header-actions,
header.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

/* All action buttons */
.header-btn,
.header-actions a,
.header-actions button,
#maker-header .header-actions a,
#maker-header .header-actions button,
header.site-header .header-actions a,
header.site-header .header-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 14px;
  border: 3px solid var(--hdr-ink);
  background: white;
  color: var(--hdr-ink);
  box-shadow: 3px 3px 0 var(--hdr-ink);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  overflow: visible;
}

.header-btn:hover,
.header-actions a:hover,
.header-actions button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--hdr-ink);
}

.header-btn:active,
.header-actions a:active,
.header-actions button:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--hdr-ink);
}

/* Primary button (Cart) */
.header-btn.primary,
.header-actions .primary,
[data-variant="primary"] {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
}

/* Secondary button (Admin) */
.header-btn.secondary,
.header-actions .secondary,
[data-variant="secondary"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Logout button */
.header-btn.logout,
.header-actions .logout {
  background: #FEE2E2;
  color: #991B1B;
  border-color: #991B1B;
}

/* Icon styling */
.header-btn-icon {
  font-size: 18px;
  line-height: 1;
}

/* ===== Layout helpers ===== */
.header-inner,
#maker-header .hdr-inner,
header.site-header .hdr-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

/* Mobile responsive */
@media (max-width: 768px) {
  #maker-header,
  header.site-header,
  .header-container {
    margin: 12px;
    padding: 12px 16px;
    border-radius: 20px;
  }

  .brand-title {
    font-size: 22px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .logo-badge {
    width: 50px;
    height: 50px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-btn,
  .header-actions a,
  .header-actions button {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Hide text on mobile, show only icons */
  .header-btn-text {
    display: none;
  }

  .header-btn-icon {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }
}

/* Animation for logo */
@keyframes bounce {
  0%, 100% {
    transform: rotate(-5deg) translateY(0);
  }
  50% {
    transform: rotate(-5deg) translateY(-5px);
  }
}

.logo-badge {
  animation: bounce 3s ease-in-out infinite;
}

.logo-badge:hover {
  animation: none;
}

/* Decorative corner accent */
#maker-header::after,
header.site-header::after,
.header-container::after {
  content: '✨';
  position: absolute;
  top: -10px;
  right: 30px;
  background: white;
  padding: 0 10px;
  font-size: 20px;
}

/* Version badges at bottom */
.version-switcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: white;
  border: 3px solid var(--hdr-ink);
  border-radius: 20px;
  box-shadow: 4px 4px 0 var(--hdr-ink);
  z-index: 1000;
}

.version-switcher button {
  padding: 8px 16px;
  border-radius: 12px;
  border: 2px solid var(--hdr-ink);
  background: white;
  color: var(--hdr-ink);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.version-switcher button:hover {
  background: var(--hdr-ink);
  color: white;
}

.version-switcher button.active {
  background: var(--brand-grad);
  color: white;
  border-color: var(--hdr-ink);
}
