/* Badger & Brown — design layer
   Everything here mirrors a decision made in the prototype. Tokens live in
   theme.json; this file carries the things theme.json cannot express:
   breakpointed column counts, the brushed-metal treatment, and the card and
   mega-menu compositions. */

:root {
  --bb-gold: #8c6410;
  --bb-gold-top: #8f6816;
  --bb-gold-foot: #70500d;
  --bb-gold-ivory: #fdf7e4;
  --bb-ink: #17130f;
  --bb-ivory: #f7f2e8;
  --bb-parchment: #efe7d8;
  --bb-rule: #d8cdb6;
  --bb-gutter: clamp(24px, 5vw, 80px);

  /* Polished metal: a bright top edge and a dark foot. The field behind text
     is untouched, so ivory keeps its 4.7:1 contrast. */
  --bb-field: linear-gradient(177deg, var(--bb-gold-top) 0%, var(--bb-gold) 42%, var(--bb-gold-foot) 100%);
  --bb-sheen: inset 0 2px 0 rgba(255, 232, 158, 0.62), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
  --bb-sheen-hover: inset 0 2px 0 rgba(255, 246, 212, 0.92), inset 0 -2px 0 rgba(0, 0, 0, 0.34),
                    0 7px 20px -9px rgba(23, 19, 15, 0.55);
}

/* ---- Metal buttons -------------------------------------------------------
   Hover sharpens the edge and lifts the button. It must NOT change the
   colour — that was an explicit call. */
.wp-element-button,
.wp-block-button__link,
.bb-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  background: var(--bb-field) !important;
  color: var(--bb-gold-ivory) !important;
  border: 0;
  border-radius: 0;
  box-shadow: var(--bb-sheen);
  padding: 17px 38px;
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 500;
  transition: box-shadow 0.22s ease;
}
.wp-element-button:hover,
.wp-block-button__link:hover,
.bb-button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
  box-shadow: var(--bb-sheen-hover);
}

/* Secondary: ink outline, parchment fill on hover. */
.bb-button--ghost {
  background: none !important;
  color: var(--bb-ink) !important;
  border: 2px solid var(--bb-ink);
  box-shadow: none;
  padding: 13px 30px;
}
.bb-button--ghost:hover { background: #e5d9c2 !important; box-shadow: none; }

/* ---- Product grids: 6 / 4 / 2, never 3 or 5 ----------------------------- */
.bb-grid,
.woocommerce ul.products,
.wp-block-woocommerce-product-template {
  display: grid !important;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 760px) {
  .bb-grid,
  .woocommerce ul.products,
  .wp-block-woocommerce-product-template {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
@media (min-width: 1500px) {
  .bb-grid,
  .woocommerce ul.products,
  .wp-block-woocommerce-product-template {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}
.woocommerce ul.products li.product { width: auto; margin: 0; float: none; }

/* ---- Product card -------------------------------------------------------
   Image edge to edge, hard ink rule, then a fixed-height band holding the
   title full width with the price beneath. The fixed height is what stops a
   long name changing the card. */
.bb-card,
.woocommerce ul.products li.product,
.wc-block-product {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bb-parchment);
  text-align: left;
}
.bb-card__media,
.woocommerce ul.products li.product a img,
.wc-block-product .wc-block-components-product-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bb-card:hover .bb-card__media,
.woocommerce ul.products li.product:hover a img,
.wc-block-product:hover .wc-block-components-product-image img {
  transform: scale(1.06);
}
.bb-card__body,
.woocommerce ul.products li.product .bb-card__body {
  background: var(--bb-ivory);
  border-top: 2px solid var(--bb-ink);
  margin-top: auto;
  padding: 14px 18px;
  min-height: 88px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.bb-card__title,
.woocommerce ul.products li.product h2.woocommerce-loop-product__title {
  font-size: 1rem;
  line-height: 1.22;
  text-wrap: pretty;
  margin: 0;
  padding: 0;
}
.bb-card__price,
.woocommerce ul.products li.product .price {
  font-size: 0.84375rem;
  color: var(--bb-gold);
  letter-spacing: 0.04em;
  margin: 0;
}
.bb-card__action { background: var(--bb-ivory); padding: 0 18px 16px; }
.bb-card__action > a { display: block; text-align: center; padding: 12px 0; font-size: 0.625rem; letter-spacing: 0.22em; }

/* WooCommerce puts the add-to-cart link inline; give it the card's footer. */
.woocommerce ul.products li.product a.button {
  display: block;
  width: calc(100% - 36px);
  margin: 0 18px 16px;
  text-align: center;
  padding: 12px 0;
  font-size: 0.625rem;
  letter-spacing: 0.22em;
}
.woocommerce ul.products li.product .onsale { display: none; }

/* ---- Section heads: rule under, no eyebrow ------------------------------ */
.bb-sectionhead {
  border-bottom: 2px solid var(--bb-ink);
  padding-bottom: 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.bb-sectionhead h2 { margin: 0; line-height: 1.03; }

/* ---- Mega menu ---------------------------------------------------------
   Full width, single row. Long lists wrap into a second column rather than
   clipping. Promo imagery only where there is room for it on the line. */
.bb-mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  width: 100%;
  background: #fff;
  border-top: 1px solid #ece8df;
  border-bottom: 2px solid var(--bb-ink);
  box-shadow: 0 22px 36px -20px rgba(0, 0, 0, 0.3);
  z-index: 50;
}
.bb-mega__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: clamp(18px, 3.2vw, 56px);
  padding: clamp(30px, 3vw, 44px) var(--bb-gutter) clamp(52px, 5vw, 76px);
  box-sizing: border-box;
}
.bb-mega__col { min-width: 0; flex: 1 1 auto; }
.bb-mega__col > .bb-mega__title {
  font-size: 0.65625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bb-gold);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #ece8df;
}
.bb-mega__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  max-height: 320px;
  column-gap: 30px;
}
.bb-mega__col li { padding: 4.5px 0; }
.bb-mega__col a { font-size: 0.8125rem; line-height: 1.45; color: #3a352c; transition: color 0.15s ease; }
.bb-mega__col a:hover { color: var(--bb-ink); }
.bb-mega__promo { display: none; flex: 0 0 auto; gap: 2px; }
@media (min-width: 1400px) { .bb-mega__promo { display: flex; } }

/* ---- Header utilities: equal 44px targets on one centre line ------------ */
.bb-utils { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bb-utils > a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  position: relative;
  transition: background 0.18s ease;
}
.bb-utils > a:hover { background: var(--bb-parchment); }
.bb-utils svg { width: 24px; height: 24px; }
.bb-utils__count {
  position: absolute;
  top: 4px;
  right: 3px;
  background: var(--bb-gold);
  color: var(--bb-gold-ivory);
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65625rem;
  font-weight: 700;
}

/* ---- Category page: image left, title and copy right ------------------- */
.bb-catsplit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  align-items: stretch;
  margin-bottom: 34px;
}
.bb-catsplit__media {
  position: relative;
  background: var(--bb-parchment);
  min-height: clamp(320px, 38vw, 520px);
  overflow: hidden;
}
.bb-catsplit__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bb-catsplit__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: clamp(40px, 4.4vw, 64px) clamp(28px, 4vw, 60px);
  background: var(--bb-ivory);
}
.bb-catsplit__copy .bb-rule-short { width: 64px; height: 3px; background: var(--bb-gold); }

/* ---- Filter chips ------------------------------------------------------- */
.bb-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 var(--bb-gutter) 30px; }
.bb-chips a {
  border: 1.5px solid var(--bb-rule);
  background: #fff;
  color: #555;
  padding: 9px 17px;
  font-size: 0.65625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all 0.15s ease;
}
.bb-chips a:hover { border-color: var(--bb-ink); color: var(--bb-ink); }
.bb-chips a[aria-current], .bb-chips .current-cat a {
  background: var(--bb-gold);
  border-color: var(--bb-gold);
  color: var(--bb-gold-ivory);
}

/* ---- Product page ------------------------------------------------------ */
.bb-pdp { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.bb-pdp__gallery { background: var(--bb-parchment); display: flex; flex-direction: column; border: 2px solid var(--bb-gold); }
.bb-pdp__gallery > img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.bb-pdp__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--bb-gold); }
.bb-pdp__thumbs a { display: block; position: relative; background: var(--bb-parchment); outline: 2px solid transparent; outline-offset: -2px; }
.bb-pdp__thumbs a[aria-current] { outline-color: var(--bb-ink); }
.bb-pdp__thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.bb-pdp__buy { display: flex; flex-direction: column; gap: 20px; padding: clamp(32px, 3.4vw, 56px) clamp(28px, 3.4vw, 60px) 80px; }
.bb-pdp__price { font-size: 2rem; color: var(--bb-gold); line-height: 1; }
.bb-optlabel { font-size: 0.625rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--bb-gold); }

/* Option tiles and swatches. */
.bb-opt { border: 2px solid var(--bb-rule); background: #fff; padding: 10px 14px; transition: border-color 0.18s ease; }
.bb-opt:hover { border-color: var(--bb-ink); }
.bb-opt[aria-pressed="true"], .bb-opt.is-selected { border-color: var(--bb-ink); background: var(--bb-parchment); }

/* ---- Detail accordion under add-to-bag -------------------------------- */
.bb-accordion { border-top: 2px solid var(--bb-ink); margin-top: 20px; }
.bb-accordion__item { border-bottom: 1px solid var(--bb-rule); }
.bb-accordion__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 2px;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
}
.bb-accordion__item[open] .bb-accordion__head { color: var(--bb-gold); }
.bb-accordion__body { padding: 0 2px 22px; display: flex; flex-direction: column; gap: 12px; }
.bb-accordion__body p { margin: 0; font-size: 0.84375rem; line-height: 1.75; color: #4a4438; max-width: 60ch; }
.bb-specs { display: grid; grid-template-columns: auto 1fr; gap: 9px 22px; margin-top: 4px; }
.bb-specs dt { font-size: 0.65625rem; letter-spacing: 0.16em; text-transform: uppercase; color: #8a8172; }
.bb-specs dd { margin: 0; font-size: 0.84375rem; color: #3a352c; }

/* ---- Hero carousel ----------------------------------------------------- */
.bb-hero { position: relative; overflow: hidden; height: min(72vh, 680px); }
.bb-hero__layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.9s ease; }
.bb-hero__layer.is-active { opacity: 1; }
.bb-hero__scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,10,6,0.76) 0%, rgba(14,10,6,0.38) 48%, rgba(14,10,6,0.06) 78%); }
.bb-hero__copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 0 7%;
  width: 50%;
  max-width: 50%;
  color: #fff;
}
.bb-hero__bars { position: absolute; left: 7%; bottom: 34px; display: flex; gap: 10px; }
.bb-hero__bars a { width: 34px; height: 3px; background: rgba(253,247,228,0.34); transition: background 0.3s ease; }
.bb-hero__bars a[aria-current] { background: #fdf7e4; }
.bb-hero__arrows { position: absolute; right: 7%; bottom: 30px; display: flex; }
.bb-hero__arrows a { width: 46px; height: 46px; border: 1px solid rgba(255,255,255,0.5); display: flex; align-items: center; justify-content: center; transition: background 0.2s ease; }
.bb-hero__arrows a + a { border-left: 0; }
.bb-hero__arrows a:hover { background: rgba(255,255,255,0.14); }

/* ---- Checkout ---------------------------------------------------------- */
.bb-checkout { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: clamp(32px, 4vw, 64px); align-items: start; }
.bb-checkout h2, .woocommerce-checkout h3 { font-weight: 400; font-size: 1.5rem; margin: 0; padding-bottom: 12px; border-bottom: 2px solid var(--bb-ink); }
.bb-checkout input[type="text"],
.bb-checkout input[type="email"],
.bb-checkout input[type="tel"],
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
  border: 1.5px solid #cfc6b4;
  border-radius: 0;
  background: #fff;
  padding: 13px 14px;
  font-size: 0.90625rem;
  width: 100%;
  box-sizing: border-box;
}
.bb-checkout input:focus, .woocommerce form .form-row input.input-text:focus { outline: none; border-color: var(--bb-ink); }
.woocommerce form .form-row label,
.bb-checkout label > span {
  font-size: 0.65625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6b6355;
}
.bb-summary { background: var(--bb-parchment); border: 2px solid var(--bb-ink); padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.bb-summary__total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--bb-ink); padding-top: 16px; }
.bb-summary__total b { font-size: 1.875rem; color: var(--bb-gold); font-weight: 400; line-height: 1; }
.woocommerce-checkout #payment { background: none; border-radius: 0; }

/* ---- Breadcrumbs ------------------------------------------------------- */
.bb-crumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px var(--bb-gutter) 16px;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a39b8b;
}
.bb-crumbs a { color: #a39b8b; }
.bb-crumbs a:hover { color: var(--bb-ink); }
.bb-crumbs [aria-current] { color: #6b6355; }

/* ---- Full-bleed bands -------------------------------------------------- */
.bb-band { padding: clamp(44px, 4.6vw, 68px) var(--bb-gutter) clamp(48px, 5vw, 76px); }
.bb-band--gold { background: var(--bb-field); color: var(--bb-gold-ivory); box-shadow: var(--bb-sheen); }
.bb-band--gold a { color: var(--bb-gold-ivory); }
.bb-band--parchment { background: var(--bb-parchment); border-top: 2px solid var(--bb-ink); }
.bb-band--ivory { background: var(--bb-ivory); border-top: 2px solid var(--bb-ink); }

/* Long-form copy keeps a measure even when its section runs full width. */
.bb-measure { max-width: 72ch; }
.bb-measure--tight { max-width: 54ch; }
