/* ==========================================================================
   Earthmonk: shop filters, empty state and chat widget polish (s6).
   Auto-enqueued site-wide by the css/*.css loop in functions.php, after
   fluentcart.css. Pairs with js/shop-product.js (empty state, sort menu
   keyboard behaviour, slider labels).
   FluentCart's shop-app.css loads after the child theme, so rules that fight
   it at equal specificity need !important.
   ========================================================================== */

/* ---- 1. Filter checkboxes: visually hidden but focusable ----------------
   FluentCart ships `.fct-shop-checkbox input { width:0; height:0; opacity:0 }`
   which leaves nothing to show focus on. Keep the native input (so it stays
   in the tab order and the accessibility tree with its label) sitting exactly
   over the custom .checkmark, transparent, and draw the focus ring on the
   custom control instead. */
.fct-shop-checkbox input[type="checkbox"] {
  position: absolute !important;
  top: 0; left: 0;
  width: 16px !important; height: 16px !important;
  margin: 0 !important;
  opacity: 0 !important;
  z-index: 1;
  cursor: pointer;
}
.fct-shop-checkbox .checkmark { transition: box-shadow .15s, border-color .15s; }
/* The group is a scroll box (overflow-x hidden), which clipped the ring on
   the first item and on the left edge. Pad it so the ring has room. */
.fct-shop-filter-item .fct-shop-checkbox-group-inner { padding: 5px 5px 10px !important; margin-left: -5px; margin-right: -5px; }
.fct-shop-checkbox input[type="checkbox"]:focus-visible ~ .checkmark {
  outline: 2px solid var(--ink, #20211d);
  outline-offset: 2px;
  border-color: var(--ink, #20211d);
}
.fct-shop-checkbox:has(input:focus-visible) > span:last-of-type { color: var(--ink, #20211d); text-decoration: underline; text-underline-offset: 3px; }
.fct-shop-checkbox input[type="checkbox"]:checked ~ .checkmark { background-color: var(--ink, #20211d) !important; border-color: var(--ink, #20211d) !important; }

/* ---- 1b. Sort menu radios -----------------------------------------------
   The closed dropdown was only opacity:0 + pointer-events:none, so Tab still
   landed on an invisible radio. visibility:hidden takes it out of the tab
   order while closed; the delayed transition keeps FluentCart's fade-out. */
.fct-shop-sorting-dropdown {
  visibility: hidden;
  transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s !important;
  border-color: var(--line, #e4ddd1) !important;
  border-radius: 3px !important;
}
.fct-shop-sorting-dropdown.active { visibility: visible; transition-delay: 0s !important; }
.fct-shop-sorting input[type="radio"] {
  position: absolute !important;
  width: 16px; height: 16px; margin: 0;
  opacity: 0 !important;
}
.fct-shop-sorting input[type="radio"]:focus-visible + .fct-sorting-radio {
  outline: 2px solid var(--ink, #20211d);
  outline-offset: 2px;
}
.fct-shop-sorting-item:has(input:focus-visible) label { background: var(--cream, #f7f4ee); }
.fct-shop-sorting .fct-shop-sorting-item.selected .fct-sorting-radio { background-color: var(--ink, #20211d) !important; border-color: var(--ink, #20211d) !important; }
.fct-sorting-toggle:focus-visible { outline: 2px solid var(--ink, #20211d) !important; outline-offset: 2px; }

/* Collapse headers and the price slider handles also had no visible focus. */
.fct-shop-item-collapse-wrap:focus-visible,
.fct-shop-filter-wrapper .toggle-icon:focus-visible,
.fct-shop-filter-wrapper .noUi-handle:focus-visible {
  outline: 2px solid var(--ink, #20211d) !important;
  outline-offset: 3px;
}

/* ---- 2. Zero results -----------------------------------------------------
   FluentCart leaves the paginator saying "Showing 1 to 1 of 0 Items" beside
   its "No Product Found!" block. shop-product.js adds body.em-shop-empty
   while the empty block is showing; hide the contradictory count then. */
body.em-shop-empty .fct-shop-paginator { display: none !important; }

.fluent-cart-shop-no-result-found:not(.hide) {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: clamp(40px, 7vw, 80px) 24px;
  border: 1px solid var(--line, #e4ddd1);
  border-radius: 3px;
  background: var(--cream, #f7f4ee);
}
/* FluentCart's stock copy is swapped for ours by the JS; hide theirs once
   ours is in, so there is never a flash of both. */
.fluent-cart-shop-no-result-found.em-empty-ready > p:not(.em-empty-title):not(.em-empty-text) { display: none; }
.em-empty-title { font-family: var(--serif, "Cormorant Garamond", serif); font-size: clamp(26px, 3vw, 34px); line-height: 1.15; color: var(--ink, #20211d); margin: 0; }
.em-empty-text { font-family: var(--body, Raleway, sans-serif); font-size: 15px; color: var(--ink-soft, #55564f); margin: 0; max-width: 38ch; }
.em-clear-filters {
  margin-top: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink, #20211d); color: #fff;
  border: 1px solid var(--ink, #20211d); border-radius: 2px;
  font-family: var(--disp, Montserrat, sans-serif); text-transform: uppercase;
  letter-spacing: .16em; font-size: 11px; font-weight: 600;
  padding: 14px 26px; cursor: pointer;
  transition: .35s cubic-bezier(.4,0,.2,1);
}
.em-clear-filters:hover { background: var(--taupe, #7b6a58); border-color: var(--taupe, #7b6a58); }
.em-clear-filters:focus-visible { outline: 2px solid var(--ink, #20211d); outline-offset: 3px; }
.fct-shop-paginator-results:focus { outline: none; }
.fct-shop-paginator-results:focus-visible { outline: 2px solid var(--ink, #20211d); outline-offset: 4px; }

/* ---- 3. Product story at small widths ------------------------------------
   Legacy product descriptions carry pasted inline widths, long unbroken URLs
   and the odd table. Keep all of it inside the accordion column. */
.pdp, .pdp__info, .pdp-acc, .pdp-acc details, .pdp-acc__body { min-width: 0; max-width: 100%; }
.pdp-acc__body { overflow-wrap: anywhere; }
.pdp-acc__body img, .pdp-acc__body iframe, .pdp-acc__body video { max-width: 100% !important; height: auto; }
.pdp-acc__body table { display: block; max-width: 100%; overflow-x: auto; }
.pdp-acc__body [style*="width"] { max-width: 100% !important; }
.pdp-acc__body ul, .pdp-acc__body ol { padding-left: 1.2em; }


/* ---- PDP polish (30 Sep) ----------------------------------------------
   The info column is a flex column with align-items:flex-start, so the
   assurance list and the accordion shrank to their text width (~170px)
   while the buy buttons span the column. Stretch them to the full column. */
.pdp__info > #brxe-p7ndtg,
.pdp__info > #brxe-0p19eg { align-self: stretch; width: 100%; }
.pdp-acc { margin-top: 8px; }
.pdp-acc details:first-child { border-top: 0; }

/* Related products: its own cream band, divided from the product above,
   with the same card language as the shop grid. FluentCart's related
   element renders .fct-product-card-title (the shop uses the dynamic
   title), so those cards need their own type rules. */
.pdp-related {
  max-width: none !important;
  margin-top: clamp(40px, 5vw, 72px);
  padding: clamp(48px, 6vw, 80px) max(clamp(20px, 5vw, 64px), calc((100% - 1112px) / 2)) clamp(56px, 7vw, 96px) !important;
  background: var(--cream);
  border-top: 1px solid var(--line);
}
.pdp-related .fct-similar-product-list-container { margin: 0; padding: 0; }
.pdp-related .fct-product-list-heading {
  font-family: var(--serif, "Cormorant Garamond", Georgia, serif);
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 clamp(24px, 3vw, 36px);
  text-transform: none;
}
.pdp-related .fct-product-list { gap: clamp(16px, 2vw, 28px) !important; }
.pdp-related .fct-product-card { background: transparent; }
.pdp-related .fct-product-card-image-wrap {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 3px;
  background: #fff;
}
.pdp-related .fct-product-card-image { width: 100%; height: 100%; object-fit: cover; }
.pdp-related .fct-product-card-title { margin: 16px 0 6px; padding: 0; }
.pdp-related .fct-product-card-title a {
  font-family: var(--body, "Raleway", sans-serif);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.pdp-related .fct-product-card-title a:hover { color: var(--taupe-deep); }
.pdp-related .fct-product-card-prices,
.pdp-related .fct-product-card-prices * { padding-left: 0 !important; margin-left: 0 !important; }
.pdp-related .fct-product-list { row-gap: clamp(28px, 4vw, 40px) !important; }

/* Quantity: label above a bordered stepper, matching the site's form fields,
   instead of FluentCart's grey bar with the label jammed against it. */
.pdp__info .fct-product-quantity-container { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border: 0 !important; background: none !important; padding: 0 !important; }
.pdp__info .fct-product-quantity-container .quantity-title { font-family: var(--disp, "Montserrat", sans-serif); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 600; color: var(--taupe-deep); margin: 0; }
.pdp__info .fct-product-quantity { width: auto !important; display: inline-flex; align-items: center; background: #fff !important; border: 1px solid var(--line) !important; border-radius: 3px; overflow: hidden; }
.pdp__info .fct-product-quantity button { background: transparent !important; width: 44px; height: 44px; border: 0 !important; color: var(--ink); cursor: pointer; }
.pdp__info .fct-product-quantity button:hover { background: var(--cream) !important; }
.pdp__info .fct-product-quantity input { width: 48px; height: 44px; text-align: center; border: 0 !important; background: transparent !important; font-family: var(--body, "Raleway", sans-serif); font-size: 15px; color: var(--ink); -moz-appearance: textfield; }
.pdp__info .fct-product-quantity input::-webkit-outer-spin-button, .pdp__info .fct-product-quantity input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
