/* ==========================================================================
   Site chrome: announcement bar, header, mega menu, mobile drawer, footer.
   ========================================================================== */

/* -------------------------------------------------------- announcement */

.ac-announce {
  background: var(--ac-ink);
  color: #E9D9BD;
  text-align: center;
  padding: 10px 20px;
  font-family: var(--ac-font-label);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------- header */

.ac-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ac-surface);
  border-bottom: 1px solid var(--ac-line-head);
}

.ac-header__bar {
  max-width: var(--ac-max);
  margin: 0 auto;
  padding: 18px var(--ac-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ac-header__left { display: flex; align-items: center; gap: 16px; }

/* Wordmark: two stacked tracked lines with the script tagline beneath. */
.ac-wordmark {
  display: block;
  text-align: center;
  line-height: 1;
  text-decoration: none;
  color: var(--ac-ink);
}
.ac-wordmark__line {
  display: block;
  font-family: var(--ac-font-label);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: .26em;
  text-transform: uppercase;
  padding-left: .26em;   /* optical centring: tracking adds space on the right */
  margin-bottom: 4px;
}
.ac-wordmark__tag {
  display: block;
  font-size: 19px;
  margin-top: 5px;
  line-height: 1;
}
.ac-wordmark--sm .ac-wordmark__line { font-size: 16px; letter-spacing: .24em; padding-left: .24em; }
.ac-wordmark--sm .ac-wordmark__tag  { font-size: 18px; }

/* Nav */
.ac-nav { display: flex; gap: 26px; white-space: nowrap; }
.ac-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ac-font-label);
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ac-story-ground);
  text-decoration: none;
  transition: opacity .2s;
}
.ac-nav__link:hover,
.ac-header__login:hover,
.ac-bag:hover { opacity: .55; }

.ac-nav__caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform .2s;
}
.ac-nav__item--mega.is-open .ac-nav__caret { transform: rotate(180deg); }
.ac-nav__item--mega.is-open .ac-nav__link  { color: var(--ac-accent-deep); }

.ac-header__right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--ac-font-label);
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ac-header__login { color: var(--ac-story-ground); text-decoration: none; }
.ac-bag { display: inline-flex; align-items: center; gap: 7px; color: var(--ac-story-ground); text-decoration: none; }
.ac-bag__count {
  background: var(--ac-accent);
  color: var(--ac-on-ink);
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

/* Burger, hidden until the nav no longer fits */
.ac-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--ac-line-warm);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ac-burger span,
.ac-burger span::before,
.ac-burger span::after {
  display: block;
  width: 16px; height: 1.5px;
  background: var(--ac-story-ground);
  content: '';
  position: relative;
}
.ac-burger span::before { position: absolute; top: -5px; }
.ac-burger span::after  { position: absolute; top: 5px; }

/* ----------------------------------------------------------- mega menu */

.ac-mega {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  background: var(--ac-surface);
  border-bottom: 1px solid var(--ac-line-head);
  box-shadow: var(--ac-shadow-mega);
  animation: ac-fade .2s ease;
}
.ac-mega[hidden] { display: none; }
@keyframes ac-fade { from { opacity: 0 } to { opacity: 1 } }

.ac-mega__inner {
  max-width: var(--ac-max);
  margin: 0 auto;
  padding: 34px var(--ac-gutter) 36px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
}
.ac-mega__label { margin: 0 0 18px; font-size: 11px; letter-spacing: .2em; }
.ac-mega__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 24px; }

.ac-mega__cat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background .2s;
}
.ac-mega__cat:hover { background: var(--ac-surface-alt); }
.ac-mega__thumb {
  width: 40px; height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--ac-surface-alt);
}
.ac-mega__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-mega__name {
  display: block;
  font-family: var(--ac-font-heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ac-ink);
}
.ac-mega__count { display: block; font-size: 11.5px; color: var(--ac-ink-muted); }

.ac-mega__foot {
  display: flex;
  gap: 22px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ac-panel-warm);
  font-family: var(--ac-font-label);
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ac-mega__all   { color: var(--ac-ink); border-bottom: 1.5px solid var(--ac-accent); padding-bottom: 3px; text-decoration: none; }
.ac-mega__build { color: var(--ac-accent-deep); text-decoration: none; }

.ac-mega__feature {
  position: relative;
  border-radius: var(--ac-radius-card);
  overflow: hidden;
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  text-decoration: none;
}
.ac-mega__feature img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.ac-mega__feature::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,12,7,.05), rgba(20,12,7,.78));
}
.ac-mega__featuretext { position: relative; z-index: 1; }
.ac-mega__featuretext .ac-label { color: var(--ac-accent-light); font-size: 10.5px; letter-spacing: .2em; }
.ac-mega__featuretitle {
  display: block;
  margin-top: 7px;
  font-family: var(--ac-font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ac-on-dark);
}

/* ------------------------------------------------------- mobile drawer */

.ac-drawer { position: fixed; inset: 0; z-index: 60; }
.ac-drawer[hidden] { display: none; }
.ac-drawer__scrim { position: absolute; inset: 0; background: rgba(20,12,7,.5); animation: ac-fade .25s ease; }
.ac-drawer__panel {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: min(300px, 86vw);
  background: var(--ac-surface);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  animation: ac-slide .3s cubic-bezier(.2,.7,.2,1);
}
@keyframes ac-slide { from { transform: translateX(-100%) } to { transform: translateX(0) } }

.ac-drawer__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.ac-drawer__close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ac-ink); padding: 0; }
.ac-drawer__nav { display: flex; flex-direction: column; }
.ac-drawer__nav a {
  font-family: var(--ac-font-label);
  font-size: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 14px 0;
  border-bottom: 1px solid var(--ac-panel-warm);
  text-decoration: none;
  color: var(--ac-ink);
}
.ac-drawer__nav .ac-drawer__login { color: var(--ac-accent-deep); border-bottom: 0; }

/* -------------------------------------------------------------- footer */

.ac-footer { background: var(--ac-ink); color: #D8C7AD; padding: 56px var(--ac-gutter) 30px; }
.ac-footer__inner {
  max-width: var(--ac-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.1fr 1.1fr 1fr;
  gap: 40px;
}
.ac-footer .ac-wordmark { text-align: left; color: var(--ac-on-dark); }
.ac-footer .ac-wordmark__line { font-size: 16px; }
.ac-footer__blurb { margin: 18px 0 0; font-size: 14px; line-height: 1.7; color: #A98C68; max-width: 30ch; }
.ac-footer .ac-label { color: var(--ac-accent-light); font-size: 11px; letter-spacing: .14em; margin: 0 0 12px; }
.ac-footer ul { list-style: none; margin: 0; padding: 0; }
.ac-footer li { margin-bottom: 9px; }
.ac-footer a { color: #D8C7AD; text-decoration: none; font-size: 14px; transition: color .2s; }
.ac-footer a:hover { color: var(--ac-accent-light); }
.ac-footer address { font-style: normal; font-size: 14px; line-height: 1.75; }
.ac-footer__hours { display: block; color: #A98C68; margin: 8px 0; }

.ac-footer__base {
  max-width: var(--ac-max);
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid #43301F;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: #8D745B;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 1120px) {
  .ac-footer__inner { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 1010px) {
  .ac-nav { display: none; }
  .ac-burger { display: inline-flex; }
  .ac-header__login { display: none; }
  .ac-mega { display: none !important; }
  .ac-mega__inner { grid-template-columns: 1fr; }
  .ac-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .ac-announce { font-size: 10.5px; letter-spacing: .14em; }
  .ac-wordmark__line { font-size: 15px; }
  .ac-wordmark__tag { font-size: 16px; }
  .ac-footer__inner { grid-template-columns: 1fr; gap: 30px; }
  .ac-footer__base { flex-direction: column; gap: 6px; }
}


/* ==========================================================================
   Mega panel — fitting the screen it actually opens on

   The curated menu is twelve categories (fourteen for a dealer), and at three
   columns that is four or five rows. On a 13" laptop the last row fell below
   the fold — and because the panel closes on mouse-leave you cannot scroll the
   page to reach it, so the row may as well not exist.

   Two changes: let the grid find four columns when there is room, so twelve
   items become three rows; and cap the panel to the space left under the
   header, scrolling inside itself if a very short screen still runs out.
   ========================================================================== */

.ac-mega__grid {
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 4px 18px;
}

.ac-mega {
  max-height: calc(100dvh - var(--ac-header-h, 104px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Trim the vertical rhythm so the common case needs no scrolling at all. */
.ac-mega__inner { padding: 24px var(--ac-gutter) 26px; }
.ac-mega__label { margin: 0 0 12px; }
.ac-mega__cat { padding: 7px 10px; gap: 11px; }
.ac-mega__thumb { width: 38px; height: 38px; }
.ac-mega__foot { margin-top: 14px; padding-top: 13px; }

/* Short viewports — laptops, and anything with a lot of browser chrome. */
@media (max-height: 820px) {
  .ac-mega__inner { padding: 18px var(--ac-gutter) 20px; gap: 28px; }
  .ac-mega__cat { padding: 5px 10px; }
  .ac-mega__thumb { width: 34px; height: 34px; }
  .ac-mega__name { font-size: 16.5px; }
  .ac-mega__count { font-size: 11px; }
  .ac-mega__feature { min-height: 0; }
}

/* The panel scrolls before the page does, so give it a scrollbar worth
   looking at rather than the browser default. */
.ac-mega::-webkit-scrollbar { width: 8px; }
.ac-mega::-webkit-scrollbar-thumb { background: var(--ac-line-warm); border-radius: 8px; }
.ac-mega::-webkit-scrollbar-track { background: transparent; }
