diff --git a/modules/enforcement/commerce_stock_enforcement.module b/modules/enforcement/commerce_stock_enforcement.module
index 444314f..541ca2b 100644
--- a/modules/enforcement/commerce_stock_enforcement.module
+++ b/modules/enforcement/commerce_stock_enforcement.module
@@ -106,6 +106,27 @@ function commerce_stock_enforcement_form_alter(
     // Add a submit validate.
     $form['#validate'] = array_merge($form['#validate'], ['commerce_stock_enforcement_checkout_form_validate']);
   }
+
+  // Add class for out-of-stock sizes in the 'Add to Cart' form.
+  if (strpos($form_id, 'commerce_order_item_add_to_cart_form_commerce_product_') === 0) {
+    $variation = ProductVariation::load($form['purchased_entity']['widget'][0]['variation']['#value']);
+    if ($variation) {
+      $product = $variation->getProduct();
+      $size_options = &$form['purchased_entity']['widget'][0]['attributes']['attribute_size']['#options'] ?? [];
+      foreach ($product->getVariations() as $variation) {
+        $stock_level = \Drupal::service('commerce_stock.service_manager')->getStockLevel($variation);
+        $size = $variation->getAttributeValue('attribute_size');
+        if ($stock_level <= 0 && $size) {
+          $size_id = $size->id();
+          if (isset($size_options[$size_id])) {
+            $size_options[$size_id] = [
+              '#markup' => '<span class="size-out-of-stock">' . $size_options[$size_id] . '</span>',
+            ];
+          }
+        }
+      }
+    }
+  }
 }
 
 /**
