/* Shared component tokens are inherited only by real content/commerce containers.
 * No global a/button/input reset and no changes to the shared navigation palette. */
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .entry-content > .woocommerce,
body.search :is(.entries, .ct-pagination),
body.blog :is(.entries, .ct-pagination),
body.single-post .entry-content,
body.error404 .ct-no-results {
  --theme-link-initial-color: var(--glade-child-ink);
  --theme-link-hover-color: #76513e;
  --theme-button-background-initial-color: var(--glade-child-ink);
  --theme-button-background-hover-color: #514337;
  --theme-button-text-initial-color: var(--glade-child-bg);
  --theme-button-text-hover-color: var(--glade-child-bg);
  --theme-button-min-height: var(--glade-ui-height);
  --theme-button-border-radius: 0;
}
:is(body.page, body.glade-archive, body.blog, body.search, body.error404) .hero-section .page-title {
  color: var(--glade-child-ink);
  font-family: var(--glade-child-display);
  font-size: clamp(2.7rem, 4.5vw, 4rem);
  line-height: 1.05;
  font-weight: 400;
}
body.search .entries .entry-title a,
body.blog .entries .entry-title a {
  color: var(--glade-child-ink);
}
body.search .entries .entry-title a:hover,
body.blog .entries .entry-title a:hover {
  color: #76513e;
  text-decoration: underline;
  text-underline-offset: 4px;
}
:is(body.search, body.blog) .ct-pagination {
  --theme-link-initial-color: var(--glade-child-ink);
  --theme-link-hover-color: #76513e;
  --theme-palette-color-1: var(--glade-child-ink);
}

/* One button/input/state contract shared by Cart, Checkout and Account. */
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce :is(.button, button.button, .checkout-button) {
  min-height: var(--glade-ui-height);
  padding: 12px 18px;
  border: 1px solid var(--glade-child-ink);
  border-radius: 0;
  background: var(--glade-child-ink);
  color: var(--glade-child-bg);
  font-family: var(--glade-child-body);
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: normal;
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce .button:not(:disabled):not(.disabled):hover {
  background: #514337;
  border-color: #514337;
  color: var(--glade-child-bg);
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce :is(.button:disabled, .button.disabled, .button[aria-disabled="true"]) {
  background: #e5dfd7;
  border-color: #c5bbb0;
  color: #6d645b;
  cursor: not-allowed;
  opacity: 1;
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce .button.loading {
  cursor: progress;
  opacity: .65;
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce :is(input.input-text, textarea, select, .select2-selection--single) {
  min-height: var(--glade-ui-height);
  border: 1px solid var(--glade-ui-line);
  border-radius: 0;
  background-color: var(--glade-ui-surface);
  color: var(--glade-child-ink);
  font-family: var(--glade-child-body);
  font-size: 1rem;
  box-sizing: border-box;
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce :is(input.input-text, textarea, select) {
  padding: 11px 13px;
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce label {
  color: var(--glade-child-ink);
  font-size: .86rem;
  line-height: 1.5;
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce :is(a, button, input, select, textarea, [role="button"], [role="combobox"]):focus-visible,
body.search :is(.entries, .ct-pagination) a:focus-visible,
body.blog :is(.entries, .ct-pagination) a:focus-visible {
  outline: 2px solid var(--glade-child-accent);
  outline-offset: 3px;
}
.glade-child-search :is(input, button):focus-visible,
body.error404 .ct-no-results :is(a, input, button):focus-visible {
  outline: 2px solid var(--glade-child-accent);
  outline-offset: 3px;
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce :is(.woocommerce-error, .woocommerce-info, .woocommerce-message) {
  background: var(--glade-ui-surface);
  color: var(--glade-child-ink);
  border: 1px solid var(--glade-ui-line);
  border-inline-start: 3px solid var(--glade-child-accent);
  font-size: .9rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce .woocommerce-error {
  border-inline-start-color: var(--glade-ui-error);
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce .woocommerce-message {
  border-inline-start-color: var(--glade-ui-success);
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce .woocommerce-info {
  border-inline-start-color: var(--glade-ui-warning);
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce :is(.woocommerce-error, .woocommerce-info, .woocommerce-message)::before {
  font-family: var(--glade-child-body);
  font-weight: 700;
}
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce .woocommerce-message::before { content: "✓"; color: var(--glade-ui-success); }
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce .woocommerce-error::before { content: "!"; color: var(--glade-ui-error); }
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce .woocommerce-info::before { content: "i"; color: var(--glade-ui-warning); }
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce .form-row.woocommerce-invalid :is(input, select, .select2-selection--single),
:is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce [aria-invalid="true"] {
  border-color: var(--glade-ui-error);
}
body.woocommerce-account .woocommerce .show-password-input {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  color: var(--glade-child-ink);
}

/* Quantity: retain native nodes. Blocksy type-2 uses absolute positioning,
 * 9% side insets and a 2px glyph margin; replace that geometry as one grid. */
body.glade-cart-page table.shop_table.cart .quantity[data-type] {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 44px minmax(52px, 1fr) 44px;
  grid-template-rows: 44px;
  width: 144px;
  min-width: 144px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--glade-ui-line);
  border-radius: 0;
  background: var(--glade-ui-surface);
}
body.glade-cart-page table.shop_table.cart .quantity[data-type] .qty {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 44px;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  text-align: center;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
body.glade-cart-page table.shop_table.cart .quantity[data-type] :is(.ct-increase, .ct-decrease) {
  position: static;
  inset: auto;
  box-sizing: border-box;
  width: 44px;
  max-width: none;
  height: 44px;
  margin: 0;
  padding: 0;
  grid-row: 1;
  transform: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--glade-child-ink);
  background: var(--glade-ui-surface);
}
body.glade-cart-page table.shop_table.cart .quantity[data-type] .ct-decrease { grid-column: 1; border-inline-end: 1px solid var(--glade-ui-line); }
body.glade-cart-page table.shop_table.cart .quantity[data-type] .ct-increase { grid-column: 3; border-inline-start: 1px solid var(--glade-ui-line); }
body.glade-cart-page table.shop_table.cart .quantity[data-type] :is(.ct-increase, .ct-decrease)::before,
body.glade-cart-page table.shop_table.cart .quantity[data-type] .ct-increase::after {
  content: "";
  grid-area: 1 / 1;
  position: static;
  inset: auto;
  margin: 0;
  padding: 0;
  width: 14px;
  height: 2px;
  background: currentColor;
  transform: none;
}
body.glade-cart-page table.shop_table.cart .quantity[data-type] .ct-increase::after { width: 2px; height: 14px; }
body.glade-cart-page table.shop_table.cart .quantity[data-type] :is(.ct-increase, .ct-decrease):hover { color: var(--glade-child-ink); background: #eae3da; }
body.glade-cart-page table.shop_table.cart .quantity[data-type]:has(input:is(:disabled, [readonly])) :is(.ct-increase, .ct-decrease) { opacity: .45; cursor: not-allowed; }

body.glade-checkout-page .ct-order-review {
  background: var(--glade-ui-surface);
  border: 1px solid var(--glade-ui-line);
  border-radius: 0;
  padding: clamp(20px, 3vw, 32px);
}
body.glade-checkout-page :is(#customer_details, .ct-order-review) h3 {
  color: var(--glade-child-ink);
  font: 400 clamp(1.65rem, 2.5vw, 2.15rem)/1.15 var(--glade-child-display);
  margin: 0 0 22px;
}
body.glade-checkout-page #payment,
body.glade-checkout-page #payment .payment_box {
  background: transparent;
  color: var(--glade-child-ink);
}
body.glade-checkout-page .woocommerce-checkout-review-order-table :is(.product-total, .order-total td) {
  font-variant-numeric: tabular-nums;
}
body.glade-checkout-page .woocommerce-checkout-review-order-table .amount {
  white-space: nowrap;
}
body.glade-checkout-page .select2-selection--single .select2-selection__rendered {
  line-height: var(--glade-ui-height);
  padding-inline: 13px 36px;
  color: var(--glade-child-ink);
}
body.glade-checkout-page .select2-selection--single .select2-selection__arrow {
  height: var(--glade-ui-height);
}
body.glade-checkout-page .select2-container--open .select2-dropdown {
  --form-field-select-active-color: var(--glade-child-bg);
  --theme-form-select-background-active-color: var(--glade-child-ink);
  border-color: var(--glade-ui-line);
  background: var(--glade-ui-surface);
}
body.glade-checkout-page .select2-dropdown .select2-search__field {
  min-height: var(--glade-ui-height);
  border: 1px solid var(--glade-ui-line);
  color: var(--glade-child-ink);
  background: var(--glade-ui-surface);
  font-family: var(--glade-child-body);
}
@media (max-width: 999.98px) {
  body.glade-cart-page table.shop_table.cart .product-mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }
  body.glade-cart-page table.shop_table.cart .product-mobile-actions .quantity[data-type] {
    flex: 0 0 144px;
  }
  /* Native duplicate remove is replaced visually by the existing full-size td control. */
  body.glade-cart-page table.shop_table.cart .product-mobile-actions > a.remove { display: none; }
}
@media (max-width: 650px) {
  /* The fixed mobile shell is 50px logo + 8px inner padding. Standard page
   * heroes need that space; the full-bleed homepage hero remains unchanged. */
  .glade-child-main:has(.hero-section) {
    padding-top: 58px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(body.glade-cart-page, body.glade-checkout-page, body.woocommerce-account) .woocommerce :is(.button, input, select, textarea) { transition: none; }
}
