/**
 * Hat Bar Engine — Public canvas styles
 * Palette (client): Cream #FFF5EA · Blush #FC9FAC · Ink #1C1B15 · Stone #BCA58E
 */

/* ─── Custom properties ──────────────────────────────── */
:root {
  --hb-primary:    #FC9FAC;
  --hb-primary-dk: #e8899f;
  --hb-brown:      #1C1B15;
  --hb-brown-md:   #3D3830;
  --hb-brown-lt:   #5A5248;
  --hb-gold:       #BCA58E;
  --hb-gold-lt:    #d4c4b3;
  --hb-rust:       #c76b82;
  --hb-rust-dk:    #b3556d;
  --hb-cream:      #FFF5EA;
  --hb-cream-dk:   #ecdccc;
  --hb-parch:      #FFF5EA;
  --hb-text:       #1C1B15;
  --hb-muted:      #6B6158;
  --hb-border:     #e8dfd2;
  --hb-white:      #FFFBF5;
  --hb-radius:     0.5rem;
  --hb-radius-lg:  0.875rem;
  --hb-shadow:     0 4px 24px rgb(28 27 21 / 0.08);
  --hb-shadow-lg:  0 12px 40px rgb(28 27 21 / 0.12);
}

/* ─── Container ──────────────────────────────────────── */
.hb-container {
  box-sizing: border-box;
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
body.admin-bar .hb-top-header { --hb-header-top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .hb-top-header { --hb-header-top: 46px; }
}

/* ─── Common buttons ─────────────────────────────────── */
.hb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--hb-radius);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, opacity 0.18s, color 0.18s;
  line-height: 1;
}
.hb-btn--primary {
  background: var(--hb-primary);
  color: var(--hb-brown);
  border-color: var(--hb-primary);
}
.hb-btn--primary:hover { background: var(--hb-primary-dk); border-color: var(--hb-primary-dk); color: var(--hb-brown); }
.hb-btn--outline {
  background: transparent;
  color: var(--hb-cream);
  border-color: rgb(245 237 214 / 0.50);
}
.hb-btn--outline:hover { background: rgb(245 237 214 / 0.10); }
.hb-btn--secondary {
  background: transparent;
  color: var(--hb-rust);
  border-color: var(--hb-rust);
}
.hb-btn--secondary:hover { background: var(--hb-rust); color: #fff; }
.hb-btn--gold {
  background: var(--hb-gold);
  color: var(--hb-brown);
  border-color: var(--hb-gold);
}
.hb-btn--gold:hover { background: var(--hb-gold-lt); border-color: var(--hb-gold-lt); }

/* ─── Section headings ───────────────────────────────── */
.hb-section-head { text-align: center; margin-bottom: 2.5rem; }
.hb-section-head__kicker {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--hb-rust);
}
.hb-section-head__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.625rem, 3.5vw, 2.125rem);
  font-weight: 700;
  color: var(--hb-brown);
  line-height: 1.2;
}
.hb-section-head__sub {
  margin: 0;
  font-size: 1rem;
  color: var(--hb-muted);
}

/* ═══════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════ */
.hb-hero {
  position: relative;
  background: var(--hb-brown);
  color: var(--hb-cream);
  overflow: hidden;
}
.hb-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 85% 55% at 75% 20%, rgb(252 159 172 / 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 15% 80%, rgb(188 165 142 / 0.14) 0%, transparent 50%),
    linear-gradient(160deg, #1C1B15 0%, #12110f 55%, #252320 100%);
  background-size: cover;
}
/* Subtle texture stripes (USA flag nod — very subtle) */
.hb-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgb(255 255 255 / 0.015) 0px,
    rgb(255 255 255 / 0.015) 1px,
    transparent 1px,
    transparent 8px
  );
}
.hb-hero__inner {
  position: relative;
  z-index: 1;
  padding-top: 5rem;
  padding-bottom: 5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 900px) {
  .hb-hero__inner { grid-template-columns: 1fr 1fr; align-items: center; }
}
.hb-hero__content { max-width: 36rem; }
.hb-hero__eyebrow {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hb-gold);
}
.hb-hero__title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--hb-white);
}
.hb-hero__sub {
  margin: 0 0 2.25rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgb(255 251 245 / 0.82);
}
.hb-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Hero stats strip */
.hb-hero__stats {
  position: relative;
  z-index: 1;
  background: rgb(0 0 0 / 0.28);
  border-top: 1px solid rgb(188 165 142 / 0.35);
  padding: 1rem 0;
}
.hb-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.hb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 2rem;
  gap: 0.1rem;
}
.hb-stat--divider {
  width: 1px;
  background: rgb(188 165 142 / 0.35);
  padding: 0;
  align-self: stretch;
}
.hb-stat__num {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--hb-gold);
  line-height: 1;
}
.hb-stat__num span { font-size: 0.9rem; }
.hb-stat__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(255 251 245 / 0.68);
}

/* ═══════════════════════════════════════════════════════
   HOW IT WORKS
   ═══════════════════════════════════════════════════════ */
.hb-steps {
  background: var(--hb-white);
  padding: 4rem 0;
  border-bottom: 1px solid var(--hb-border);
}
.hb-steps__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}
@media (min-width: 768px) {
  .hb-steps__list { grid-template-columns: repeat(3, 1fr); }
}
.hb-step {
  position: relative;
  background: var(--hb-parch);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  padding: 2rem 1.5rem 1.75rem;
}
.hb-step__num {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--hb-cream-dk);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.hb-step__icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--hb-rust);
  margin-bottom: 1rem;
}
.hb-step__icon svg { width: 100%; height: 100%; }
.hb-step__title {
  margin: 0 0 0.6rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--hb-brown);
}
.hb-step__text {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--hb-muted);
}
.hb-step__link {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--hb-rust);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.hb-step__link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   CATEGORIES
   ═══════════════════════════════════════════════════════ */
.hb-cats {
  background: var(--hb-cream);
  padding: 4rem 0;
  border-bottom: 1px solid var(--hb-border);
}
.hb-cats__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) { .hb-cats__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .hb-cats__grid { grid-template-columns: repeat(3, 1fr); } }
.hb-cats__empty {
  margin: 0 auto;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--hb-muted);
  line-height: 1.6;
  max-width: 28rem;
}
.hb-cat-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  overflow: hidden;
  background: var(--hb-white);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
}
.hb-cat-card:hover {
  border-color: var(--hb-gold);
  box-shadow: var(--hb-shadow-lg);
  transform: translateY(-3px);
}
.hb-cat-card__img-wrap {
  aspect-ratio: 4/3;
  background: var(--hb-cream-dk);
  overflow: hidden;
}
.hb-cat-card__img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.35s ease;
}
.hb-cat-card:hover .hb-cat-card__img-wrap img { transform: scale(1.04); }
.hb-cat-card__placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--hb-gold);
}
.hb-cat-card__placeholder svg { width: 3.5rem; height: 3.5rem; opacity: 0.6; }
.hb-cat-card__body { padding: 1.25rem 1.25rem 1.5rem; }
.hb-cat-card__name {
  margin: 0 0 0.35rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--hb-brown);
}
.hb-cat-card__count {
  font-size: 0.8125rem;
  color: var(--hb-muted);
  font-weight: 600;
}
.hb-cat-card__desc {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--hb-muted);
}
.hb-cats__more { margin-top: 2.5rem; text-align: center; }

/* ═══════════════════════════════════════════════════════
   CRAFT
   ═══════════════════════════════════════════════════════ */
.hb-craft {
  background: var(--hb-brown);
  color: var(--hb-cream);
  padding: 4.5rem 0;
}
.hb-craft .hb-section-head__kicker { color: var(--hb-gold); }
.hb-craft__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}
@media (min-width: 900px) { .hb-craft__inner { grid-template-columns: 1fr 1fr; } }
.hb-craft__headline {
  margin: 0.5rem 0 1.25rem;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--hb-white);
  line-height: 1.15;
}
.hb-craft__body {
  margin: 0 0 2rem;
  font-size: 1rem;
  line-height: 1.7;
  color: rgb(245 237 214 / 0.75);
}
.hb-craft__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hb-craft__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: rgb(245 237 214 / 0.80);
  line-height: 1.5;
}
.hb-craft__check {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--hb-gold);
  color: var(--hb-brown);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
  margin-top: 0.1rem;
}

/* ═══════════════════════════════════════════════════════
   REVIEWS
   ═══════════════════════════════════════════════════════ */
.hb-reviews {
  background: var(--hb-white);
  padding: 4rem 0;
  border-bottom: 1px solid var(--hb-border);
}
.hb-reviews__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 768px) { .hb-reviews__grid { grid-template-columns: repeat(3, 1fr); } }
.hb-review {
  background: var(--hb-parch);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  padding: 1.5rem;
  margin: 0;
}
.hb-review__stars {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--hb-gold);
  letter-spacing: 0.05em;
}
.hb-review__body {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--hb-text);
  font-style: italic;
}
.hb-review__footer {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.875rem;
}
.hb-review__footer strong { color: var(--hb-brown); font-weight: 700; }
.hb-review__footer span { color: var(--hb-muted); }

/* ═══════════════════════════════════════════════════════
   BOTTOM CTA BAND
   ═══════════════════════════════════════════════════════ */
.hb-cta-band {
  background: linear-gradient(135deg, var(--hb-primary-dk) 0%, var(--hb-primary) 55%, #f8b4c0 100%);
  padding: 3.5rem 0;
}
.hb-cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.hb-cta-band__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--hb-brown);
}
.hb-cta-band__sub {
  margin: 0;
  font-size: 0.9375rem;
  color: rgb(28 27 21 / 0.72);
}

/* ═══════════════════════════════════════════════════════
   PAGE TYPOGRAPHY (about)
   ═══════════════════════════════════════════════════════ */
.hb-page-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--hb-brown);
  margin: 0 0 1rem;
}
.hb-page-lead {
  font-size: 1.0625rem;
  color: var(--hb-muted);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════
   GLOBAL NAV STYLES
   ═══════════════════════════════════════════════════════ */
/* Shared: works for both ul.menu (WP nav) and .hb-primary-nav__menu (fallback) */
.hb-primary-nav__menu,
.hb-primary-nav__menu,
.hb-primary-nav ul.menu {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.hb-primary-nav ul.menu .sub-menu,
.hb-primary-nav__menu .sub-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 0.5rem);
  left: 0;
  margin: 0;
  min-width: 12rem;
  list-style: none;
  padding: 0.5rem 0;
  border-radius: 0.5rem;
  border: 1px solid var(--hb-border);
  background: #fff;
  box-shadow: var(--hb-shadow-lg);
  display: none;
}
.hb-primary-nav ul.menu li:hover > .sub-menu,
.hb-primary-nav ul.hb-primary-nav__menu li:hover > .sub-menu {
  display: block;
}
.hb-primary-nav ul.menu li,
.hb-primary-nav ul.hb-primary-nav__menu li {
  position: relative;
}
.hb-primary-nav ul.menu .sub-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--hb-text);
  text-decoration: none;
}
.hb-primary-nav ul.menu .sub-menu li a:hover { background: var(--hb-cream); color: var(--hb-rust); }
.hb-primary-nav .hb-nav-menu-link,
.hb-nav-fallback__link {
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--hb-brown);
  transition: color 0.15s;
}
.hb-primary-nav .hb-nav-menu-link:hover,
.hb-nav-fallback__link:hover { color: var(--hb-rust); }
/* wp_nav_menu uses menu_class hb-primary-nav__menu (no default "menu" class). */
.hb-primary-nav ul.menu li.current-menu-item > a,
.hb-primary-nav ul.menu li.current-menu-ancestor > a,
.hb-primary-nav ul.menu li.current-page-item > a,
.hb-primary-nav ul.hb-primary-nav__menu li.current-menu-item > a,
.hb-primary-nav ul.hb-primary-nav__menu li.current-menu-ancestor > a,
.hb-primary-nav ul.hb-primary-nav__menu li.current-page-item > a {
  color: var(--hb-rust);
  font-weight: 800;
}
.hb-nav-fallback__link.hb-nav-fallback__link--current {
  color: var(--hb-rust);
  font-weight: 800;
}

/* ═══════════════════════════════════════════════════════
   WC BUTTON OVERRIDES (canvas scope)
   ═══════════════════════════════════════════════════════ */
.hb-canvas .woocommerce .button.alt,
.hb-canvas .woocommerce button.button.alt {
  background-color: var(--hb-primary);
  border-color: var(--hb-primary-dk);
  color: var(--hb-brown);
  border-radius: var(--hb-radius);
  font-weight: 700;
}
.hb-canvas .woocommerce .button.alt:hover,
.hb-canvas .woocommerce button.button.alt:hover {
  background-color: var(--hb-primary-dk);
  border-color: var(--hb-primary-dk);
  color: var(--hb-brown);
}
.hb-canvas .hb-customize-btn { margin-left: 0.5rem; }
.hb-prose p { line-height: 1.65; }

/* ═══════════════════════════════════════════════════════
   CANVAS BODY
   ═══════════════════════════════════════════════════════ */
.hb-canvas {
  background: var(--hb-parch);
  color: var(--hb-text);
  font-family: "DM Sans", system-ui, sans-serif;
}

/* ═══════════════════════════════════════════════════════
   GLOBAL FOOTER
   ═══════════════════════════════════════════════════════ */
.hb-footer {
  background: var(--hb-brown);
  color: var(--hb-cream);
  font-size: 0.9375rem;
  border-top: 1px solid rgb(252 159 172 / 0.35);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
}

.hb-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-top: 3rem;
  padding-bottom: 2.5rem;
}
@media (min-width: 768px) {
  .hb-footer__inner {
    grid-template-columns: 1.6fr 1fr;
    align-items: start;
  }
}

/* Brand */
.hb-footer__logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-bottom: 0.875rem;
}
/* Tailwind/preflight often sets img { max-width:100%; height:auto }, which blows up
   large source assets; max-height keeps the footer mark visually in line with the header. */
.hb-footer__brand .hb-footer__logo-link .hb-footer__logo {
  display: block;
  width: auto;
  max-width: min(10rem, 100%);
  max-height: 2.25rem;
  height: auto;
  object-fit: contain;
}
.hb-footer__site-name {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--hb-white, #FFFDF8);
  letter-spacing: -0.01em;
}
.hb-footer__tagline {
  color: var(--hb-cream-dk, #EBE0C4);
  font-size: 0.875rem;
  line-height: 1.65;
  max-width: 28rem;
  margin: 0;
}

/* Nav columns */
.hb-footer__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.hb-footer__col-title {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hb-gold);
  margin: 0 0 0.75rem;
}
.hb-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.hb-footer__links a {
  color: var(--hb-cream-dk, #EBE0C4);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.15s;
}
.hb-footer__links a:hover {
  color: var(--hb-gold);
}

/* Copyright bar */
.hb-footer__bar {
  background: rgba(0,0,0,0.25);
  border-top: 1px solid rgba(255,255,255,0.07);
}
.hb-footer__bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.hb-footer__copy,
.hb-footer__made {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(245, 237, 214, 0.65);
}
.hb-footer__copy a {
  color: inherit;
  text-decoration: none;
}
.hb-footer__copy a:hover {
  color: var(--hb-gold);
}

/* ═══════════════════════════════════════════════════════════════════════
   GLOBAL BREADCRUMB
   ═══════════════════════════════════════════════════════════════════════ */

/* No full-width band — sits inside the max-width container, flush with page content */
.hb-breadcrumb {
  padding-top: 0.75rem;
  padding-bottom: 0;
}
.hb-breadcrumb__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}
.hb-breadcrumb__item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
}
.hb-breadcrumb__item--current span {
  color: var(--hb-muted, #7A5C3E);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  display: inline-block;
  vertical-align: middle;
}
.hb-breadcrumb__link {
  color: var(--hb-muted, #7A5C3E);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
  white-space: nowrap;
}
.hb-breadcrumb__link:hover { color: var(--hb-primary, #F783A8); }
.hb-breadcrumb__sep {
  color: var(--hb-border, #D9CEBB);
  font-size: 0.6rem;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* -----------------------------------------------------------------------
   HAT BAR CUSTOMIZER MODAL  (.hbc-*)
   ----------------------------------------------------------------------- */

/* Overlay */
.hbc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 17, 10, 0.65);
  padding: 1rem;
  backdrop-filter: blur(3px);
}

/* Modal */
.hbc-modal {
  background: var(--hb-cream);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(26, 17, 10, 0.28);
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: hbc-fade-in 0.2s ease;
}
.hbc-modal--large {
  max-width: 1180px;
  max-height: 94vh;
}
@keyframes hbc-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hbc-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--hb-border);
  background: var(--hb-cream);
  z-index: 1;
  flex-shrink: 0;
}
.hbc-modal__title {
  font-family: var(--hb-font-serif);
  font-size: 1.25rem;
  color: var(--hb-brown);
  margin: 0;
  letter-spacing: 0.01em;
}
.hbc-modal__subtitle {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--hb-muted);
}
.hbc-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--hb-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.hbc-modal__close:hover { background: rgba(44, 26, 15, 0.08); }

.hbc-modal__body {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.hbc-modal__footer {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--hb-border);
  background: var(--hb-cream);
}

/* Buttons */
.hbc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--hb-font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, opacity 0.18s;
  border: 2px solid transparent;
  white-space: nowrap;
}
.hbc-btn--primary {
  background: var(--hb-primary, #F783A8);
  color: var(--hb-brown, #2C1A0F);
  border-color: var(--hb-primary, #F783A8);
}
.hbc-btn--primary:hover { background: var(--hb-primary-dk, #e5608e); border-color: var(--hb-primary-dk, #e5608e); color: #fff; }
.hbc-btn--primary:disabled { opacity: 0.55; cursor: not-allowed; }
.hbc-btn--outline {
  background: transparent;
  color: var(--hb-brown);
  border-color: var(--hb-brown);
}
.hbc-btn--outline:hover { background: var(--hb-brown); color: var(--hb-cream); }
.hbc-btn--ghost {
  background: transparent;
  color: var(--hb-muted);
  border-color: var(--hb-border);
}
.hbc-btn--ghost:hover { background: rgba(44, 26, 15, 0.06); }
.hbc-btn--wide { width: 100%; }

/* Loading / Error / Success */
.hbc-loading {
  text-align: center;
  padding: 2rem;
  color: var(--hb-muted);
  font-size: 0.9375rem;
}
.hbc-error  { color: #c0392b; font-size: 0.875rem; margin: 0.5rem 0; }
.hbc-success { color: #27ae60; font-size: 0.875rem; margin: 0.5rem 0; font-weight: 600; }
.hbc-empty-msg { color: var(--hb-muted); font-size: 0.875rem; padding: 1rem 0; }

/* ─────────────────────────────────────────────────────────────────
   Builder — compact, classic, two-column
   ───────────────────────────────────────────────────────────────── */
.hbc-modal__body.hbc-builder {
  padding: 0;
  overflow: hidden;            /* canvas/footer handle their own overflow */
}
.hbc-builder {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  align-items: stretch;
  height: 100%;
}
@media (max-width: 880px) {
  .hbc-builder { grid-template-columns: 1fr; }
}

.hbc-builder__left {
  border-right: 1px solid var(--hb-border);
  padding: 0.9rem 0.85rem;
  background: var(--hb-parch, #FAF6EC);
  overflow-y: auto;
  min-width: 0;
}
@media (max-width: 880px) {
  .hbc-builder__left { border-right: none; border-bottom: 1px solid var(--hb-border); max-height: 220px; }
}
.hbc-builder__right {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem;
  min-width: 0;
}

/* Library groups */
.hbc-lib__hint {
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.55rem;
  background: #fff;
  border: 1px dashed var(--hb-border);
  border-radius: 6px;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--hb-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hbc-lib__hint i { color: var(--hb-primary, #F783A8); font-size: 0.78rem; }
.hbc-lib__group + .hbc-lib__group { margin-top: 0.85rem; }
.hbc-lib__title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hb-muted);
  margin: 0 0 0.4rem;
}

/* Parts grid */
.hbc-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 0.4rem;
}
.hbc-part-card {
  position: relative;
  border: 1.5px solid var(--hb-border);
  border-radius: 7px;
  background: #fff;
  cursor: grab;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
  text-align: left;
}
.hbc-part-card:active { cursor: grabbing; transform: scale(0.98); }
.hbc-part-card:hover  { border-color: var(--hb-primary, #F783A8); box-shadow: 0 2px 8px rgba(247, 131, 168, 0.18); }
.hbc-part-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  pointer-events: none;
  background:
    repeating-conic-gradient(#f5f5f5 0 90deg, #fff 0 180deg) 0 0/10px 10px;
}
.hbc-part-card__placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--hb-parch, #FAF6EC);
  color: var(--hb-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.hbc-part-card__body {
  padding: 0.3rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.hbc-part-card__name  { font-size: 0.72rem; font-weight: 600; color: var(--hb-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.hbc-part-card__price { font-size: 0.68rem; color: var(--hb-primary-dk, #e5608e); font-weight: 700; line-height: 1.2; }

/* Floating vertical side switcher inside the canvas (top-right). */
.hbc-side-stack {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 3;
  pointer-events: none;             /* gaps don't block drag/drop on canvas */
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.hbc-side-btn {
  pointer-events: auto;             /* but the buttons themselves are clickable */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  width: 46px;
  padding: 0.4rem 0.3rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 206, 187, 0.7);
  border-radius: 5px;
  color: var(--hb-muted);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
  font-family: var(--hb-font-sans, inherit);
}
.hbc-side-btn i { font-size: 0.85rem; line-height: 1; }
.hbc-side-btn__label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}
.hbc-side-btn:hover:not(:disabled) {
  color: var(--hb-brown);
  border-color: var(--hb-brown);
  background: #fff;
  box-shadow: 0 3px 12px rgba(44, 26, 15, 0.14);
}
.hbc-side-btn--active {
  background: var(--hb-brown);
  border-color: var(--hb-brown);
  color: var(--hb-cream);
  box-shadow: 0 4px 14px rgba(44, 26, 15, 0.28);
}
.hbc-side-btn--active:hover {
  background: var(--hb-brown) !important;
  color: var(--hb-cream) !important;
  border-color: var(--hb-brown) !important;
}
.hbc-side-btn--empty { opacity: 0.4; cursor: not-allowed; }
.hbc-side-btn:disabled { cursor: not-allowed; }

/* Canvas wrapper — base image lives as bg of this element, Fabric canvas overlays */
.hbc-canvas-wrap {
  position: relative;
  background-color: #fff;
  border: 1px solid var(--hb-border);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  flex: 1;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hbc-canvas-wrap--drop {
  border-color: var(--hb-primary, #F783A8);
  box-shadow: inset 0 0 0 2px var(--hb-primary, #F783A8);
}
.hbc-canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 0.85rem;
  color: var(--hb-muted);
  font-style: italic;
  pointer-events: none;
  z-index: 0;
}
/* Fabric injects .canvas-container here — make sure it's positioned and clickable. */
.hbc-canvas-wrap > .canvas-container {
  position: relative;
  z-index: 1;
}
/* Fabric writes its own wrappers around <canvas>; ensure they don't shrink */
.hbc-canvas-wrap .canvas-container { display: block !important; }
.hbc-canvas {
  display: block;
  touch-action: none;
  user-select: none;
}

/* Footer: clean inline row, no box. Subtle top divider only. */
.hbc-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0 0.25rem;
  border-top: 1px solid var(--hb-border);
  flex-shrink: 0;
  background: transparent;
}
.hbc-footer__left {
  display: flex;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.hbc-footer__total {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  flex: 1;
  margin-left: 0.25rem;
}
.hbc-footer__total-label {
  font-size: 0.68rem;
  color: var(--hb-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.hbc-footer__total-value {
  font-family: var(--hb-font-serif, inherit);
  font-size: 1.6rem;
  color: var(--hb-brown);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}
.hbc-mini-btn {
  background: transparent;
  border: 1px solid var(--hb-border);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--hb-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.hbc-mini-btn:hover { background: var(--hb-brown); border-color: var(--hb-brown); color: var(--hb-cream); }

.hbc-footer .hbc-btn {
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  border-radius: 8px;
}

.hbc-error--bottom, .hbc-success--bottom { margin: 0; font-size: 0.78rem; }

/* Modal sizing — match new compact builder */
.hbc-modal--large {
  max-width: 1080px;
  height: 88vh;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.hbc-modal--large .hbc-modal__body { flex: 1; min-height: 0; }

/* -----------------------------------------------------------------------
   CART DRAWER  (.hb-drawer*)
   ----------------------------------------------------------------------- */

.hb-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 8900;
  background: rgba(26, 17, 10, 0.5);
  backdrop-filter: blur(2px);
}
.hb-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8950;
  width: 100%;
  max-width: 420px;
  background: var(--hb-cream);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(26, 17, 10, 0.2);
  animation: hb-drawer-slide-in 0.25s ease;
}
/* Logged-in admin bar overlaps fixed UI — offset drawer below toolbar. */
body:has(#wpadminbar) aside.hb-drawer {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body:has(#wpadminbar) aside.hb-drawer {
    top: 46px;
  }
}
@keyframes hb-drawer-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.hb-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--hb-border);
  background: var(--hb-brown);
  color: var(--hb-cream);
}
.hb-drawer__title {
  font-family: var(--hb-font-serif);
  font-size: 1.1rem;
  color: var(--hb-cream);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hb-drawer__badge {
  background: var(--hb-gold);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1em 0.55em;
}
.hb-drawer__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--hb-cream);
  cursor: pointer;
  opacity: 0.8;
  padding: 0.2rem 0.4rem;
  transition: opacity 0.15s;
}
.hb-drawer__close:hover { opacity: 1; }
.hb-drawer__loading,
.hb-drawer__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  color: var(--hb-muted);
  text-align: center;
}
.hb-drawer__body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.hb-drawer__items {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.hb-drawer__item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--hb-border);
}
.hb-drawer__item-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid var(--hb-border);
}
/* Customised hat snapshots are PNGs with transparency — use parchment bg and contain. */
.hb-drawer__item-img--custom {
  object-fit: contain;
  background: var(--hb-parch, #FAF6EC);
  border-color: var(--hb-primary, #F783A8);
}
.hb-drawer__item-img--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hb-parch, #FAF6EC);
  color: var(--hb-muted);
  font-size: 1rem;
}
.hb-drawer__item-info { flex: 1; min-width: 0; }
.hb-drawer__item-name   { font-weight: 600; font-size: 0.875rem; color: var(--hb-ink); margin: 0 0 0.2rem; }
.hb-drawer__item-design { font-size: 0.78rem; color: var(--hb-muted); margin: 0 0 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-drawer__item-qty    { font-size: 0.8rem; color: var(--hb-muted); margin: 0; }
.hb-drawer__item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}
.hb-drawer__edit-btn,
.hb-drawer__remove-btn {
  background: none;
  border: 1px solid var(--hb-border);
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  color: var(--hb-muted);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.hb-drawer__edit-btn i { font-size: 0.78rem; }
.hb-drawer__edit-btn:hover   { background: var(--hb-gold); color: #fff; border-color: var(--hb-gold); }
.hb-drawer__remove-btn:hover { background: var(--hb-rust); color: #fff; border-color: var(--hb-rust); }
.hb-drawer__remove-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hb-drawer__footer {
  padding: 1.25rem;
  border-top: 2px solid var(--hb-border);
  background: var(--hb-cream);
}
.hb-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--hb-brown);
  margin-bottom: 1rem;
}

/* -----------------------------------------------------------------------
   AUTH MODAL  (.hb-auth*)
   ----------------------------------------------------------------------- */

.hb-auth-modal {
  background: var(--hb-cream);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(26, 17, 10, 0.28);
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: hbc-fade-in 0.2s ease;
}
.hb-auth-modal .hbc-modal__header {
  border-radius: 12px 12px 0 0;
}
.hb-auth-modal .hb-auth__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem;
}
.hb-auth__tabs {
  display: flex;
  border-bottom: 2px solid var(--hb-border);
  margin-bottom: 1.25rem;
}
.hb-auth__tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--hb-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 600;
  transition: color 0.15s, border-color 0.15s;
}
.hb-auth__tab--active { color: var(--hb-brown); border-bottom-color: var(--hb-brown); }
.hb-auth__tab:hover   { color: var(--hb-brown); }
.hb-auth__form { display: flex; flex-direction: column; gap: 1rem; }
.hb-auth__row  { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.hb-auth__field { display: flex; flex-direction: column; gap: 0.3rem; }
.hb-auth__label { font-size: 0.8125rem; font-weight: 600; color: var(--hb-brown); }
.hb-auth__input {
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--hb-border);
  border-radius: 6px;
  font-size: 0.9375rem;
  background: #fff;
  color: var(--hb-ink);
  transition: border-color 0.15s;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.hb-auth__input:focus { border-color: var(--hb-brown); }
.hb-auth__remember {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--hb-muted);
  cursor: pointer;
}

/* My Account page — inline auth (same fields as modal; not checkout) */
.hb-account-auth {
  padding-top: 65px;
  max-width: 500px;
  width: 100%;
  margin: 0 auto 1.5rem;
  box-sizing: border-box;
}
.hb-account-auth__card {
  /* Flat chrome on My Account only; modal keeps .hb-auth-modal background/radius/shadow */
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.hb-account-auth__title {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--hb-brown);
}
/* Themes sometimes override [hidden]; keep one form visible at a time */
.hb-account-auth [data-auth-panel][hidden] {
  display: none !important;
}
.hb-account-auth__body {
  padding-top: 1.25rem;
  width: 500px;
  max-width: 100%;
  box-sizing: border-box;
}
.hb-account-auth__msg { margin: 0 0 1rem; }
.hb-account-auth__msg[hidden] { display: none !important; }
.hb-account-auth__lost {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  text-align: center;
}
.hb-account-auth__lost a {
  color: var(--hb-rust);
  font-weight: 600;
}
.hb-account-auth__switch {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  text-align: center;
  color: var(--hb-muted);
}
.hb-account-auth__link-btn {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--hb-rust);
  cursor: pointer;
  text-decoration: underline;
}
.hb-account-auth__link-btn:hover {
  color: var(--hb-brown);
}
