/* ==========================================================================
   Badd Kitty — storefront (WooCommerce) base layer.

   The Shopify build targets Horizon base classes (product-card, product-grid,
   product-information__grid, product-details, product-media-container, cart …)
   whose BASE layout is not part of the copied CSS — only the brand OVERRIDES are
   (bk-product-page.css, bk-editorial-*.css). This sheet reconstructs that
   missing base so those overrides layer correctly, and styles the parts the
   Shopify sources inlined (dispatch note, free-shipping bar, mini-cart drawer).

   Uses brand.css tokens; neutral greys match the values already used across the
   copied editorial CSS for a faithful port. Loaded on every page (the mini-cart
   drawer is global) via inc/woocommerce.php.
   ========================================================================== */

/* ---- Horizon design-token bridge (so copied CSS custom props resolve) ----- */
:root {
  --font-heading--family: var(--bk-font-heading);
  --font-body--family:    var(--bk-font-body);
  --bk-ink:               var(--bk-plum);
  --gap:                  48px;
  --padding-lg:           1.5rem;
}

/* ==========================================================================
   Collection (archive-product.php)
   ========================================================================== */
.bk-collection .bk-collection-header,
.bk-collection .bk-collection-seo {
  width: 100%;
}

.bk-stock-view {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.bk-stock-view__label { opacity: 0.7; }
.bk-stock-view__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bk-stock-view__link:hover { opacity: 0.7; }

.bk-collection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 0 0 18px;
}
.bk-collection-toolbar .woocommerce-result-count {
  margin: 0;
  color: var(--bk-muted);
  font-size: 13px;
}
.bk-collection-toolbar .woocommerce-ordering { margin: 0; }
.bk-collection-toolbar select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-btn-radius);
  background: #fff;
  color: var(--bk-plum);
  font: inherit;
}

/* Product grid */
ul.products {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
/* WooCommerce ships li.product { width: 22.05%; float:left } for its float layout;
   in our CSS grid that % resolves against the track and shrinks the card. Reset it. */
.woocommerce ul.products li.product,
ul.products li.product,
ul.products li.bk-grid__item {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
}

/* WooCommerce's float-era clearfix (ul.products::before/::after { display:table })
   becomes a stray grid ITEM in our CSS grid, leaving the first (and last) cell
   blank. Remove the pseudo-elements so every cell is a real product card. */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
ul.products::before,
ul.products::after {
  content: none !important;
  display: none !important;
}

@media (max-width: 989px) {
  ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 749px) {
  ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ==========================================================================
   Product card base (content-product.php — Horizon `product-card`)
   ========================================================================== */
.product-card {
  position: relative;
  display: block;
  min-width: 0;
}
.product-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.product-card__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-media-container {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f2f1f1;
}
.product-media-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.product-card__title {
  margin: 4px 0 0;
  font-family: var(--bk-font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--bk-plum);
}
.product-card__price,
.product-card product-price {
  display: flex;
  gap: 7px;
  align-items: baseline;
  font-family: var(--bk-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--bk-plum);
}
.product-card__price del,
.product-card product-price del { color: #837c80; font-weight: 400; }
.product-card__price ins,
.product-card product-price ins { text-decoration: none; }

/* ==========================================================================
   Editorial rail quick-add (template-parts/product-rail.php)
   Rail + card layout live in bk-editorial-home.css; this adds the pill only.
   ========================================================================== */
.bk-product-card__media .quick-add {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
}
.quick-add__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--bk-plum);
  color: #fff;
  font-family: var(--bk-font-heading);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  box-shadow: 0 2px 10px rgb(0 0 0 / 15%);
}
.quick-add__button:hover,
.quick-add__button:focus-visible { background: #2a0f3d; color: #fff; }

/* ==========================================================================
   Single product (single-product.php + template-parts/product/*)
   ========================================================================== */
.bk-product-page { margin-block: 24px 8px; }

.product-information__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap, 48px);
  align-items: start;
  margin-block: 12px 40px;
}
@media (max-width: 749px) {
  .product-information__grid { grid-template-columns: 1fr; gap: 24px; }
}

.product-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* Gallery */
.bk-product-gallery { position: relative; }
.bk-product-gallery .onsale { position: absolute; z-index: 5; top: 12px; left: 12px; }
.woocommerce-product-gallery { margin: 0; }
.woocommerce-product-gallery__wrapper { margin: 0; }
.woocommerce-product-gallery__image,
.woocommerce-product-gallery__image--placeholder { margin: 0; background: #f2f1f1; }
.woocommerce-product-gallery__image img { width: 100%; height: auto; display: block; }
.woocommerce-product-gallery .flex-control-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.woocommerce-product-gallery .flex-control-thumbs li { margin: 0; }
.woocommerce-product-gallery .flex-control-thumbs img { width: 100%; height: auto; cursor: pointer; opacity: 0.7; }
.woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.woocommerce-product-gallery .flex-control-thumbs img:hover { opacity: 1; }

/* Ecwid hotlink gallery is a scroll-snap carousel; layout lives in bk-chrome.css. */
.bk-ecwid-gallery { display: block; }

/* Details column */
.bk-pdp-vendor {
  margin: 0 0 6px;
  color: var(--bk-rose);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bk-pdp-header { display: flex; flex-direction: column; gap: 6px; }
.bk-pdp-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}
.bk-pdp-price {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--bk-plum);
}
.bk-pdp-price del { color: #837c80; font-weight: 400; margin-right: 8px; }
.bk-pdp-price ins { text-decoration: none; }
.bk-divider { border: 0; border-top: 1px solid var(--bk-border); margin: 4px 0; }

/* Buy area (native WooCommerce add-to-cart form) */
.bk-pdp-form .quantity { display: inline-flex; margin-right: 12px; }
.bk-pdp-form .quantity input.qty {
  min-height: 44px;
  width: 76px;
  padding: 0 8px;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-btn-radius);
  text-align: center;
  font: inherit;
}
.bk-pdp-form table.variations {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
}
.bk-pdp-form table.variations th,
.bk-pdp-form table.variations td { padding: 6px 0; text-align: left; vertical-align: middle; }
.bk-pdp-form table.variations label { font-weight: 600; color: var(--bk-plum); }
.bk-pdp-form table.variations select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-btn-radius);
  font: inherit;
  background: #fff;
}
.bk-pdp-form .reset_variations { display: inline-block; margin-left: 8px; font-size: 12px; }
.bk-pdp-form .woocommerce-variation-add-to-cart {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bk-pdp-form .woocommerce-variation-price { margin-bottom: 8px; font-weight: 600; color: var(--bk-plum); }

/* Dispatch note (Shopify bk-product-trust inline styles) */
.bk-product-dispatch {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  color: #2e6b3f;
  font-size: 12.5px;
  font-weight: 600;
}
.bk-product-dispatch__dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #3d9159;
}

/* Shipping / returns accordion */
.bk-product-accordion { margin-top: 4px; border-top: 1px solid var(--bk-border); }
.bk-product-accordion__row { border-bottom: 1px solid var(--bk-border); }
.bk-product-accordion__row summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  cursor: pointer;
  color: var(--bk-plum);
  font-family: var(--bk-font-heading);
  font-weight: 700;
  font-size: 14px;
  list-style: none;
}
.bk-product-accordion__row summary::-webkit-details-marker { display: none; }
.bk-product-accordion__row p { margin: 0 0 16px; color: var(--bk-muted); font-size: 14px; line-height: 1.6; }

/* ==========================================================================
   Cart page (woocommerce/cart/cart.php) — supplements WooCommerce base CSS
   ========================================================================== */
.bk-cart-page { margin-block: 24px 56px; }
.bk-cart-page__title { margin: 0 0 12px; }
.bk-cart-page table.cart { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.bk-cart-page table.cart th {
  padding: 12px 10px;
  border-bottom: 2px solid var(--bk-border);
  text-align: left;
  font-family: var(--bk-font-heading);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bk-muted);
}
.bk-cart-page table.cart td { padding: 16px 10px; border-bottom: 1px solid var(--bk-border); vertical-align: middle; }
.bk-cart-page .product-thumbnail img { width: 72px; height: 72px; object-fit: contain; background: #f2f1f1; }
.bk-cart-page td.actions { padding-top: 20px; }
.bk-cart-page .coupon { display: inline-flex; gap: 8px; margin-right: 12px; }
.bk-cart-page .coupon input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-btn-radius);
  font: inherit;
}
.cart-collaterals .cart_totals { max-width: 420px; margin-left: auto; }
.cart-collaterals .cart_totals table { width: 100%; border-collapse: collapse; }
.cart-collaterals .cart_totals th,
.cart-collaterals .cart_totals td { padding: 10px 0; border-bottom: 1px solid var(--bk-border); text-align: left; }
.wc-proceed-to-checkout { margin-top: 16px; }
.wc-proceed-to-checkout .checkout-button { width: 100%; }

/* ==========================================================================
   Free-shipping bar (cart-free-shipping.liquid, ported verbatim)
   ========================================================================== */
.bk-ship { padding: 14px 20px 6px; }
.bk-ship--page { max-width: 520px; padding: 0 0 22px; }
.bk-ship-msg { margin: 0 0 8px; font-size: 14px; color: #3a2b42; }
.bk-ship-msg strong { color: var(--bk-rose); }
.bk-ship-track { height: 6px; border-radius: 999px; background: #efe7f1; overflow: hidden; }
.bk-ship-fill { display: block; height: 100%; background: var(--bk-rose); border-radius: 999px; transition: width 0.3s ease; }
.bk-ship-note { margin: 8px 0 0; font-size: 12px; color: #76677d; }

/* ==========================================================================
   Mini-cart drawer (cart-drawer.liquid) + header cart count
   ========================================================================== */
.bk-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bk-rose);
  color: #fff;
  font-family: var(--bk-font-heading);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.bk-mini-cart { position: fixed; inset: 0; z-index: 1000; }
.bk-mini-cart[hidden] { display: none; }
.bk-mini-cart__overlay {
  position: absolute;
  inset: 0;
  background: rgb(26 6 40 / 45%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.bk-mini-cart.is-open .bk-mini-cart__overlay { opacity: 1; }
.bk-mini-cart__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(430px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--bk-bg);
  box-shadow: -8px 0 40px rgb(0 0 0 / 18%);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.bk-mini-cart.is-open .bk-mini-cart__panel { transform: none; }
.bk-mini-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--bk-border);
}
.bk-mini-cart__title { margin: 0; font-size: 18px; }
.bk-mini-cart__close {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bk-plum);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.bk-mini-cart__inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.bk-mini-cart--empty { justify-content: center; }
.bk-mini-cart__items {
  list-style: none;
  margin: 0;
  padding: 0 20px;
  overflow-y: auto;
  flex: 1;
}
.bk-mini-cart__item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--bk-border);
}
.bk-mini-cart__item-media { display: block; }
.bk-mini-cart__img,
.bk-mini-cart__item-media img { width: 64px; height: 64px; object-fit: contain; background: #f2f1f1; }
.bk-mini-cart__item-title {
  color: var(--bk-plum);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}
.bk-mini-cart__item-title:hover { color: var(--bk-rose); }
.bk-mini-cart__item-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--bk-muted);
  font-size: 13px;
}
.bk-mini-cart__remove {
  min-width: 32px;
  color: #837c80;
  font-size: 20px;
  line-height: 1;
  text-align: right;
  text-decoration: none;
}
.bk-mini-cart__remove:hover { color: var(--bk-rose); }
.bk-mini-cart__footer {
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--bk-border);
  background: var(--bk-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bk-mini-cart__subtotal { display: flex; justify-content: space-between; font-weight: 600; color: var(--bk-plum); }
.bk-mini-cart__view,
.bk-mini-cart__checkout { width: 100%; }
.bk-mini-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
  padding: 48px 20px;
  text-align: center;
}
.bk-mini-cart__empty-title { margin: 0; color: var(--bk-muted); }

html.bk-cart-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .bk-mini-cart__panel,
  .bk-mini-cart__overlay,
  .bk-ship-fill { transition: none; }
}

/* ==========================================================================
   Filter bar (WooCommerce layout spec §3) — horizontal, pill-based, URL-driven
   facets. Tokens only (brand.css); no hard-coded palette.
   ========================================================================== */
.bk-filter-bar { margin: 0 0 20px; }

.bk-filter-bar__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bk-filter-bar__pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.bk-filter-bar__mobile-toggle { display: none; }

.bk-facet { position: relative; }

.bk-facet__toggle,
.bk-filter-onsale,
.bk-filter-sort__select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--bk-line);
  border-radius: 999px;
  background: #fff;
  color: var(--bk-plum);
  font: inherit;
  font-size: .9rem;
  font-weight: var(--bk-fw-sub, 500);
  line-height: 1;
  cursor: pointer;
}

.bk-facet__toggle[aria-expanded="true"] { border-color: var(--bk-fuchsia); }

.bk-facet__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bk-fuchsia);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.bk-facet__chevron { transition: transform .15s ease; }
.bk-facet__toggle[aria-expanded="true"] .bk-facet__chevron { transform: rotate(180deg); }

.bk-facet__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  border: 1px solid var(--bk-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgb(0 0 0 / 12%);
}
.bk-facet--range .bk-facet__panel { width: 300px; }

.bk-facet__search {
  width: 100%;
  margin: 0 0 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--bk-line);
  border-radius: 8px;
  font: inherit;
  font-size: .9rem;
}

.bk-facet__opts {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow: auto;
}
.bk-facet__opt > label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  color: var(--bk-plum);
  font-size: .9rem;
  cursor: pointer;
}
.bk-facet__opt input { margin: 0; accent-color: var(--bk-fuchsia); }
.bk-facet__opt-label { flex: 1; min-width: 0; }
.bk-facet__opt-count { color: var(--bk-muted); font-size: .8rem; }
.bk-facet__opt[hidden] { display: none; }

.bk-filter-onsale { gap: 8px; }
.bk-filter-onsale input { margin: 0; accent-color: var(--bk-fuchsia); }
.bk-filter-onsale:has(input:checked) { border-color: var(--bk-fuchsia); background: var(--bk-cream); }

.bk-filter-bar__sort { margin-left: auto; }
.bk-filter-sort__select {
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231a0628' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* Range slider (dual thumb over a shared track) */
.bk-range__readout {
  margin-bottom: 12px;
  color: var(--bk-plum);
  font-size: .9rem;
  font-weight: 600;
}
.bk-range__track { position: relative; height: 28px; }
.bk-range__track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 999px;
  background: var(--bk-line);
}
.bk-range__input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
}
.bk-range__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bk-fuchsia);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
  cursor: pointer;
}
.bk-range__input::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bk-fuchsia);
  border: 2px solid #fff;
  cursor: pointer;
}

/* Active-filter chips */
.bk-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.bk-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bk-cream);
  color: var(--bk-plum);
  font-size: .82rem;
  text-decoration: none;
}
.bk-filter-chip__x { display: inline-flex; color: var(--bk-rose); }
.bk-filter-chips__clear {
  color: var(--bk-rose);
  font-size: .82rem;
  text-decoration: underline;
}

/* Mobile (spec: pills collapse behind the Filters toggle; panels render inline) */
@media (max-width: 749px) {
  .bk-filter-bar__mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--bk-line);
    border-radius: 999px;
    background: #fff;
    color: var(--bk-plum);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }
  .bk-filter-bar__pills {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .bk-filter-bar[data-open] .bk-filter-bar__pills { display: flex; }
  .bk-facet,
  .bk-filter-onsale { width: 100%; }
  .bk-facet__toggle { width: 100%; justify-content: space-between; }
  .bk-facet__panel {
    position: static;
    width: 100%;
    max-width: none;
    border: 0;
    box-shadow: none;
    padding: 8px 0 0;
  }
  .bk-facet--range .bk-facet__panel { width: 100%; }
  .bk-filter-bar__sort { margin-left: 0; width: 100%; }
  .bk-filter-sort__select { width: 100%; }
}

/* ==========================================================================
   My Account (WooCommerce layout spec §5) — auth card + dashboard hub grid.
   Tokens only; scoped to body.bk-account / body.bk-account-auth.
   ========================================================================== */

/* ---- 5b. Logged-in dashboard: 240px / 1fr grid --------------------------- */
body.bk-account .woocommerce {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px 40px;
  align-items: start;
}

body.bk-account .bk-account__header { grid-column: 1 / -1; }
body.bk-account .woocommerce-MyAccount-navigation { grid-column: 1; }
body.bk-account .woocommerce-MyAccount-content { grid-column: 2; min-width: 0; }

/* WooCommerce's layout stylesheet floats these and sets width:30%/70%, which
   overrides the grid's stretch and collapses both columns. Let the grid size
   them instead. */
body.bk-account .woocommerce-MyAccount-navigation,
body.bk-account .woocommerce-MyAccount-content {
  width: auto;
  float: none;
}

/* Account header card */
.bk-account__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--bk-line);
  border-radius: 14px;
  background: var(--bk-cream);
}
.bk-account__avatar img {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}
.bk-account__id { flex: 1; min-width: 0; }
.bk-account__hello {
  margin: 0;
  color: var(--bk-plum);
  font-family: var(--bk-font-heading);
  font-weight: 700;
  font-size: 1.05rem;
}
.bk-account__badge {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bk-fuchsia);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.bk-account__edit {
  color: var(--bk-rose);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.bk-account__edit:hover { text-decoration: underline; }

/* Sidebar icon nav */
.bk-account-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bk-account-nav .woocommerce-MyAccount-navigation-link { margin: 0; }
.bk-account-nav .woocommerce-MyAccount-navigation-link a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--bk-plum);
  text-decoration: none;
}
.bk-account-nav .woocommerce-MyAccount-navigation-link a:hover { background: var(--bk-cream); }
.bk-account-nav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--bk-cream);
  color: var(--bk-plum);
}
.bk-account-nav__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.bk-account-nav__label { font-weight: 600; font-size: .95rem; }
.bk-account-nav__desc { color: var(--bk-muted); font-size: .78rem; }
/* Chevron is a mobile affordance (spec); the desktop sidebar doesn't need it,
   and the mobile view swaps this nav for the hub tiles — so hide it. */
.bk-account-nav__chevron { display: none; }
.bk-account-nav .woocommerce-MyAccount-navigation-link.is-active a {
  background: var(--bk-cream);
  border-color: var(--bk-fuchsia);
  color: var(--bk-plum);
}
.bk-account-nav .is-active .bk-account-nav__icon { background: var(--bk-fuchsia); color: #fff; }
.bk-account-nav .woocommerce-MyAccount-navigation-link--customer-logout a { color: var(--bk-rose); }

/* Boxed endpoint content */
body.bk-account .woocommerce-MyAccount-content {
  padding: 24px;
  border: 1px solid var(--bk-line);
  border-radius: 12px;
  background: #fff;
}

/* Mobile back link (hidden on desktop; shown on sub-endpoints ≤860) */
.bk-account__back {
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--bk-rose);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}

/* ---- Dashboard hub ------------------------------------------------------- */
.bk-hub { display: grid; gap: 20px; }

/* WooCommerce/theme content-list styles (li margin + ul padding + list-item
   display) leak onto the hub lists and knock the tiles out of alignment — the
   2nd/3rd tiles pick up a margin-top and shrink within their grid row. Reset
   them with body-scoped specificity so the tiles stretch to equal height. */
body.bk-account .bk-hub__tiles,
body.bk-account .bk-hub__orders ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
body.bk-account .bk-hub__tile,
body.bk-account .bk-hub__orders li {
  margin: 0;
  padding: 0;
  list-style: none;
}
body.bk-account .bk-hub__tile { display: block; }
.bk-hub__tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.bk-hub__tile > a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  box-sizing: border-box;
  padding: 16px;
  border: 1px solid var(--bk-line);
  border-radius: 14px;
  background: #fff;
  color: var(--bk-plum);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.bk-hub__tile > a:hover { border-color: var(--bk-fuchsia); background: var(--bk-cream); }
.bk-hub__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bk-cream);
  color: var(--bk-plum);
}
.bk-hub__label { font-weight: 700; font-size: .98rem; }
.bk-hub__desc { color: var(--bk-muted); font-size: .82rem; }

.bk-hub__orders-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.bk-hub__orders-head h3 { margin: 0; font-family: var(--bk-font-heading); font-size: 1rem; color: var(--bk-plum); }
.bk-hub__orders-head a { color: var(--bk-rose); font-size: .82rem; font-weight: 600; text-decoration: none; }
.bk-hub__orders ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bk-hub__orders li > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--bk-line);
  border-radius: 12px;
  color: var(--bk-plum);
  text-decoration: none;
}
.bk-hub__orders li > a:hover { background: var(--bk-cream); }
.bk-hub__order-no { font-weight: 700; }
.bk-hub__order-meta { flex: 1; color: var(--bk-muted); font-size: .85rem; }
.bk-hub__order-chevron { color: var(--bk-muted); opacity: .6; }

/* ---- 5a. Logged-out auth card ------------------------------------------- */
body.bk-account-auth .woocommerce {
  max-width: 460px;
  margin-inline: auto;
}
body.bk-account-auth .woocommerce > h2 { text-align: center; }
body.bk-account-auth .woocommerce-form-login,
body.bk-account-auth .woocommerce-form-register {
  padding: 24px;
  border: 1px solid var(--bk-line);
  border-radius: 14px;
  background: #fff;
}
body.bk-account-auth .woocommerce-form-row { width: 100%; float: none; }
body.bk-account-auth .woocommerce-form input.input-text,
body.bk-account-auth .woocommerce-form-login__submit,
body.bk-account-auth .woocommerce-form-register__submit { width: 100%; }

/* ---- Mobile (≤860): app hub pattern ------------------------------------- */
@media (max-width: 860px) {
  body.bk-account .woocommerce { grid-template-columns: 1fr; gap: 16px; }
  body.bk-account .woocommerce-MyAccount-navigation { grid-column: 1; }
  body.bk-account .woocommerce-MyAccount-content { grid-column: 1; }

  /* The sidebar nav is replaced by the hub tiles (dashboard) + the back link. */
  body.bk-account .bk-account-nav { display: none; }
  body.bk-account-endpoint .bk-account__back { display: inline-flex; }

  /* Unbox the content on mobile so the hub reads as native app rows. */
  body.bk-account .woocommerce-MyAccount-content { padding: 0; border: 0; background: transparent; }

  /* Tiles become full-width list rows. */
  .bk-hub__tiles { grid-template-columns: 1fr; }
  .bk-hub__tile > a {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }
  .bk-hub__tile .bk-hub__label { flex: 1; }
  .bk-hub__tile .bk-hub__desc { display: none; }
}
