/*
 * WooCommerce pages: single product, cart, checkout, plus shared control
 * styling used across the archives too.
 *
 * HAND MAINTAINED. Unlike base.css, home.css and shop.css, this file is NOT
 * generated by bin/port-preview-css.py and will not be overwritten by it.
 *
 * It exists because the concept preview never had a product page, a cart or a
 * checkout, so there is no approved CSS to port for any of them. Everything
 * here is built from the same tokens and the same button and type rules the
 * client did approve, so it reads as part of the same design rather than as
 * WooCommerce defaults wearing a brand colour.
 */

/* --- product layout --- */
.prod-single {
  padding: clamp(28px, 4vw, 52px) 0 clamp(48px, 6vw, 80px);
}

.prod-single__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
  margin-top: 22px;
}

/*
 * White, not sand.
 *
 * The frame is a fixed 4:5 and the images are `contain`, so anything that is
 * not exactly 4:5 letterboxes. Every product photograph is a packshot on a
 * WHITE studio background, so a sand backdrop drew two visible bands across
 * the top and bottom of the shot and read as a rendering fault rather than a
 * design choice. It only showed up once variation images landed: the parent
 * photographs happen to be close to 4:5, the 100 ml ones are squarer.
 *
 * White makes the letterboxing invisible against the photograph's own
 * background, whatever shape the client uploads later.
 */
.prod-single__main {
  background: #fff;
  border-radius: 2px;
  overflow: hidden;
}

/*
 * 4:5, matching the locked aspect ratio. `contain` rather than `cover`: these
 * are packshots on a white background, and cropping a bottle to fill the frame
 * cuts the label. The white backdrop above fills whatever the image does not.
 */
.prod-single__main img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
}

.prod-single__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.prod-single__thumbs img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 2px;
}

/* --- summary --- */
.prod-single .summary {
  padding-top: clamp(4px, 1vw, 18px);
}

.prod-single .product_title {
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--espresso);
  margin: 0 0 14px;
}

.prod-single .price {
  display: block;
  font-size: 19px;
  font-weight: 600;
  color: var(--terracotta-deep);
  margin-bottom: 18px;
}

.prod-single .woocommerce-product-details__short-description {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--espresso-soft);
  max-width: 52ch;
  margin-bottom: 26px;
}

.prod-single .product_meta {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--espresso-soft);
}

.prod-single .product_meta a {
  color: var(--terracotta-deep);
}

/* --- WooCommerce buttons, brought onto the approved button styling --- */
/*
 * `:not(.quick)` on every generic selector below.
 *
 * The archive "quick add" is a DIFFERENT component: a small pill absolutely
 * positioned inside the product image, revealed on hover, styled in shop.css
 * from the approved preview. These generic rules were overriding it, giving it
 * position:relative and 15px 30px padding, which made it 162x56 inside a 162px
 * card whose parent has overflow:hidden. On mobile, where the design shows it
 * permanently rather than on hover, it was visibly clipped.
 *
 * Excluding it here rather than raising specificity on .quick keeps the two
 * components genuinely separate, so the next person adding a button rule does
 * not silently break the card again.
 */
/*
 * `.alt` is included on every selector below. WooCommerce gives its primary
 * buttons (add to cart, place order, proceed to checkout) the extra `alt`
 * class, and woocommerce.css styles `.button.alt` with a higher specificity
 * than `.button`. Without matching it, the single most important button on the
 * site stays WooCommerce purple while every other button is on brand.
 */
.woocommerce button.button:not(.quick),
.woocommerce button.button.alt:not(.quick),
.woocommerce a.button:not(.quick),
.woocommerce a.button.alt:not(.quick),
.woocommerce input.button:not(.quick),
.woocommerce input.button.alt:not(.quick),
.woocommerce #respond input#submit,
.woocommerce div.product form.cart .button,
.wc-block-components-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--espresso);
  color: var(--cream);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}

.woocommerce button.button:not(.quick):hover,
.woocommerce button.button.alt:not(.quick):hover,
.woocommerce a.button:not(.quick):hover,
.woocommerce a.button.alt:not(.quick):hover,
.woocommerce input.button:not(.quick):hover,
.woocommerce input.button.alt:not(.quick):hover,
.woocommerce #respond input#submit:hover,
.woocommerce div.product form.cart .button:hover {
  background: var(--terracotta-deep);
  color: var(--cream);
  transform: translateY(-2px);
}

.woocommerce button.button:not(.quick):disabled,
.woocommerce button.button.alt:not(.quick):disabled,
.woocommerce button.button.disabled:not(.quick),
.woocommerce button.button.alt.disabled:not(.quick) {
  background: var(--sand-deep);
  color: var(--espresso-soft);
  transform: none;
  cursor: not-allowed;
}

/* Quantity input, so it sits level with the button rather than above it. */
.woocommerce .quantity .qty {
  width: 68px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  text-align: center;
  color: var(--espresso);
}

.woocommerce div.product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.woocommerce div.product form.cart.variations_form {
  display: block;
}

/* --- variation selectors --- */
/*
 * The row is laid out with flexbox rather than left as a table.
 *
 * Two problems made the label sit 14px above the dropdown:
 *
 * 1. WooCommerce aligns these cells to the TOP via
 *    `.woocommerce div.product form.cart .variations td/th`, which is more
 *    specific than a `table.variations th` rule, so `vertical-align: middle`
 *    was written here but never actually applied.
 * 2. Even centred it would still have been wrong. The cell is taller than the
 *    control, because WooCommerce's "Clear" link wraps onto its own line
 *    underneath the dropdown, making the cell 93px tall around a 50px control.
 *    Centring the label against the CELL is not the same as aligning it with
 *    the CONTROL.
 *
 * Making the row a flex container fixes both at once: the label centres
 * against the control itself, and "Clear" sits beside the dropdown instead of
 * below it. The selectors below carry the same specificity as WooCommerce's
 * and load after it.
 */
.woocommerce div.product form.cart table.variations,
.woocommerce div.product form.cart table.variations tbody {
  display: block;
  width: 100%;
  border: 0;
  margin-bottom: 16px;
}

.woocommerce div.product form.cart table.variations tr {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.woocommerce div.product form.cart table.variations th,
.woocommerce div.product form.cart table.variations td {
  display: block;
  padding: 0;
  border: 0;
  text-align: left;
  vertical-align: middle;
}

.woocommerce div.product form.cart table.variations th {
  flex: 0 0 auto;
  width: 76px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--espresso-soft);
  /* Cancels the label's own line-height offset so its text centre matches the
     control's centre exactly rather than approximately. */
  line-height: 1.2;
}

/*
 * The value cell holds the dropdown AND the Clear link. Keeping them in one
 * centred flex row is what stops Clear dropping to a second line and making
 * the whole row taller than the control.
 */
.woocommerce div.product form.cart table.variations td {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

@media (max-width: 640px) {
  /* Stack on a phone: 76px of label plus a pill does not fit beside each
     other once the label wraps. */
  .woocommerce div.product form.cart table.variations tr {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .woocommerce div.product form.cart table.variations th {
    width: auto;
  }
}

.woocommerce table.variations select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--espresso);
}

.woocommerce .single_variation_wrap .woocommerce-variation-price {
  margin-bottom: 14px;
}

.woocommerce .reset_variations {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--espresso-soft);
}

/* --- tabs --- */
.woocommerce div.product .woocommerce-tabs {
  margin-top: clamp(40px, 5vw, 68px);
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 0 0 26px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
  display: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--espresso-soft);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: var(--espresso);
  border-bottom: 2px solid var(--terracotta);
  padding-bottom: 10px;
}

.woocommerce div.product .woocommerce-tabs .panel > h2:first-child {
  display: none; /* "Description" above the description is a redundant heading. */
}

.woocommerce div.product .woocommerce-tabs .panel {
  max-width: 74ch;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--espresso-soft);
}

.woocommerce div.product .woocommerce-tabs .panel h3 {
  margin: 28px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--espresso);
}

.woocommerce div.product .woocommerce-tabs .panel ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.woocommerce div.product .woocommerce-tabs .panel li {
  margin-bottom: 6px;
}

/* --- messages --- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-top-color: var(--terracotta);
  background: var(--sand);
  color: var(--espresso);
  font-size: 14px;
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--terracotta);
}

/* --- responsive --- */
@media (max-width: 900px) {
  .prod-single__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .prod-single .summary {
    padding-top: 0;
  }
}

/* --- WooCommerce Blocks cart and checkout ---------------------------------
 *
 * WooCommerce 11 renders cart and checkout as blocks, not the classic
 * templates, so the `.woocommerce a.button` rules above do not reach them.
 *
 * The checkout button is an <a> underneath, so theme.json's link colour and the
 * underline both applied to it: the primary call to action on the whole store
 * rendered as terracotta underlined text on a dark button. Link styling is
 * explicitly unset here rather than by loosening theme.json, which would take
 * the underline off genuine body-copy links too.
 */
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
a.wc-block-components-button,
.wc-block-components-button:not(.is-link) {
  background: var(--espresso);
  color: var(--cream);
  border-radius: 2px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover,
a.wc-block-components-button:hover,
.wc-block-components-button:not(.is-link):hover {
  background: var(--terracotta-deep);
  color: var(--cream);
  text-decoration: none;
}

/* The inner text span carries its own colour in the block markup. */
.wc-block-components-button__text {
  color: inherit;
  text-decoration: none;
}

.wc-block-components-title,
.wc-block-cart__totals-title {
  font-family: inherit;
  color: var(--espresso);
}

.wc-block-components-product-name {
  color: var(--espresso);
  text-decoration: none;
}

.wc-block-components-totals-item__value {
  color: var(--espresso);
  font-weight: 600;
}

/* --- archive toolbar, mobile overflow -------------------------------------
 *
 * The concept preview had a bare <select class="sort">. The theme's
 * woocommerce/loop/orderby.php override wraps it in a
 * <form class="woocommerce-ordering">, because WooCommerce's own script binds
 * to that form to submit on change.
 *
 * Nothing constrained that wrapper, so at 390px the toolbar pushed roughly
 * 23px past the viewport and every category page scrolled sideways on a phone.
 * Flex items default to min-width:auto and refuse to shrink below their
 * content, which is what let it push out.
 */
.toolbar__inner,
.toolbar__right,
.pills {
  min-width: 0;
}

.woocommerce-ordering {
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.woocommerce-ordering .sort {
  max-width: 100%;
}

@media (max-width: 640px) {
  /*
   * Below 640 the count and the sort share a row and each takes half, rather
   * than the sort being pushed off the edge.
   */
  .toolbar__right {
    flex-wrap: wrap;
    gap: 10px;
  }

  .woocommerce-ordering {
    flex: 1 1 auto;
  }

  .woocommerce-ordering .sort {
    width: 100%;
  }
}

/* --- archive quick add ----------------------------------------------------
 *
 * Re-asserts the approved shop.css styling at a specificity WooCommerce's own
 * stylesheet cannot beat. woocommerce.css styles `a.button` and `.button` with
 * enough weight to override a bare `.quick`, and it loads on every shop page,
 * so the component needs to state its own geometry rather than rely on
 * source order.
 */
.woocommerce .prod .prod__media a.quick,
.woocommerce .prod .prod__media button.quick,
.prod .prod__media .quick {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  width: auto;
  z-index: 2;
  display: block;
  padding: 12px;
  margin: 0;
  border: 0;
  border-radius: 2px;
  /*
   * Espresso, not the preview's cream.
   *
   * The preview mocked this over dark lifestyle photography, where a cream pill
   * stood out. The real catalog is packshots on a WHITE background, and a cream
   * button on a white photo is almost invisible: on mobile, where the design
   * shows it permanently rather than on hover, customers would not find the
   * primary action on the card.
   */
  background: var(--espresso);
  color: var(--cream);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
}

.woocommerce .prod .prod__media a.quick:hover,
.woocommerce .prod .prod__media button.quick:hover,
.prod .prod__media .quick:hover,
.woocommerce .prod .prod__media a.quick:focus-visible,
.prod .prod__media .quick:focus-visible {
  background: var(--terracotta-deep);
  color: var(--cream);
  transform: none;
}

/*
 * WooCommerce appends a "View cart" link after an AJAX add. Inside an
 * absolutely positioned pill it would sit on top of the product image, so it
 * is hidden on the card. The bag count in the header is the feedback.
 */
.prod .prod__media .added_to_cart {
  display: none;
}

/* --- filter and sort controls, themed --------------------------------------
 *
 * The preview drew these as pills but never had to render a real <select>. Left
 * native, the sort control renders as an operating-system dropdown: a system
 * font, a platform caret, a square white box. Next to a pill-shaped filter it
 * reads as an unstyled leftover rather than part of the design.
 *
 * `appearance: none` removes the platform chrome, and the caret is redrawn as a
 * background SVG in the brand colour so both controls share one visual language.
 * The native <select> element is kept underneath, so the browser's own dropdown,
 * keyboard behaviour and mobile picker all still work. Rebuilding that in
 * JavaScript is how you end up with a filter that cannot be used with a
 * keyboard.
 */

/* Shared caret. Encoded espresso (#2E2620) chevron. */
.pills .pill,
.woocommerce-ordering .sort {
  --nura-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%232E2620' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.woocommerce-ordering .sort {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 99px;
  background-color: transparent;
  background-image: var(--nura-caret);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 7px;
  padding: 8px 34px 8px 16px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--espresso);
  cursor: pointer;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}

.woocommerce-ordering .sort:hover {
  border-color: var(--espresso);
}

.woocommerce-ordering .sort:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
  border-color: var(--terracotta);
}

/*
 * The filter pill wraps a select. The select is transparent and stretched over
 * the pill, so the pill IS the control: the visible label and caret belong to
 * the form, and the select supplies the behaviour.
 */
.pills .pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 34px 8px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background-color: transparent;
  background-image: var(--nura-caret);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--espresso);
  cursor: pointer;
  white-space: nowrap;
}

/* The "All" reset is a plain link with no dropdown, so it carries no caret. */
.pills a.pill {
  background-image: none;
  padding-right: 16px;
  text-decoration: none;
}

.pills .pill:hover {
  border-color: var(--espresso);
}

.pills .pill.is-on {
  background-color: var(--espresso);
  border-color: var(--espresso);
  color: var(--cream);
  /* Cream chevron, so it stays visible once the pill inverts. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23FAF6F0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.pills a.pill.is-on {
  background-image: none;
}

.pills .pill select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font: inherit;
}

.pills .pill:focus-within {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .woocommerce-ordering .sort {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 640px) {
  /*
   * shop.css (generated from the preview) sets the mobile quick add back to a
   * translucent cream at this breakpoint, which is exactly the invisible-on-
   * white problem. Restated here because product.css loads after shop.css.
   */
  .woocommerce .prod .prod__media a.quick,
  .woocommerce .prod .prod__media button.quick,
  .prod .prod__media .quick {
    background: var(--espresso);
    color: var(--cream);
    opacity: 1;
    transform: none;
    padding: 10px;
    font-size: 9.5px;
  }
}

/* --- custom dropdowns -----------------------------------------------------
 *
 * A native <select> cannot be styled once open: the option list is drawn by the
 * operating system, so it arrives in a system font with system highlight
 * colours regardless of the brand. main.js replaces the visible control with a
 * button and a listbox and keeps the real select as the source of truth.
 *
 * The native select is hidden from sight but NOT from the accessibility tree in
 * a way that breaks the form: it still submits, and with JavaScript off it is
 * the visible control.
 */
.nura-select {
  position: relative;
  display: inline-block;
}

/*
 * The native select is kept in the DOM as the source of truth for the custom
 * listbox, and hidden visually rather than with display:none so it still
 * submits and still receives programmatic changes.
 *
 * left/top are NOT optional. Without them `position: absolute` leaves the
 * element at its STATIC position, which is immediately after the button, hard
 * against the right edge of the wrapper. On the shop toolbar the wrapper is
 * right-aligned, so that 1px landed just past the viewport and gave the whole
 * page a horizontal scrollbar on a phone: the page could be dragged sideways
 * on /shop/ and on the category archives, with nothing visible to explain why.
 *
 * clip-path removes it from the painted output entirely, so it cannot
 * contribute to layout overflow even if a browser rounds its box differently.
 */
.nura-select__native {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}

.nura-select__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 34px 9px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background-color: transparent;
  background-image: var(--nura-caret);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 7px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--espresso);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}

.nura-select__button:hover {
  border-color: var(--espresso);
}

.nura-select__button[aria-expanded="true"] {
  border-color: var(--espresso);
}

.nura-select__button:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.nura-select__list {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
}

.nura-select__list:focus-visible {
  outline: none;
}

.nura-select__option {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--espresso-soft);
  cursor: pointer;
  white-space: nowrap;
}

/*
 * Hover and keyboard focus share one style. The native control highlights the
 * keyboard position in the OS accent colour, which is the single most obviously
 * unbranded thing about it.
 */
.nura-select__option.is-active {
  background: var(--sand);
  color: var(--espresso);
}

.nura-select__option.is-chosen {
  color: var(--espresso);
  font-weight: 700;
}

.nura-select__option.is-chosen::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--terracotta);
  vertical-align: middle;
}

/* Inside a filter pill the button IS the pill, so it drops its own chrome. */
.pills .pill .nura-select,
.woocommerce-ordering .nura-select {
  display: inline-block;
}

/*
 * Only the pills that CONTAIN a dropdown drop their own chrome, because the
 * button inside them draws it instead. "All" is a plain link with no dropdown
 * and must keep its pill styling; stripping it globally left it as bare text
 * clipped against the edge of the toolbar.
 */
.pills form.pill:has(.nura-select) {
  padding: 0;
  border: 0;
  background: none;
}

/* Fallback for browsers without :has(). */
.pills form.pill {
  padding: 0;
  border: 0;
  background: none;
}

.pills a.pill {
  padding: 9px 16px;
  border: 1px solid var(--line);
  background-color: transparent;
}

.pills a.pill.is-on {
  background-color: var(--espresso);
  border-color: var(--espresso);
  color: var(--cream);
}

.pills .pill .nura-select__button {
  border-radius: 99px;
}

.pills .pill.is-on .nura-select__button {
  background-color: var(--espresso);
  border-color: var(--espresso);
  color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23FAF6F0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* The visible label span is replaced by the button, so hide it. */
.pills .pill > span[aria-hidden="true"] {
  display: none;
}

@media (max-width: 640px) {
  .woocommerce-ordering .nura-select,
  .woocommerce-ordering .nura-select__button {
    width: 100%;
    text-align: left;
  }
}

/* --- category hero imagery ------------------------------------------------
 *
 * The category hero photographs are close crops, and at full-bleed banner width
 * they land on an extreme zoom: a shoulder, a wall, a fragment of a bottle. They
 * are lifestyle stock rather than art-directed banners, so they do not survive
 * being blown up.
 *
 * Two changes. The image is scaled up slightly and blurred so it reads as a
 * soft textured ground rather than a photograph you are meant to look at, and
 * the scrim is strengthened so the heading and breadcrumb sit on something
 * calm. The scale compensates for the blur, which would otherwise show
 * transparent edges where the filter samples past the image bounds.
 *
 * This is a treatment for STOCK imagery. If the client supplies art-directed
 * category banners, dial the blur back or remove it.
 */
.cat-hero__media img {
  filter: blur(14px) saturate(0.9);
  transform: scale(1.12);
  transform-origin: center;
  will-change: transform;
}

/*
 * The scrim has to carry the heading, not just soften the picture.
 *
 * At 0.62 to 0.82 opacity over a DARK photograph the espresso heading sat
 * dark-on-dark and was genuinely hard to read. These images are stock and
 * unpredictably light or dark, so the scrim is now near-opaque: the photograph
 * becomes a faint texture behind the type rather than something competing with
 * it. Legibility of the category name matters more than the picture.
 */
.cat-hero .cat-hero__media .cat-hero__scrim,
.cat-hero__scrim {
  /* Higher specificity: the single-class version lost to shop.css. */
  background: linear-gradient(
    180deg,
    rgba(250, 246, 240, .94) 0%,
    rgba(250, 246, 240, .90) 50%,
    rgba(250, 246, 240, .86) 100%
  );
}

/*
 * Anyone who has asked for less motion and less visual noise gets a flatter,
 * calmer version rather than a heavy blur.
 */
@media (prefers-reduced-motion: reduce) {
  .cat-hero__media img {
    filter: blur(8px);
    transform: none;
  }
}

@media (max-width: 640px) {
  .cat-hero__media img {
    filter: blur(10px) saturate(0.9);
  }
}

/*
 * Belt and braces on the hero legibility.
 *
 * The scrim is one element and stock photography is unpredictably light or
 * dark, so the media wrapper also carries a cream wash underneath. Between the
 * two, the category name is readable whatever the photograph does.
 */
.cat-hero .cat-hero__media {
  background: var(--cream);
}

.cat-hero .cat-hero__media img {
  opacity: .28;
}

/* -------------------------------------------------------------------------
 * "Read more" on long product copy
 *
 * The clamp class is applied by JavaScript, never in the markup, so that with
 * scripting unavailable the full description renders as normal prose. A
 * CSS-only clamp would truncate the copy for those readers with no way to
 * open it.
 * ---------------------------------------------------------------------- */

.woocommerce-product-details__short-description.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--nura-clamp-lines, 7);
  line-clamp: var(--nura-clamp-lines, 7);
  overflow: hidden;
}

/*
 * Once a read-more exists, the copy hands its bottom margin to the button.
 * Otherwise the description's own 26px sat BETWEEN the text and the control
 * that opens it, so "Read more" floated away from the paragraph it belongs to
 * while colliding with the SIZE label below. The attribute is set by the
 * script and stays put whether the copy is open or closed.
 */
.prod-single .woocommerce-product-details__short-description[data-nura-clamped] {
  margin-bottom: 0;
}

/*
 * The margin below is doing real work: this button sits directly above the
 * variation picker, and without it "Read more" and the SIZE label collided.
 */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 22px;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--terracotta-deep);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}

.read-more:hover {
  color: var(--espresso);
}

.read-more:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------------
 * Variation image swap
 * ---------------------------------------------------------------------- */

.prod-single__main img {
  transition: opacity 0.25s var(--ease);
}

.prod-single__main.is-swapping img {
  opacity: 0.35;
}

@media (prefers-reduced-motion: reduce) {
  .prod-single__main img,
  .prod-single__main.is-swapping img {
    transition: none;
    opacity: 1;
  }
}

/* An unavailable variation, greyed and not clickable. */
.nura-select__option.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* -------------------------------------------------------------------------
 * Click to zoom
 * ---------------------------------------------------------------------- */

/*
 * The trigger is a button wrapping the image, so it must not look like one.
 * Everything below strips the browser's button chrome and leaves the
 * photograph exactly as it rendered before, plus a zoom cursor.
 */
.zoom-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}

.zoom-trigger:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
}

.zoom {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  /* Espresso rather than black: the overlay should still feel like the brand,
     and pure black against a cream site is a jolt. */
  background: rgba(46, 38, 32, 0.92);
  animation: zoom-in-fade 0.22s var(--ease);
  cursor: zoom-out;
}

.zoom__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  background: #fff;
  cursor: default;
}

.zoom__close {
  position: absolute;
  top: clamp(12px, 2.5vw, 24px);
  right: clamp(12px, 2.5vw, 24px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(250, 246, 240, 0.35);
  border-radius: 50%;
  background: rgba(46, 38, 32, 0.6);
  color: var(--cream);
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.zoom__close:hover {
  background: var(--terracotta-deep);
  border-color: var(--terracotta-deep);
}

.zoom__close:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.zoom__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

@keyframes zoom-in-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .zoom {
    animation: none;
  }
}

/* -------------------------------------------------------------------------
 * Empty cart
 *
 * The default was WooCommerce's: a large dark crying-face icon, an exclamation
 * mark, a dotted separator, and no link back to the shop. The blocks are
 * rewritten by bin/configure-cart-page.php; this is the styling for them.
 * ---------------------------------------------------------------------- */

/*
 * The empty cart block ships with a large top padding of its own, which sat on
 * top of the page title's spacing and left a screen of nothing before the
 * message. Trimmed so the state reads immediately.
 */
.wp-block-woocommerce-empty-cart-block {
  max-width: 100%;
  padding: 0 0 clamp(40px, 6vw, 72px);
  text-align: center;
}

.woocommerce-cart .wp-block-woocommerce-cart.is-loading,
.woocommerce-cart .wp-block-woocommerce-cart {
  margin-top: 0;
}

.nura-empty__title {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--espresso);
  margin: 0 0 10px;
}

.nura-empty__lede {
  max-width: 46ch;
  margin: 0 auto 26px;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--espresso-soft);
}

.nura-empty__cta .wp-block-button__link {
  display: inline-flex;
  /* WordPress's block button underlines its link by default, which made the
     primary call to action look like body copy that happened to have a box
     around it. */
  text-decoration: none;
  padding: 15px 32px;
  border-radius: 2px;
  background: var(--espresso);
  color: var(--cream);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

.nura-empty__cta .wp-block-button__link:hover {
  background: var(--terracotta-deep);
  transform: translateY(-2px);
}

.nura-empty__suggest {
  margin: clamp(40px, 6vw, 64px) 0 20px;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 300;
  color: var(--espresso);
}

/* -------------------------------------------------------------------------
 * Suggested products as a horizontal scroller
 *
 * Stacked, these four cards made an EMPTY cart 3 300px tall on a phone, which
 * is an absurd amount of scrolling to be told you have bought nothing. A
 * scroller keeps the whole empty state on one screen and makes the row read as
 * a suggestion rather than as the page's main content.
 *
 * Scroll snapping so cards come to rest aligned rather than half cut off.
 * ---------------------------------------------------------------------- */

.wp-block-woocommerce-empty-cart-block .wc-block-grid__products {
  display: flex;
  /*
   * nowrap is essential, not cosmetic. WooCommerce's grid sets flex-wrap:wrap,
   * so without this the cards simply wrapped onto a second row and the
   * horizontal scroll never happened.
   */
  flex-wrap: nowrap;
  gap: 14px;
  margin: 0;
  padding: 4px 0 12px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  /* Momentum scrolling on iOS, and a scrollbar that is present but quiet. */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--sand-deep) transparent;
}

.wp-block-woocommerce-empty-cart-block .wc-block-grid__products::-webkit-scrollbar {
  height: 6px;
}

.wp-block-woocommerce-empty-cart-block .wc-block-grid__products::-webkit-scrollbar-thumb {
  background: var(--sand-deep);
  border-radius: 3px;
}

/*
 * The grid class is repeated to outrank WooCommerce's own
 * `.wc-block-grid.has-4-columns .wc-block-grid__products .wc-block-grid__product`,
 * which pins every card to `flex: 1 0 25%` and made them divide the row into
 * quarters instead of keeping a fixed scrollable width.
 */
.wp-block-woocommerce-empty-cart-block .wc-block-grid__products .wc-block-grid__product,
.wp-block-woocommerce-empty-cart-block .wc-block-grid .wc-block-grid__products .wc-block-grid__product {
  flex: 0 0 auto;
  /* Deliberately not a whole number of cards: a partly visible next card is
     what tells people the row scrolls at all. */
  width: clamp(180px, 42vw, 232px);
  max-width: none;
  margin: 0;
  padding: 0;
  scroll-snap-align: start;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-image {
  display: block;
  margin-bottom: 12px;
}

.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: #fff;
  border-radius: 2px;
}

.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--espresso);
}

/* WooCommerce underlines these by default, which made the row look like a
   list of links rather than a set of product cards. */
.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-link {
  text-decoration: none;
  color: inherit;
}

.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-price {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--terracotta-deep);
}

/*
 * Buttons sat at different heights because the titles wrap to different line
 * counts. The card is a column flexbox (above) so this pushes them to the
 * bottom and lines them up across the row.
 */
.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-add-to-cart {
  margin-top: auto;
}

.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-add-to-cart .wp-block-button__link,
.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-add-to-cart a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 14px;
  border-radius: 2px;
  background: var(--espresso);
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.3s var(--ease);
}

.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-add-to-cart .wp-block-button__link:hover,
.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-add-to-cart a:hover {
  background: var(--terracotta-deep);
}

/* The star rating block is empty on every product (the catalog has no
   reviews), so it only adds a gap. */
.wp-block-woocommerce-empty-cart-block .wc-block-grid__product-rating:empty {
  display: none;
}

/*
 * Re-assert the scroller at mobile widths.
 *
 * WooCommerce's own stylesheet switches `.wc-block-grid__products` to
 * `display: block` inside a mobile media query, which outranks the unmediated
 * rule above. The result was the cards stacking again on exactly the screen
 * where the scroller matters most: stacked, an EMPTY cart ran to well over
 * 2 500px on a phone.
 *
 * The selector repeats `.wc-block-grid` to win on specificity rather than
 * relying on source order, since both rules live in media queries.
 */
@media (max-width: 782px) {
  .wp-block-woocommerce-empty-cart-block .wc-block-grid .wc-block-grid__products,
  .wp-block-woocommerce-empty-cart-block .wc-block-grid__products {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .wp-block-woocommerce-empty-cart-block .wc-block-grid .wc-block-grid__products .wc-block-grid__product,
  .wp-block-woocommerce-empty-cart-block .wc-block-grid__products .wc-block-grid__product {
    /* Wider share of a narrow screen, so the card is still readable while the
       next one stays partly visible as a scroll affordance. */
    width: clamp(168px, 62vw, 220px);
    flex: 0 0 auto;
  }
}
