/**
 * Hutchins Shop — shared brand CSS
 *
 * Defines the SAME :root --hb-* custom properties as the theme's
 * assets/hb-brand.css so the WordPress storefront and the Shopify catalog
 * render identically, plus the shop component styles:
 *   .hb-product-grid · .hb-btn · .hb-variant-select · .hb-cart-drawer
 *
 * Class prefix: hb-  (per the plugin contract).
 */

/* -------------------------------------------------------------------------
 * Brand fonts
 * ---------------------------------------------------------------------- */

/* Self-hosted heading face. Shipped with the plugin so shop pages keep the
 * brand display type even if the theme stylesheet has not loaded. */
@font-face {
	font-family: 'VFC Sulfer Press';
	src: url('fonts/vfc-sulfer-press.woff') format('woff');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* -------------------------------------------------------------------------
 * Brand tokens (MUST mirror theme assets/hb-brand.css)
 * ---------------------------------------------------------------------- */

:root {
	/* Colors */
	--hb-dark: #1d1b1b;
	--hb-red: #d44527;
	--hb-red-hover: #9e351f;
	--hb-white: #ffffff;
	--hb-neutral: #e7eaeb;
	--hb-success: #13612e;
	--hb-alert: #b82105;

	/* Typography */
	--hb-font-body: 'Barlow Condensed', sans-serif;
	--hb-font-heading: 'VFC Sulfer Press', 'Oswald', 'Barlow Condensed', sans-serif;
	--hb-font-size-base: 22px;
	--hb-line-height-base: 1.5;

	/* Buttons */
	--hb-btn-radius: 25px;
	--hb-btn-padding: 10px 24px;

	/* Layout helpers */
	--hb-drawer-width: 400px;
	--hb-gap: 24px;
}

/* -------------------------------------------------------------------------
 * Shop-scoped typographic baseline
 * (scoped to .hb- shop regions so we don't fight the host theme globally)
 * ---------------------------------------------------------------------- */

.hb-product-grid,
.hb-product,
.hb-product-card,
.hb-cart-drawer {
	font-family: var(--hb-font-body);
	font-weight: 400;
	font-size: var(--hb-font-size-base);
	line-height: var(--hb-line-height-base);
	color: var(--hb-dark);
}

.hb-product-grid h1,
.hb-product h1,
.hb-cart-drawer h1,
.hb-product-grid h2,
.hb-product h2,
.hb-cart-drawer h2 {
	font-family: var(--hb-font-heading);
	font-weight: 400;
	text-transform: uppercase;
	margin: 0 0 0.5em;
}

.hb-product-grid h1,
.hb-product h1,
.hb-cart-drawer h1 {
	font-size: 32px;
	line-height: 1.2;
}

.hb-product-grid h2,
.hb-product h2,
.hb-cart-drawer h2 {
	font-size: 28px;
	line-height: 1.2;
}

.hb-product a,
.hb-product-card a,
.hb-cart-drawer a {
	color: inherit;
	text-decoration: none;
}

.hb-product a:hover,
.hb-product-card a:hover,
.hb-cart-drawer a:hover {
	color: var(--hb-red);
}

/* -------------------------------------------------------------------------
 * Buttons (.hb-btn) — pill, red, uppercase, per contract
 * ---------------------------------------------------------------------- */

/* Matches the Kadence global button exactly:
   bg --global-palette-btn-bg (#d44527), radius 25px, pad 10px 24px,
   uppercase, 22px body font, hover shadow + slightly darker bg. */
.hb-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	background: var(--hb-red);
	color: var(--hb-white);
	border: none;
	border-radius: 25px;
	padding: 10px 24px;
	font-family: var(--hb-font-body);
	font-weight: 600;
	font-size: 22px;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: none;
	text-align: center;
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 0 0 -7px rgba(0, 0, 0, 0);
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.hb-btn:hover,
.hb-btn:focus-visible {
	background: var(--hb-red-hover);
	color: var(--hb-white);
	box-shadow: 0 15px 25px -7px rgba(0, 0, 0, 0.1);
}

.hb-btn:disabled,
.hb-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.hb-btn.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

/* -------------------------------------------------------------------------
 * Variant select (.hb-variant-select)
 * ---------------------------------------------------------------------- */

.hb-variant-select {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 8px 12px;
	font-family: var(--hb-font-body);
	font-size: 1rem;
	color: var(--hb-dark);
	background: var(--hb-white);
	border: 2px solid var(--hb-neutral);
	border-radius: 6px;
	cursor: pointer;
}

.hb-variant-select:focus {
	outline: none;
	border-color: var(--hb-red);
}

/* Quantity input shared with cart.js (.hb-qty) */
.hb-qty {
	width: 64px;
	box-sizing: border-box;
	padding: 8px 10px;
	font-family: var(--hb-font-body);
	font-size: 1rem;
	color: var(--hb-dark);
	background: var(--hb-white);
	border: 2px solid var(--hb-neutral);
	border-radius: 6px;
	text-align: center;
}

.hb-qty:focus {
	outline: none;
	border-color: var(--hb-red);
}

/* -------------------------------------------------------------------------
 * Product grid (.hb-product-grid) — responsive cards
 * ---------------------------------------------------------------------- */

.hb-product-grid {
	display: grid;
	/* Honor the block/shortcode "columns" value (set inline as --hb-grid-columns). */
	grid-template-columns: repeat(var(--hb-grid-columns, 4), minmax(0, 1fr));
	gap: var(--hb-gap);
	margin: 0 0 var(--hb-gap);
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.hb-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.hb-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

.hb-product-card {
	display: flex;
	flex-direction: column;
	background: #221f20;
	color: var(--hb-white);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 0;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.hb-product-card:hover {
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	transform: translateY(-2px);
	border-color: rgba(212, 69, 39, 0.5);
}

.hb-product-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	/* Dark "spotlight" so the transparent product art sits on the dark theme
	   (matches the rest of the site) while keeping enough contrast for dark tees. */
	background: radial-gradient( circle at 50% 40%, #4a4442 0%, #232021 70% );
	overflow: hidden;
}

/* contain (not cover) so apparel artwork is never cropped on the light tile */
.hb-product-card__image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 10px;
	box-sizing: border-box;
	display: block;
}

.hb-product-card__image--placeholder {
	display: block;
	width: 100%;
	height: 100%;
}

.hb-product-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	flex: 1 1 auto;
}

.hb-product-card__title {
	font-family: var(--hb-font-heading);
	font-size: 26px;
	line-height: 1.1;
	text-transform: uppercase;
	margin: 0;
	color: var(--hb-red);
}

.hb-product-card__price {
	font-weight: 600;
	color: var(--hb-white);
	opacity: 0.92;
}

/* Inline variant (size) picker on dark cards */
.hb-product-card .hb-variant-select {
	background: #2c2829;
	color: var(--hb-white);
	border-color: rgba(255, 255, 255, 0.18);
}

.hb-product-card .hb-variant-select:focus {
	border-color: var(--hb-red);
}

/* Native option list stays readable on light system menus */
.hb-product-card .hb-variant-select option {
	color: #1d1b1b;
}

.hb-product-card.is-soldout .hb-product-card__media {
	filter: grayscale(0.5);
	opacity: 0.85;
}

.hb-product-card__actions {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* -------------------------------------------------------------------------
 * Cart drawer (.hb-cart-drawer) — fixed right, slide-in, with overlay
 * ---------------------------------------------------------------------- */

.hb-cart-overlay {
	position: fixed;
	inset: 0;
	background: rgba(29, 27, 27, 0.5);
	opacity: 0;
	z-index: 99998;
	transition: opacity 0.3s ease;
}

.hb-cart-overlay.is-open {
	opacity: 1;
}

.hb-cart-overlay[hidden] {
	display: none;
}

.hb-cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: var(--hb-drawer-width);
	max-width: 90vw;
	display: flex;
	flex-direction: column;
	background: var(--hb-dark);
	color: var(--hb-white);
	border-left: 1px solid rgba(255, 255, 255, 0.12);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	z-index: 99999;
	will-change: transform;
}

.hb-cart-drawer.is-open {
	transform: translateX(0);
}

.hb-cart-drawer.is-busy {
	opacity: 0.7;
	pointer-events: none;
}

/* Prevent background scroll while the drawer is open. */
.hb-cart-open {
	overflow: hidden;
}

.hb-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hb-cart-drawer__title {
	font-family: var(--hb-font-heading);
	font-size: 28px;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--hb-white);
	margin: 0;
}

.hb-cart-drawer__close {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.7);
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	transition: color 0.15s ease;
}

.hb-cart-drawer__close:hover {
	color: var(--hb-white);
}

.hb-cart-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px 24px;
}

.hb-cart-drawer__empty {
	color: rgba(255, 255, 255, 0.6);
	text-align: center;
	margin: 32px 0;
}

/* Line items — image left, details right, qty row + remove below */
.hb-cart-item {
	display: grid;
	grid-template-columns: 80px 1fr;
	gap: 0 16px;
	padding: 20px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hb-cart-item__media {
	grid-column: 1;
	grid-row: 1 / 3;
	width: 80px;
	height: 80px;
	background: #2c2829;
	overflow: hidden;
}

.hb-cart-item__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	padding: 4px;
	box-sizing: border-box;
}

.hb-cart-item__details {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.hb-cart-item__title {
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.3;
	color: var(--hb-white);
}

.hb-cart-item__variant {
	font-size: 0.82rem;
	color: rgba(255, 255, 255, 0.55);
}

.hb-cart-item__price {
	font-weight: 600;
	color: var(--hb-white);
	font-size: 0.95rem;
}

/* Qty stepper row sits below the details in col 2 */
.hb-cart-item__qty {
	grid-column: 2;
	grid-row: 2;
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.hb-qty-btn {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.1);
	color: var(--hb-white);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.hb-qty-btn:hover {
	background: var(--hb-red);
	border-color: var(--hb-red);
	color: var(--hb-white);
}

.hb-cart-item__count {
	min-width: 24px;
	text-align: center;
	font-weight: 600;
	color: var(--hb-white);
}

.hb-cart-item__remove {
	align-self: flex-end;
	background: none;
	border: none;
	padding: 0;
	color: rgba(255, 255, 255, 0.45);
	font-family: var(--hb-font-body);
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: color 0.15s ease;
}

.hb-cart-item__remove:hover {
	color: var(--hb-alert);
}

/* Footer — all-dark, matches the drawer */
.hb-cart-drawer__footer {
	flex: 0 0 auto;
	padding: 20px 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hb-cart-drawer__subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 16px;
	font-size: 1rem;
	color: var(--hb-white);
}

.hb-cart-drawer__subtotal-value {
	font-family: var(--hb-font-heading);
	font-size: 1.5rem;
	color: var(--hb-white);
}

.hb-cart-drawer__checkout {
	display: block;
	width: 100%;
}

/* Header cart-count badge (rendered by theme; styled here for consistency) */
[data-hb-cart-count]:empty,
[data-hb-cart-count][data-count='0'] {
	display: none;
}

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */

@media (max-width: 480px) {
	.hb-cart-drawer {
		width: 100vw;
		max-width: 100vw;
	}

	.hb-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}

/* Honor reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.hb-cart-drawer,
	.hb-cart-overlay,
	.hb-product-card,
	.hb-btn {
		transition: none;
	}
}

/* ==========================================================================
   Product slider ([hutchins_slider]) — horizontal carousel of product cards.
   ========================================================================== */
.hb-slider { margin: 2rem 0; }
.hb-slider__header {
  text-align: center;
  margin: 0 0 2rem;
}
.hb-slider__title {
  font-family: var(--hb-font-heading, inherit);
  color: var(--hb-red, #d44527);
  text-transform: uppercase;
  font-size: 40px;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}
.hb-slider__description {
  color: rgba(255, 255, 255, 0.75);
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
}
.hb-slider__viewport { position: relative; }
.hb-slider__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0;
  /* JS overrides left/right padding so the centred card is dead-centre. */
  padding: 22px 16px;
  list-style: none;
}
.hb-slider__track::-webkit-scrollbar { display: none; }
/* Center mode: ~5 cards visible (edges peek). Card width is set by JS
   (--hb-card-w). Side cards recede; the centred card (.is-active) pops. */
/* Uniform cards — no center-mode scaling/dimming. */
.hb-slider__track > li {
  flex: 0 0 auto;
  width: var(--hb-card-w, 260px);
  cursor: pointer;
}
.hb-slider__track > li.is-active {
  cursor: default;
}
@media (prefers-reduced-motion: reduce) {
  .hb-slider__track > li { transition: none; }
}

/* Size pills (rounded). Add to Cart stays hidden until a size is chosen. */
.hb-card-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hb-size {
  min-width: 42px;
  padding: 7px 12px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: transparent;
  color: var(--hb-white);
  font-family: var(--hb-font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.hb-size:hover { border-color: var(--hb-red); }
.hb-size.is-selected {
  background: var(--hb-red);
  border-color: var(--hb-red);
  color: var(--hb-white);
}
.hb-size:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}
/* .hb-btn forces display:inline-block, so make [hidden] win explicitly. */
.hb-btn[hidden] { display: none !important; }
.hb-slider__nav {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--hb-red, #d44527);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s ease, opacity .2s ease;
}
.hb-slider__nav:hover { background: var(--hb-red-hover, #9e351f); }
.hb-slider__nav:disabled { opacity: .35; cursor: default; }
.hb-slider__nav--prev { left: 8px; }
.hb-slider__nav--next { right: 8px; }

/* ==========================================================================
   Floating cart button (site-wide trigger for the cart drawer).
   ========================================================================== */
.hb-cart-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--hb-red, #d44527);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s ease, transform .15s ease;
}
.hb-cart-fab:hover { background: var(--hb-red-hover, #9e351f); transform: translateY(-2px); }
.hb-cart-fab__icon { display: block; }
.hb-cart-fab__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--hb-dark, #1d1b1b);
  color: #fff;
  font: 700 12px/22px sans-serif;
  text-align: center;
}
.hb-cart-fab__count[data-count="0"] { display: none; }

.hb-slider__cta { text-align:center; margin-top:24px; }

/* ==========================================================================
   Inline cart ICON (cart block) — matches the Shopify header bag icon.
   Opens the slide-out drawer (.hb-cart-toggle handled by cart.js).
   ========================================================================== */
.hb-cart-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: var(--hb-white, #fff);
  cursor: pointer;
  line-height: 0;
}
.hb-cart-icon:hover,
.hb-cart-icon:focus-visible { color: var(--hb-red, #d44527); outline: none; }
.hb-cart-icon svg { display: block; width: 28px; height: 28px; }
.hb-cart-icon__count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--hb-red, #d44527);
  color: #fff;
  font: 700 12px/18px sans-serif;
  text-align: center;
}
.hb-cart-icon__count[data-count="0"] { display: none; }

/* ==========================================================================
   Single product page ([hutchins_product] / /shop/{handle}) — dark, 2-column,
   matches the cards (size pills, red pill button, brand heading).
   ========================================================================== */
.hb-shop-single {
  max-width: 1140px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}
.hb-product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  color: var(--hb-white);
}
@media (max-width: 800px) {
  .hb-product { grid-template-columns: 1fr; gap: 28px; }
}
.hb-product__gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient( circle at 50% 38%, #4a4442 0%, #232021 72% );
  padding: 24px;
}
.hb-product__image {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
.hb-product__image--placeholder { aspect-ratio: 1 / 1; background: #2a2627; }
.hb-product__details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hb-product__title {
  font-family: var(--hb-font-heading);
  color: var(--hb-white);
  text-transform: uppercase;
  font-size: 38px;
  line-height: 1.1;
  margin: 0;
}
.hb-product__price {
  font-family: var(--hb-font-heading);
  font-size: 28px;
  color: var(--hb-white);
  margin: 0;
}
.hb-product__qty {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hb-product__qty-label {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--hb-white);
}
.hb-product .hb-btn { align-self: flex-start; min-width: 220px; }
.hb-product__description {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
}
.hb-product__description ul { margin: 0.5em 0 0 1.2em; }
.hb-product__description li { margin: 0.2em 0; }

/* ==========================================================================
   Shop section header + collection filters
   ========================================================================== */
.hb-shop-section { margin: 0 0 40px; }
.hb-shop-header { text-align: center; margin: 0 0 24px; }
.hb-shop-header__title {
  font-family: var(--hb-font-heading);
  color: var(--hb-white);
  text-transform: uppercase;
  font-size: 36px;
  line-height: 1.1;
  margin: 0 0 8px;
}
.hb-shop-header__sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  margin: 0;
}
.hb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 0 28px;
}
.hb-filter {
  padding: 8px 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: transparent;
  color: var(--hb-white);
  font-family: var(--hb-font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.hb-filter:hover { border-color: var(--hb-red); }
.hb-filter.is-active { background: var(--hb-red); border-color: var(--hb-red); }
[data-hb-grid].is-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.15s ease; }
