/*
Theme Name: Herikraft
Theme URI: https://herikraft.org
Author: Herikraft
Author URI: https://herikraft.org
Description: A focused, handcrafted storefront for Chinese cultural products — pottery, silk, tea and folk art. Rebuilt clean in v2.4.
Version: 2.4.0
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: herikraft
WC requires at least: 8.0
WC tested up to: 10.9
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --olive: #444e30;
  --olive-hover: #5c6646;
  --olive-deep: #333b24;
  --paper: #f5f2eb;
  --ivory: #fef9ec;
  --cream: #f8f3e6;
  --ink: #2c2c2c;
  --deep-ink: #1d1c14;
  --soft-text: #5a5c50;
  --border: #ddd8cc;
  --border-strong: #c6c7bb;
  --terracotta: #b5623c;
  --sale: #b5623c;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --fs-h1: clamp(2.5rem, 3.5vw + 1rem, 4rem);
  --fs-h2: clamp(1.9rem, 2vw + 0.9rem, 2.85rem);
  --fs-h3: clamp(1.35rem, 1vw + 0.8rem, 1.75rem);
  --fs-h4: 1.2rem;
  --fs-body-lg: clamp(1.1rem, 0.4vw + 0.95rem, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.95rem;
  --fs-xs: 0.82rem;

  --container-max: 1280px;
  --container-narrow: 860px;
  --header-h: 74px;

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 10px rgba(45, 42, 33, 0.06);
  --shadow-md: 0 14px 40px rgba(45, 42, 33, 0.12);
  --speed: 300ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--speed); }
a:hover { color: var(--olive); }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select, button { font-family: inherit; font-size: 1rem; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--olive); color: #fff; padding: 10px 18px;
}
.skip-link:focus { left: 12px; top: 12px; color: #fff; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--deep-ink);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: 600; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 0.9rem;
}
.eyebrow--light { color: rgba(255, 255, 255, 0.85); }
.lead { font-size: var(--fs-body-lg); color: var(--soft-text); line-height: 1.55; }
.lead--light { color: rgba(255, 255, 255, 0.85); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.container--narrow { max-width: var(--container-narrow); }
.site-main { min-height: 50vh; }
.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.scheme-paper { background: var(--paper); }
.scheme-cream { background: var(--cream); }
.scheme-ivory { background: var(--ivory); }
.scheme-olive { background: var(--olive); color: var(--ivory); }
.scheme-olive h1, .scheme-olive h2, .scheme-olive h3, .scheme-olive h4 { color: var(--ivory); }

.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head--row {
  max-width: none; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.section-head h2 { margin-bottom: 0.4rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.85em 1.9em; line-height: 1.2;
  font-size: var(--fs-small); font-weight: 500; letter-spacing: 0.02em;
  border-radius: var(--radius-sm); border: 1px solid var(--olive);
  background: var(--olive); color: var(--ivory);
  cursor: pointer; transition: all var(--speed) var(--ease); text-align: center;
}
.btn:hover { background: var(--olive-hover); border-color: var(--olive-hover); color: var(--ivory); }
.btn--fill { background: var(--olive); color: var(--ivory); }
.btn--outline { background: transparent; color: var(--olive); }
.btn--outline:hover { background: var(--olive); color: var(--ivory); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; color: #fff; }
.btn--link {
  background: none; border: none; padding: 0; color: var(--deep-ink);
  font-weight: 600; letter-spacing: 0.02em;
}
.btn--link::after { content: ' →'; transition: transform var(--speed); }
.btn--link:hover { background: none; color: var(--olive); }
.btn--link:hover::after { transform: translateX(4px); }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(245, 242, 235, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--speed);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.site-header__inner {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: var(--header-h);
}
.site-header__logo { flex-shrink: 0; display: flex; align-items: center; }
.site-header__logo img { height: 48px; width: auto; }

.site-search {
  flex: 1; max-width: 420px; display: flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: #fff; overflow: hidden; padding-left: 6px;
}
.site-search input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 9px 12px; font-size: var(--fs-small); color: var(--ink);
}
.site-search button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 38px; margin: 2px; border: none; border-radius: 999px;
  background: var(--olive); color: #fff; transition: background var(--speed);
}
.site-search button:hover { background: var(--olive-hover); }

.site-nav { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.site-nav__link {
  display: inline-flex; align-items: center; padding: 8px 14px;
  font-size: var(--fs-small); font-weight: 500; color: var(--soft-text);
  white-space: nowrap; border-radius: var(--radius-sm);
}
.site-nav__link:hover, .site-nav__link.is-active { color: var(--deep-ink); }
.site-nav__item { position: relative; }
.site-nav__dropdown {
  position: absolute; top: 100%; left: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all 220ms var(--ease); z-index: 210;
}
.site-nav__item.has-dropdown:hover .site-nav__dropdown,
.site-nav__item.has-dropdown:focus-within .site-nav__dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.site-nav__dropdown a {
  display: block; padding: 9px 14px; font-size: var(--fs-small);
  color: var(--soft-text); border-radius: var(--radius-sm);
}
.site-nav__dropdown a:hover { background: var(--cream); color: var(--deep-ink); }
.site-nav__dropdown-all { color: var(--olive) !important; font-weight: 600; border-top: 1px solid var(--border); margin-top: 4px; }

.site-header__actions { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.site-header__icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: none; background: none;
  color: var(--deep-ink); border-radius: 50%; transition: background var(--speed);
}
.site-header__icon:hover { background: rgba(68, 78, 48, 0.08); color: var(--olive); }
.cart-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--olive); color: #fff; font-size: 0.66rem; font-weight: 600;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
}
.nav-toggle { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; min-height: min(78vh, 640px); display: flex; align-items: center; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(29,28,20,0.72) 0%, rgba(29,28,20,0.4) 55%, rgba(29,28,20,0.15) 100%); }
.hero__content { position: relative; z-index: 2; color: #fff; max-width: 620px; padding-block: 4rem; }
.hero__content h1 { color: #fff; margin-bottom: 1rem; }
.hero__content .lead { margin-bottom: 1.75rem; max-width: 520px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ============================================================
   CATEGORY GRID
   ============================================================ */
.category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
}
.category-tile {
  position: relative; display: block; aspect-ratio: 4 / 3;
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
}
.category-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.category-tile:hover img { transform: scale(1.05); }
.category-tile__scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(29,28,20,0.72), rgba(29,28,20,0.05) 60%); }
.category-tile__label {
  position: absolute; left: 20px; bottom: 18px; z-index: 2; color: #fff;
  font-family: var(--font-display); font-size: 1.4rem; line-height: 1.15;
}
.category-tile__label small { display: block; font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 400; opacity: 0.85; margin-top: 4px; letter-spacing: 0.04em; }

/* ============================================================
   PRODUCT GRID + CARDS (homepage + shop loop)
   ============================================================ */
.product-grid,
.woocommerce ul.products,
ul.products {
  display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  margin: 0; padding: 0; list-style: none;
}
.woocommerce ul.products,
ul.products { grid-template-columns: repeat(3, 1fr); }
ul.products::before, ul.products::after { content: none; display: none; } /* kill WC float clears */
/* Reset WooCommerce's default float/width so the grid controls sizing */
.woocommerce ul.products li.product,
ul.products li.product,
.product-card-li {
  width: auto !important; float: none !important; margin: 0 !important; clear: none !important;
  display: flex; flex-direction: column;
  /* Grid items default to min-width:auto, so a long unbreakable product name can
     push a track past its 1fr share and overflow the row. */
  min-width: 0;
}

.product-card {
  display: flex; flex-direction: column; height: 100%;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; color: inherit; transition: transform var(--speed) var(--ease), box-shadow var(--speed);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); color: inherit; }
.product-card__image { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--cream); }
.product-card__image img { width: 100% !important; height: 100% !important; object-fit: cover !important; transition: transform 600ms var(--ease); }
.product-card:hover .product-card__image img { transform: scale(1.04); }
.product-card__flag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--sale); color: #fff; font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.05em; padding: 4px 10px; border-radius: 999px;
}
.product-card__flag--muted { background: var(--soft-text); }
.product-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card__cat { font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--olive); font-weight: 600; }
.product-card__title { font-size: 1.15rem; font-weight: 500; line-height: 1.25; color: var(--deep-ink); margin: 0; }
.product-card__price { margin-top: auto; padding-top: 6px; font-family: var(--font-body); font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.product-card__price del { color: var(--soft-text); font-weight: 400; margin-right: 6px; }
.product-card__price ins { text-decoration: none; color: var(--sale); }

/* Loop add-to-cart button */
ul.products li.product > a.button,
ul.products li.product a.add_to_cart_button,
ul.products li.product a.added_to_cart {
  display: block; margin: 10px 0 0; text-align: center; width: 100%;
  padding: 0.75em 1em; font-size: var(--fs-small); font-weight: 500;
  background: transparent; color: var(--olive); border: 1px solid var(--olive);
  border-radius: var(--radius-sm); transition: all var(--speed);
}
ul.products li.product > a.button:hover,
ul.products li.product a.add_to_cart_button:hover { background: var(--olive); color: #fff; }
ul.products li.product a.added_to_cart { border-style: dashed; }
ul.products li.product a.button.loading { opacity: 0.6; }

/* ============================================================
   SHOP ARCHIVE CHROME
   ============================================================ */
.shop-archive__header { margin-bottom: 2rem; }
.shop-archive__title { margin: 0; }
.woocommerce-result-count { color: var(--soft-text); font-size: var(--fs-small); margin: 0; }
.woocommerce-ordering { margin: 0 0 1.5rem; }
.woocommerce-ordering select,
.woocommerce select.orderby {
  padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font-size: var(--fs-small);
}
.shop-archive .woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-products-header__title { display: none; } /* we render our own */

/* result count + ordering row */
.woocommerce-before-shop-loop,
.shop-archive form.woocommerce-ordering { display: inline-block; }

/* pagination */
.woocommerce-pagination { margin-top: 2.5rem; }
.woocommerce-pagination ul { display: flex; gap: 6px; justify-content: center; border: none; }
.woocommerce-pagination ul li { border: none; }
.woocommerce-pagination a, .woocommerce-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--ink); background: #fff; font-size: var(--fs-small);
}
.woocommerce-pagination .current { background: var(--olive); color: #fff; border-color: var(--olive); }

/* ============================================================
   SINGLE PRODUCT
   ============================================================ */
.single-product-detail { max-width: 100%; }
.woocommerce-breadcrumb {
  font-size: var(--fs-xs); color: var(--soft-text); margin-bottom: 1.75rem;
  letter-spacing: 0.02em;
}
.woocommerce-breadcrumb a { color: var(--soft-text); }
.woocommerce-breadcrumb a:hover { color: var(--olive); }

.single-product-detail__main {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}
.single-product-detail__gallery .woocommerce-product-gallery { position: relative; }
.single-product-detail__gallery img { border-radius: var(--radius-md); }
.single-product-detail__gallery .flex-control-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding: 0; }
.single-product-detail__gallery .flex-control-thumbs li { width: 72px; }
.single-product-detail__gallery .flex-control-thumbs img { border-radius: var(--radius-sm); opacity: 0.7; transition: opacity var(--speed); }
.single-product-detail__gallery .flex-control-thumbs img:hover { opacity: 1; }

.single-product-detail__eyebrow {
  font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--olive); font-weight: 600; margin-bottom: 0.75rem;
}
.single-product-detail__summary .product_title {
  font-size: clamp(1.9rem, 2.5vw, 2.6rem); margin-bottom: 1rem;
}
.single-product-detail__summary .price {
  font-family: var(--font-body); font-size: 1.6rem; font-weight: 600;
  color: var(--deep-ink); margin-bottom: 1.25rem; display: block;
}
.single-product-detail__summary .price del { color: var(--soft-text); font-weight: 400; font-size: 1.2rem; margin-right: 10px; }
.single-product-detail__summary .price ins { text-decoration: none; color: var(--sale); }
.single-product-detail__summary .woocommerce-product-details__short-description {
  color: var(--soft-text); line-height: 1.7; margin-bottom: 1.25rem;
}
.single-product-detail__divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.single-product-detail__summary .stock { font-size: var(--fs-small); color: var(--olive); margin-bottom: 1rem; }
.single-product-detail__summary .stock.out-of-stock { color: var(--sale); }

.woocommerce-product-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 1rem; font-size: var(--fs-small); }
.star-rating { color: var(--terracotta); }

/* Add to cart form */
form.cart { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 1.5rem; }
form.cart .quantity { display: inline-flex; align-items: center; }
form.cart .quantity input.qty {
  width: 72px; height: 48px; text-align: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
}
.single_add_to_cart_button,
form.cart button.button {
  height: 48px; padding: 0 2rem; background: var(--olive); color: var(--ivory);
  border: 1px solid var(--olive); border-radius: var(--radius-sm);
  font-size: var(--fs-small); font-weight: 500; letter-spacing: 0.02em;
  transition: background var(--speed);
}
.single_add_to_cart_button:hover, form.cart button.button:hover { background: var(--olive-hover); }
form.cart .variations { margin-bottom: 1rem; }
form.cart .variations td, form.cart .variations th { padding: 6px 8px 6px 0; }
form.cart .variations select {
  padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; min-width: 180px;
}

.product_meta { font-size: var(--fs-small); color: var(--soft-text); border-top: 1px solid var(--border); padding-top: 1rem; }
.product_meta > span { display: block; margin-bottom: 4px; }
.product_meta a { color: var(--olive); }

/* Heritage note */
.hk-heritage-note { margin-top: 3.5rem; padding: 2.5rem; background: var(--cream); border-radius: var(--radius-md); }
.hk-heritage-note p { font-size: var(--fs-body-lg); line-height: 1.7; color: var(--deep-ink); font-family: var(--font-display); font-style: italic; }

/* Tabs */
.woocommerce-tabs { margin-top: 3.5rem; }
.woocommerce-tabs ul.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; padding: 0; }
.woocommerce-tabs ul.tabs li { list-style: none; }
.woocommerce-tabs ul.tabs li a {
  display: inline-block; padding: 12px 20px; font-size: var(--fs-small); font-weight: 500;
  color: var(--soft-text); border-bottom: 2px solid transparent;
}
.woocommerce-tabs ul.tabs li.active a, .woocommerce-tabs ul.tabs li a:hover { color: var(--deep-ink); border-bottom-color: var(--olive); }
.woocommerce-Tabs-panel { line-height: 1.75; color: var(--soft-text); }
.woocommerce-Tabs-panel h2 { font-size: var(--fs-h3); margin-bottom: 1rem; }

/* Related */
.related.products, .up-sells.products { margin-top: 4rem; }
.related.products > h2, .up-sells.products > h2 { font-size: var(--fs-h2); margin-bottom: 2rem; }

/* ============================================================
   CART / CHECKOUT / ACCOUNT (block + shortcode pages)
   ============================================================ */
.woocommerce-cart .section, .woocommerce-checkout .section, .woocommerce-account .section { padding-block: 3.5rem; }
.woocommerce table.shop_table {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
}
.woocommerce table.shop_table th { background: var(--cream); padding: 14px 18px; text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--soft-text); }
.woocommerce table.shop_table td { padding: 14px 18px; border-top: 1px solid var(--border); vertical-align: middle; }
.woocommerce .cart-collaterals .cart_totals, .woocommerce-checkout #order_review { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.5rem; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit {
  background: var(--olive); color: var(--ivory); border: 1px solid var(--olive);
  border-radius: var(--radius-sm); padding: 0.8em 1.6em; font-weight: 500; transition: background var(--speed);
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover { background: var(--olive-hover); color: var(--ivory); }
.woocommerce a.button.alt, .woocommerce button.button.alt { background: var(--olive-deep); border-color: var(--olive-deep); }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select {
  padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; width: 100%;
}

/* WooCommerce Blocks buttons (cart / checkout / place order) */
.wc-block-cart__submit-button,
.wc-block-components-button.contained,
.wc-block-components-button:not(.wc-block-components-button--link),
.wp-block-woocommerce-checkout .wc-block-components-checkout-place-order-button {
  background-color: var(--olive) !important;
  border-color: var(--olive) !important;
  color: #fff !important;
  border-radius: var(--radius-sm) !important;
  text-decoration: none !important;
}
.wc-block-cart__submit-button:hover,
.wc-block-components-button.contained:hover,
.wc-block-components-button:not(.wc-block-components-button--link):hover,
.wp-block-woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
  background-color: var(--olive-hover) !important;
  border-color: var(--olive-hover) !important;
  color: #fff !important;
}
.wc-block-components-button .wc-block-components-button__text,
.wc-block-cart__submit-button .wc-block-components-button__text { color: #fff !important; }
/* Keep "link"-style block buttons (e.g. Add coupons) readable, not filled */
.wc-block-components-button--link,
a.wc-block-components-button--link {
  background: none !important; color: var(--olive) !important; border: none !important;
}

/* WooCommerce notices */
.woocommerce-message, .woocommerce-info, .woocommerce-error, .woocommerce-noreviews {
  position: relative;
  border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 1.5rem;
  border-left: 4px solid var(--olive); background: var(--cream); list-style: none;
  font-size: var(--fs-small); line-height: 1.55;
}
/* Core absolutely positions an icon at ::before{top:1em;left:1.5em} and pays for
   it with padding:1em 2em 1em 3.5em. We override that padding, so we must also
   reserve the left gutter and re-pin the icon — otherwise it sits on the text. */
.woocommerce-message, .woocommerce-info, .woocommerce-error { padding-left: 48px; }
.woocommerce-message::before, .woocommerce-info::before, .woocommerce-error::before {
  top: 14px; left: 18px; line-height: 1.55;
}
.woocommerce-error { border-left-color: var(--sale); background: #faece6; }
.woocommerce-message .button, .woocommerce-info .button { float: right; }

/* ============================================================
   CART DRAWER (slide-out mini cart)
   ============================================================ */
.cart-drawer-overlay {
  position: fixed; inset: 0; background: rgba(29, 28, 20, 0.45);
  opacity: 0; visibility: hidden; transition: opacity var(--speed); z-index: 300;
}
.cart-drawer-overlay.is-open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(400px, 90vw);
  background: var(--paper); box-shadow: -10px 0 40px rgba(29,28,20,0.18);
  transform: translateX(100%); transition: transform var(--speed) var(--ease);
  z-index: 310; display: flex; flex-direction: column;
}
.cart-drawer.is-open { transform: translateX(0); }
.cart-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.cart-drawer__head h3 { margin: 0; font-size: 1.3rem; }
.cart-drawer__close { border: none; background: none; font-size: 1.8rem; line-height: 1; color: var(--soft-text); }
.cart-drawer__close:hover { color: var(--deep-ink); }
.cart-drawer__body { flex: 1; overflow-y: auto; padding: 20px 22px; font-size: var(--fs-small); line-height: 1.5; }
.cart-drawer__body .widget_shopping_cart_content { font-size: var(--fs-small); }
.cart-drawer__body ul.cart_list { margin: 0; padding: 0; list-style: none; }
.cart-drawer__body ul.cart_list li {
  position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 12px;
  padding: 14px 26px 14px 0; border-bottom: 1px solid var(--border); overflow: hidden;
}
.cart-drawer__body ul.cart_list li::after { content: ""; display: table; clear: both; }
.cart-drawer__body ul.cart_list li img {
  width: 52px !important; height: 64px; object-fit: cover; border-radius: var(--radius-sm);
  float: none !important; margin: 0 !important; position: static !important; order: -1;
}
.cart-drawer__body ul.cart_list li a:not(.remove) { color: var(--deep-ink); font-weight: 600; font-size: var(--fs-small); line-height: 1.35; }
.cart-drawer__body ul.cart_list li .quantity { display: block; font-size: var(--fs-xs); color: var(--soft-text); margin-top: 4px; }
.cart-drawer__body a.remove {
  position: absolute; top: 12px; right: 0; width: 20px; height: 20px;
  font-size: 1.1rem !important; line-height: 18px; text-align: center; color: var(--soft-text) !important;
}
.cart-drawer__body a.remove:hover { color: var(--sale) !important; background: none; }
.cart-drawer__body .woocommerce-mini-cart__total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 0; font-weight: 600; font-size: var(--fs-body); border-top: 1px solid var(--border); margin-top: 8px;
}
.cart-drawer__body .woocommerce-mini-cart__total .amount { font-family: var(--font-body); }
.cart-drawer__body .woocommerce-mini-cart__buttons { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.cart-drawer__body .woocommerce-mini-cart__buttons a {
  display: block; width: 100%; margin: 0; text-align: center; padding: 0.75em 1em;
  border: 1px solid var(--olive); border-radius: var(--radius-sm); font-size: var(--fs-small); font-weight: 500;
}
.cart-drawer__body .woocommerce-mini-cart__buttons a.button { background: transparent; color: var(--olive); }
.cart-drawer__body .woocommerce-mini-cart__buttons a.checkout { background: var(--olive); color: #fff; }
.cart-drawer__body .woocommerce-mini-cart__buttons a.checkout:hover { background: var(--olive-hover); color: #fff; }
.cart-drawer__body .woocommerce-mini-cart__empty-message { text-align: center; color: var(--soft-text); padding: 2rem 0; }

/* ============================================================
   STORY ROW / VALUES / CTA
   ============================================================ */
.story-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.story-row__media img { border-radius: var(--radius-md); box-shadow: var(--shadow-sm); width: 100%; object-fit: cover; }
.story-row__text h1, .story-row__text h2 { margin-bottom: 1rem; }
.story-row__text p { color: var(--soft-text); margin-bottom: 1rem; }
.story-row__text .btn { margin-top: 0.75rem; }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.value { text-align: center; padding: 1rem; }
.value__icon { margin-bottom: 1rem; color: var(--olive); }
.value__icon svg { width: 40px; height: 40px; }
.value h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.value p { color: var(--soft-text); font-size: var(--fs-small); }

.cta { text-align: center; position: relative; overflow: hidden; }
.cta__inner { position: relative; z-index: 1; }
.cta__watermark { position: absolute; right: -70px; bottom: -90px; height: 360px; width: auto; opacity: 0.07; pointer-events: none; }

/* Brand ornament divider */
.hk-ornament { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 2.75rem; }
.hk-ornament img { width: 30px; height: auto; opacity: 0.9; }
.hk-ornament::before, .hk-ornament::after { content: ""; height: 1px; width: 56px; background: var(--border-strong); }

/* Watermarked section (About story) */
.section--brandmark { position: relative; overflow: hidden; }
.section-watermark { position: absolute; right: -90px; top: 50%; transform: translateY(-50%); height: 430px; width: auto; opacity: 0.05; pointer-events: none; }
.section--brandmark .container { position: relative; z-index: 1; }
.cta__inner h2 { margin-bottom: 0.75rem; }
.cta__inner .lead { margin-bottom: 1.75rem; }

/* ============================================================
   FORMS (contact) + PAGE CONTENT
   ============================================================ */
.page-content__header { margin-bottom: 1.5rem; }
.entry-content { line-height: 1.8; color: var(--soft-text); }
.entry-content h2, .entry-content h3 { color: var(--deep-ink); margin: 1.75rem 0 0.75rem; }
.entry-content p { margin-bottom: 1.1rem; }
.entry-content a { color: var(--olive); text-decoration: underline; }
.entry-content img { border-radius: var(--radius-md); margin: 1.5rem 0; }

.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-small); font-weight: 500; color: var(--deep-ink); }
.contact-form input, .contact-form textarea {
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font-size: var(--fs-small); width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--olive); }
.contact-form .btn { align-self: flex-start; margin-top: 0.5rem; }
.form-notice { padding: 14px 18px; border-radius: var(--radius-md); margin-bottom: 1.5rem; font-size: var(--fs-small); }
.form-notice:focus { outline: 2px solid var(--olive); outline-offset: 2px; }
/* Honeypot — off-screen for people, still filled in by bots. */
.hk-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-notice--ok { background: #eaf0e2; border-left: 4px solid var(--olive); color: var(--olive-deep); }
.form-notice--error { background: #faece6; border-left: 4px solid var(--sale); color: #8a4227; }

.newsletter { display: flex; gap: 8px; }
.newsletter input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--olive-deep); color: rgba(254, 249, 236, 0.82); padding-top: 3.5rem; }
.site-footer__grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 2.5rem; padding-bottom: 2.5rem;
}
.site-footer__brand img { height: 44px; width: auto; margin-bottom: 1rem; }
.site-footer__brand p { font-size: var(--fs-small); line-height: 1.7; max-width: 280px; }
.site-footer h4 { color: var(--ivory); font-family: var(--font-body); font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer__col a { display: block; font-size: var(--fs-small); color: rgba(254, 249, 236, 0.72); margin-bottom: 0.6rem; }
.site-footer__col a:hover { color: var(--ivory); }
.site-footer__newsletter p { font-size: var(--fs-small); margin-bottom: 1rem; }
.site-footer__newsletter .newsletter input { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.site-footer__newsletter .newsletter input::placeholder { color: rgba(255, 255, 255, 0.6); }
.site-footer__bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12); padding-block: 1.25rem; font-size: var(--fs-xs);
}
.site-footer__legal a { margin-left: 1.25rem; color: rgba(254, 249, 236, 0.72); }
.site-footer__legal a:hover { color: var(--ivory); }

/* ============================================================
   POST GRID (blog/search)
   ============================================================ */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.post-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.post-card__image { aspect-ratio: 3 / 2; overflow: hidden; }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 18px; }
.post-card__body h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.post-card__body p { font-size: var(--fs-small); color: var(--soft-text); }
.empty-state { color: var(--soft-text); padding: 2rem 0; text-align: center; }
.empty-state::before,
.cart-drawer .woocommerce-mini-cart__empty-message::before {
  content: ""; display: block; width: 56px; height: 66px; margin: 0 auto 1.1rem;
  background: url('images/herikraft-mark-olive.svg') center / contain no-repeat; opacity: 0.35;
}
.cart-drawer .woocommerce-mini-cart__empty-message { text-align: center; color: var(--soft-text); padding: 2.5rem 1rem; }

/* Brand-styled Woo notices; shop empty state gets the mark */
.woocommerce-info { border-top-color: var(--olive); background-color: var(--ivory); color: var(--ink); }
.woocommerce-info::before { color: var(--olive); }
.shop-archive .woocommerce-info {
  border: none; background: none; text-align: center; color: var(--soft-text); padding: 3.5rem 0 2rem;
}
.shop-archive .woocommerce-info::before {
  content: ""; display: block; position: static; width: 56px; height: 66px; margin: 0 auto 1.1rem;
  background: url('images/herikraft-mark-olive.svg') center / contain no-repeat; opacity: 0.35;
}
.pagination { margin-top: 2.5rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 860px) {
  .site-search { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--paper); border-bottom: 1px solid var(--border);
    padding: 12px; box-shadow: var(--shadow-md);
    transform: translateY(-10px); opacity: 0; visibility: hidden;
    /* Closed nav must never catch taps. Kept off `transition: all` so it applies
       instantly rather than halfway through the close animation. */
    pointer-events: none;
    transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease),
                visibility var(--speed) var(--ease);
  }
  .site-nav.is-open {
    transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto;
  }
  .site-nav__link { padding: 12px 10px; font-size: 1.05rem; }
  /* Scoped to .is-open: `visibility: visible` on a descendant overrides the
     closed parent's `visibility: hidden`, which otherwise left a full-width,
     invisible stack of category links hit-testable over the page content. */
  .site-nav.is-open .site-nav__dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 0 0 8px 14px; min-width: 0; }
  .single-product-detail__main { grid-template-columns: 1fr; }
  .story-row { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  /* Must repeat the `.woocommerce` prefix to out-specify the base rule's
     `.woocommerce ul.products` (0,2,1). Media queries add no specificity, so a
     bare `ul.products` (0,1,1) here loses and shop/category archives stay stuck
     at 3 columns — overflowing the viewport on phones. */
  .product-grid,
  .woocommerce ul.products,
  ul.products { grid-template-columns: repeat(2, 1fr); }
  .values { grid-template-columns: 1fr; gap: 1.5rem; }
  .post-grid { grid-template-columns: 1fr; }
  .section-head--row { align-items: flex-start; }
}
@media (max-width: 520px) {
  .category-grid { grid-template-columns: 1fr; }
  .product-grid,
  .woocommerce ul.products,
  ul.products { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  /* Cards are ~165px wide here; the desktop 1.15rem title wraps to 4-5 lines
     and pushes prices out of alignment across the row. */
  .product-card__title { font-size: 0.95rem; }
  .product-card__body { padding: 12px 12px 14px; }
  .contact-form__row { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .hero { min-height: 70vh; }
}
