.catalog-controls #category-tabs[hidden] { display: none; }

:is(.catalog-controls, #cart-dialog, #product-dialog) button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* Keep the product close button above the independently scrolling details. */
body dialog#product-dialog {
  --product-window-height: min(88dvh, calc(100dvh - 24px));
  box-sizing: border-box;
  max-height: var(--product-window-height);
  overflow: hidden;
  padding: 0;
}
#product-dialog #product-content {
  box-sizing: border-box;
  max-height: calc(var(--product-window-height) - 2px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 58px clamp(18px, 4vw, 36px) 26px;
}
#product-dialog .stock {
  padding: 13px 15px 4px;
  background: #ffffff68;
  border: 1px solid #fff;
  border-radius: 18px;
}
#product-dialog .stock h3 {
  margin: 0 0 6px;
  color: var(--green);
}
#product-dialog .stock .row {
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}
#product-dialog .stock .row:last-child { border-bottom: 0; }
#product-dialog .stock .qty { text-align: right; }
#product-dialog .stock .qty.zero { color: #59695e; }
#product-dialog .detail-description p {
  color: #3f5247;
  font-size: 14px;
  line-height: 1.7;
}
#product-dialog .detail-description strong { color: var(--ink); }

/* Only the items and checkout fields scroll. Keep the total and action visible. */
#cart-dialog .cart-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - var(--cart-window-gap, 40px) - 22px);
}
#cart-dialog .cart-heading {
  padding: 14px 20px 7px;
}
body #cart-dialog .cart-scroll {
  min-height: 0;
  max-height: none;
  padding: 0 20px 12px;
  border-radius: 0;
  scrollbar-gutter: auto;
}
#cart-dialog .cart-summary {
  display: grid;
  gap: 8px;
  padding: 12px 20px 10px;
  border-top: 1px solid var(--line);
}
#cart-dialog .cart-summary:has(#cart-total[hidden]) { display: none; }
body #cart-dialog .cart-summary #cart-total {
  margin: 0;
  padding: 0;
  border: 0;
}
#cart-dialog .cart-summary .primary {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}
#cart-dialog:not(:has(#pickup-login:not([hidden]))) #cart-login-action,
#cart-dialog:not(:has(#pickup-form:not([hidden]))) #pickup-submit,
#cart-dialog:has(#pickup-login:not([hidden])) #cart-copy {
  display: none;
}
#cart-dialog #pickup-message:empty,
#cart-dialog #cart-message:empty { display: none; }
@media (max-width: 760px) {
  #cart-dialog .cart-heading { padding: 12px 10px 6px; }
  body #cart-dialog .cart-scroll { padding-inline: 10px; }
  #cart-dialog .cart-summary { padding: 10px 10px 6px; }
}
