/* Consistent storefront components. This sheet is deliberately absent from checkout.
   Existing colour tokens, quantity markup and mobile viewport positioning stay authoritative. */

html body .collection-page .collection-header {
  gap: 24px;
  padding: clamp(18px, 2.5vw, 30px);
  border-radius: 22px;
}
html body .collection-page .collection-header-title {
  margin-block: 6px 8px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}
html body .collection-page .collection-header-description {
  max-width: 62ch;
  font-size: .9375rem;
  line-height: 1.6;
}
html body .collection-page .collection-header-description p { margin: 0; }
html body .collection-page .collection-header-stat {
  align-self: center;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: auto;
  min-width: 0;
  padding: 14px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--brand-tint);
  color: var(--ink);
  box-shadow: none;
}
html body .collection-page .collection-header-stat strong { font-size: 1.75rem; line-height: 1.2; }
html body .collection-page .collection-header-stat span { font-size: .875rem; line-height: 1.5; }
html body .collection-page .collection-toolbar-bar { gap: 16px; }
html body .collection-page .toolbar-summary { min-width: 0; line-height: 1.5; }
html body .collection-page .toolbar-summary strong { font-size: .9375rem; }
html body .collection-page .toolbar-summary span { font-size: .875rem; line-height: 1.5; }

/* Text can grow without being pressed against a fixed-height button or card edge. */
html body .product-card .product-info { min-width: 0; }
html body .product-card .product-name {
  font-size: .9375rem;
  line-height: 1.45;
  font-weight: 600;
  overflow-wrap: anywhere;
}
html body .product-card .product-category.product-category-badges {
  font-size: .6875rem;
  line-height: 1.55;
  letter-spacing: .015em;
}
html body .product-card .product-category-badge { line-height: inherit; }
html body .product-card .product-card-actions :is(.btn-view-product, .quick-add-trigger) {
  min-width: 0;
  min-height: 44px;
  height: auto;
  padding: 10px 8px;
  gap: 6px;
  border-radius: 10px;
  font-size: .875rem;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
}
html body .product-card .product-card-actions :is(.btn-view-product, .quick-add-trigger) > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
html body .product-card .product-card-actions .icon { flex: none; width: 16px; height: 16px; }
html body .product-card:focus-within { border-color: var(--brand); }
html body .product-card :is(a, button):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -3px;
}

/* Match the selection summary to the shared quantity control, which owns length and price. */
html body.single-product .rtf-purchase-summary { padding: 14px 16px; border-radius: 14px; background: var(--surface-sunken); }
html body.single-product .rtf-purchase-summary__label { font-size: .8125rem; line-height: 1.5; }
html body.single-product .rtf-purchase-summary__choices { margin: 6px 0 0; font-size: .875rem; line-height: 1.6; }
html body.single-product .rtf-purchase-summary__total { display: none; }
html body.single-product .rtf-selected-base > strong { font-size: .9375rem; line-height: 1.5; }
html body.single-product .rtf-selected-base p { font-size: .875rem; line-height: 1.6; margin-bottom: 0; }
html body.single-product .pdp-purchase-card .reset_variations[style*="hidden"] { display: none !important; }
html body.single-product .pdp-purchase-card .variations { margin-bottom: 12px; }
html body.single-product .pdp-purchase-card .rtf-scale-option { margin-bottom: 12px; }
html body.single-product .rtf-selection-help { font-size: .8125rem !important; line-height: 1.5 !important; }
html body .rtf-product-information > .wp-block-tab-list { flex-wrap: wrap; gap: 6px; padding: 10px; }
html body .rtf-product-information .wp-block-tab-list button { min-height: 48px; padding: 12px 20px; line-height: 1.5; }
html body .rtf-product-information .wp-block-tab-list button:focus-visible { outline-offset: -3px; }
html body .rtf-product-information .rtf-fabric-meta { line-height: 1.65; }

/* A consistent 44px close control across the existing surfaces. */
html body :is(.cart-drawer-header, .wishlist-drawer-header, .mobile-menu-header, .modal-header, .quick-add-head) > button,
html body #searchClose,
html body #collectionsPanel .rtf-collections-head > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--ink-muted);
  box-shadow: none;
}
html body :is(.cart-drawer-header, .wishlist-drawer-header, .mobile-menu-header, .modal-header, .quick-add-head) > button:hover,
html body #searchClose:hover,
html body #collectionsPanel .rtf-collections-head > button:hover {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--ink);
}
html body :is(.cart-drawer-header, .wishlist-drawer-header, .mobile-menu-header, .modal-header, .quick-add-head) > button:focus-visible,
html body #searchClose:focus-visible,
html body #collectionsPanel .rtf-collections-head > button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
html body :is(.cart-drawer-header, .wishlist-drawer-header, .mobile-menu-header) :is(h2,h3) {
  min-width: 0;
  font-size: 1.125rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
html body #collectionsPanel .rtf-collection-tile { gap: 16px; }
html body #collectionsPanel .rtf-collection-name { font-size: 1rem; line-height: 1.5; }
html body #collectionsPanel .rtf-collection-meta { font-size: .8125rem; line-height: 1.5; }

@media (max-width: 900px) {
  html body .collection-page { padding-top: 24px; }
  html body .collection-page .collection-header { padding: 18px; border-radius: 20px; }
  html body .product-card .product-info { padding: 12px; }
  html body .product-card .product-name { font-size: .875rem; }
  html body .rtf-product-information .wp-block-tab-list button { min-width: 0; padding: 12px; font-size: .9375rem; }
}
@media (max-width: 600px) {
  html body .collection-page .collection-header { padding: 16px; }
  html body .collection-page .collection-header-title { font-size: 1.75rem; }
  html body .collection-page .collection-header-description { font-size: .875rem; }
  html body .collection-page .collection-toolbar-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 180px);
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
  }
  html body .collection-page .toolbar-summary > span { display: none; }
  html body .collection-page .toolbar-summary strong { font-size: .875rem; }
  html body .collection-page .catalogue-sort { min-width: 0; width: 100%; }
  html body .collection-page .catalogue-sort .woocommerce-ordering { width: 100%; margin: 0; }
  html body .collection-page .catalogue-sort .rtf-choice { min-width: 0; width: 100%; }
  html body .collection-page .catalogue-sort .rtf-choice-button { min-height: 44px; padding: 8px 10px; font-size: .8125rem; line-height: 1.5; }
  html body .product-card .product-card-actions { gap: 8px; padding-top: 12px; }
  html body .product-card .product-card-actions :is(.btn-view-product, .quick-add-trigger) { padding-inline: 4px; font-size: .8125rem; }
  html body .rtf-product-information > .wp-block-tab-list { display: flex; flex-wrap: wrap; align-items: stretch; padding: 8px; }
  /* Override the legacy global button flex rule only inside product information. */
  html body .rtf-product-information .wp-block-tab-list button { flex: 1 1 5em !important; width: auto; padding: 10px 6px; white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  html body .collection-page .collection-toolbar-bar { grid-template-columns: minmax(0,1fr) minmax(0,158px); gap: 8px; }
  html body .product-card .product-info { padding: 10px; }
  html body .product-card .product-category.product-category-badges { font-size: .6875rem; }
}
@media (max-width: 900px) and (max-height: 500px) {
  html body :is(.cart-drawer-header, .wishlist-drawer-header, .mobile-menu-header) { padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html body :is(.product-card, .collection-chip, .rtf-collection-tile) { transition: none; }
}
